X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Finstantlauncher%2Fmenu%2FMenu.java;h=a99c7c026850f2afdfd1ac93652c019f2a75595d;hb=7afbbed8e0cef27a47dd7599aadc5c2c814c7dea;hp=f14caef3b771fff6e8500fa3212afa16aae8d0ad;hpb=dac6fb0ccc0cdb5ad160f4808a300a32d5d9a396;p=instantlauncher.git diff --git a/src/main/java/eu/svjatoslav/instantlauncher/menu/Menu.java b/src/main/java/eu/svjatoslav/instantlauncher/menu/Menu.java index f14caef..a99c7c0 100755 --- a/src/main/java/eu/svjatoslav/instantlauncher/menu/Menu.java +++ b/src/main/java/eu/svjatoslav/instantlauncher/menu/Menu.java @@ -48,46 +48,6 @@ public class Menu { buildContentPanel(directory); }; - /** - *
-     * Assign specific colors to:
-     *    Directory
-     *    Executable file
-     *    Non executable file
-     * 
- */ - public static Color getFileColor(final File file, final boolean selected) { - if (file.isDirectory()) { - if (selected) { - return BUTTON_BG_DIRECTORY_SELECTED; - } else { - return BUTTON_BG_DIRECTORY; - } - } - - if (file.isFile()) { - if (file.canExecute()) { - if (selected) { - return BUTTON_BG_EXECUTABLE_FILE_SELECTED; - } else { - return BUTTON_BG_EXECUTABLE_FILE; - } - } else { - if (selected) { - return BUTTON_BG_NONEXECUTABLE_FILE_SELECTED; - } else { - return BUTTON_BG_NONEXECUTABLE_FILE; - } - } - } - - if (selected) { - return BUTTON_BG_LINK_SELECTED; - } else { - return BUTTON_BG_LINK; - } - } - public void addMenuListener(final MenuListener menuListener) { menuListeners.add(menuListener); } @@ -184,6 +144,46 @@ public class Menu { this.selectedFile = selectedFile; } + /** + *
+     * Assign specific colors to:
+     *    Directory
+     *    Executable file
+     *    Non executable file
+     * 
+ */ + public static Color getFileColor(final File file, final boolean selected) { + if (file.isDirectory()) { + if (selected) { + return BUTTON_BG_DIRECTORY_SELECTED; + } else { + return BUTTON_BG_DIRECTORY; + } + } + + if (file.isFile()) { + if (file.canExecute()) { + if (selected) { + return BUTTON_BG_EXECUTABLE_FILE_SELECTED; + } else { + return BUTTON_BG_EXECUTABLE_FILE; + } + } else { + if (selected) { + return BUTTON_BG_NONEXECUTABLE_FILE_SELECTED; + } else { + return BUTTON_BG_NONEXECUTABLE_FILE; + } + } + } + + if (selected) { + return BUTTON_BG_LINK_SELECTED; + } else { + return BUTTON_BG_LINK; + } + } + public static class ButtonMouseListener implements MouseListener { JButton parentButton; @@ -207,7 +207,7 @@ public class Menu { parentMenu.notifyAlternativeEventListeners(file); } } catch (final Exception ex) { - ExceptionDialog.showException(ex); + new ExceptionDialog(ex); } } @@ -228,7 +228,7 @@ public class Menu { } } } catch (final Exception ex) { - ExceptionDialog.showException(ex); + new ExceptionDialog(ex); } }