better positioning of dialog on the screen
[instantlauncher.git] / src / main / java / eu / svjatoslav / instantlauncher / menu / Menu.java
index f14caef..a99c7c0 100755 (executable)
@@ -48,46 +48,6 @@ public class Menu {
         buildContentPanel(directory);
     };
 
-    /**
-     * <pre>
-     * Assign specific colors to:
-     *    Directory
-     *    Executable file
-     *    Non executable file
-     * </pre>
-     */
-    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;
     }
 
+    /**
+     * <pre>
+     * Assign specific colors to:
+     *    Directory
+     *    Executable file
+     *    Non executable file
+     * </pre>
+     */
+    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);
             }
         }