-
Notifications
You must be signed in to change notification settings - Fork 640
modified look and feel to make timeline work on autopsy-linux #3438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| private void setUnixLookAndFeel(){ | ||
| try { | ||
| //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a duplicate line, commented out?
| //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); | ||
| UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); | ||
| } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { | ||
| Exceptions.printStackTrace(ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please log the error, don't print it to stdout.
What happens to the LAF if an exception is thrown here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rishwanth1995 says that if there is an exception, the native look and feel will be used, which will cause the problem we are trying to solve to manifest anyway. Perhaps we want to have a new setting to indicate whether or not it is "safe" to run the Timelline tool. Perhaps it is not worth it? @bcarrier, what are your thoughts on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can solve that in the next release. This is good enough for now.
| import javax.swing.UnsupportedLookAndFeelException; | ||
| import org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI; | ||
| import org.openide.modules.ModuleInstall; | ||
| import org.openide.util.Exceptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import is not needed, see below.
…sable timeline for native LAF
…sable timeline for native LAF
| //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); | ||
| UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); | ||
| } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { | ||
| Exceptions.printStackTrace(ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rishwanth1995 says that if there is an exception, the native look and feel will be used, which will cause the problem we are trying to solve to manifest anyway. Perhaps we want to have a new setting to indicate whether or not it is "safe" to run the Timelline tool. Perhaps it is not worth it? @bcarrier, what are your thoughts on this?
| private static final long serialVersionUID = 1L; | ||
| private static final Logger logger = Logger.getLogger(Installer.class.getName()); | ||
| private static Installer instance; | ||
| public static boolean enableTimeline = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our coding guidelines prohibit global variables. Please put this value in a properties file for Timeline to read. There is a ModuleSettings utility class that could be used for managing the properties file.
Note that you will need to reset the property to enabled at the beginning of this set LAF operation.
| enableTimeline=false; | ||
| } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex1) { | ||
| logger.log(Level.WARNING, "Error setting native look-and-feel",ex1); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that you say that the default system LAF will be used anyway, I think we should reduce code complexity here (i.e., eliminate the nested try-catch) and simply set the property to false after logging the error.
lookandfeel is set to crossplatform instead of native look and feel.