com.vividsolutions.jump.workbench.ui.plugin
Class FeatureInstaller

java.lang.Object
  extended by com.vividsolutions.jump.workbench.ui.plugin.FeatureInstaller

public class FeatureInstaller
extends java.lang.Object

Adds a plug-in to the JUMP Workbench as a menu item.


Constructor Summary
FeatureInstaller(WorkbenchContext workbenchContext)
           
 
Method Summary
 void addLayerNameViewMenuItem(PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName)
          Add a menu item to the main menu that is enabled only if the active internal frame is a LayerViewPanelProxy and a LayerNamePanelProxy.
 void addLayerNameViewMenuItem(PlugIn executable, java.lang.String menuName, java.lang.String menuItemName)
           
 void addLayerViewMenuItem(PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName)
          Add a menu item to the main menu that is enabled only if the active internal frame is a LayerViewPanelProxy.
 void addLayerViewMenuItem(PlugIn executable, java.lang.String menuName, java.lang.String menuItemName)
           
static javax.swing.JMenu addMainMenu(FeatureInstaller featureInstaller, java.lang.String[] menuPath, java.lang.String menuName, int index)
           
 void addMainMenuItem(PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck)
           
 void addMainMenuItem(PlugIn executable, java.lang.String menuName, java.lang.String menuItemName, javax.swing.Icon icon, EnableCheck enableCheck)
           
 javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath, AbstractUiPlugIn plugIn)
           
 javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath, AbstractUiPlugIn plugin, int index)
           
 javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath, AbstractUiPlugIn plugin, javax.swing.JMenuItem menuItem, int index)
          Add a Plugin as a JMenuItem or a subclass of JMenuItem to the main menu
 void addMainMenuItemWithJava14Fix(PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck)
          Workaround for Java Bug 4809393: "Menus disappear prematurely after displaying modal dialog" Evidently fixed in Java 1.5.
 void addMenuItemShownListener(javax.swing.JMenuItem menuItem, MenuItemShownListener menuItemShownListener)
           
 void addMenuSeparator(javax.swing.JMenu menu)
           
 void addMenuSeparator(java.lang.String menu)
           
 void addMenuSeparator(java.lang.String[] menuPath)
           
 void addPopupMenuItem(javax.swing.JPopupMenu popupMenu, PlugIn executable, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck)
           
 java.lang.String[] behead(java.lang.String[] a1)
           
static javax.swing.JMenuItem childMenuItem(java.lang.String childName, javax.swing.MenuElement menu)
           
 MultiEnableCheck createFenceExistsCheck()
          Deprecated. Use the EnableCheckFactory methods instead
 MultiEnableCheck createLayersSelectedCheck()
          Deprecated. Use the EnableCheckFactory methods instead
 javax.swing.JMenu createMenusIfNecessary(javax.swing.JMenu parent, java.lang.String[] menuPath)
           
 MultiEnableCheck createOneLayerSelectedCheck()
          Deprecated. Use the EnableCheckFactory methods instead
 MultiEnableCheck createVectorsExistCheck()
          Deprecated. Use the EnableCheckFactory methods instead
static javax.swing.JMenuItem installMnemonic(javax.swing.JMenuItem menuItem, javax.swing.MenuElement parent)
           
 javax.swing.JMenuBar menuBar()
           
 javax.swing.JMenu menuBarMenu(java.lang.String childName)
           
static java.lang.String removeProperties(java.lang.String menuItemName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureInstaller

public FeatureInstaller(WorkbenchContext workbenchContext)
Method Detail

createLayersSelectedCheck

public MultiEnableCheck createLayersSelectedCheck()
Deprecated. Use the EnableCheckFactory methods instead


createOneLayerSelectedCheck

public MultiEnableCheck createOneLayerSelectedCheck()
Deprecated. Use the EnableCheckFactory methods instead


createVectorsExistCheck

public MultiEnableCheck createVectorsExistCheck()
Deprecated. Use the EnableCheckFactory methods instead


createFenceExistsCheck

public MultiEnableCheck createFenceExistsCheck()
Deprecated. Use the EnableCheckFactory methods instead


addMenuSeparator

public void addMenuSeparator(java.lang.String menu)

addMenuSeparator

public void addMenuSeparator(java.lang.String[] menuPath)

addMenuSeparator

public void addMenuSeparator(javax.swing.JMenu menu)

behead

public java.lang.String[] behead(java.lang.String[] a1)

addMainMenuItem

public void addMainMenuItem(PlugIn executable,
                            java.lang.String menuName,
                            java.lang.String menuItemName,
                            javax.swing.Icon icon,
                            EnableCheck enableCheck)

addLayerViewMenuItem

public void addLayerViewMenuItem(PlugIn executable,
                                 java.lang.String menuName,
                                 java.lang.String menuItemName)

addLayerNameViewMenuItem

public void addLayerNameViewMenuItem(PlugIn executable,
                                     java.lang.String menuName,
                                     java.lang.String menuItemName)

addLayerViewMenuItem

public void addLayerViewMenuItem(PlugIn executable,
                                 java.lang.String[] menuPath,
                                 java.lang.String menuItemName)
Add a menu item to the main menu that is enabled only if the active internal frame is a LayerViewPanelProxy.


addLayerNameViewMenuItem

public void addLayerNameViewMenuItem(PlugIn executable,
                                     java.lang.String[] menuPath,
                                     java.lang.String menuItemName)
Add a menu item to the main menu that is enabled only if the active internal frame is a LayerViewPanelProxy and a LayerNamePanelProxy.


addMainMenuItem

public void addMainMenuItem(PlugIn executable,
                            java.lang.String[] menuPath,
                            java.lang.String menuItemName,
                            boolean checkBox,
                            javax.swing.Icon icon,
                            EnableCheck enableCheck)
Parameters:
menuPath - separate items with slashes; items will be created if they do not already exist
menuItemName - name of the menu item
checkBox - whether to create a JCheckBoxMenuItem or a JMenuItem
See Also:
GUIUtil.toSmallIcon(javax.swing.ImageIcon)

addMainMenuItem

public javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath,
                                             AbstractUiPlugIn plugin,
                                             int index)

addMainMenuItem

public javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath,
                                             AbstractUiPlugIn plugin,
                                             javax.swing.JMenuItem menuItem,
                                             int index)
Add a Plugin as a JMenuItem or a subclass of JMenuItem to the main menu

Parameters:
menuPath - path from the main menu to the menu item
plugin - the plugin associated to this menu item
menuItem - the menu item (JMenuItem, JCheckBoxMenuItem, JMenu, JRadioButtonMenuItem)
index - the index of the menu item in its parent menu

removeProperties

public static java.lang.String removeProperties(java.lang.String menuItemName)

installMnemonic

public static javax.swing.JMenuItem installMnemonic(javax.swing.JMenuItem menuItem,
                                                    javax.swing.MenuElement parent)

createMenusIfNecessary

public javax.swing.JMenu createMenusIfNecessary(javax.swing.JMenu parent,
                                                java.lang.String[] menuPath)
Returns:
the leaf

addMenuItemShownListener

public void addMenuItemShownListener(javax.swing.JMenuItem menuItem,
                                     MenuItemShownListener menuItemShownListener)

addPopupMenuItem

public void addPopupMenuItem(javax.swing.JPopupMenu popupMenu,
                             PlugIn executable,
                             java.lang.String menuItemName,
                             boolean checkBox,
                             javax.swing.Icon icon,
                             EnableCheck enableCheck)
Parameters:
enableCheck - null to leave unspecified

menuBar

public javax.swing.JMenuBar menuBar()

menuBarMenu

public javax.swing.JMenu menuBarMenu(java.lang.String childName)
Returns:
the menu with the given name, or null if no such menu exists

childMenuItem

public static javax.swing.JMenuItem childMenuItem(java.lang.String childName,
                                                  javax.swing.MenuElement menu)

addMainMenuItemWithJava14Fix

public void addMainMenuItemWithJava14Fix(PlugIn executable,
                                         java.lang.String[] menuPath,
                                         java.lang.String menuItemName,
                                         boolean checkBox,
                                         javax.swing.Icon icon,
                                         EnableCheck enableCheck)
Workaround for Java Bug 4809393: "Menus disappear prematurely after displaying modal dialog" Evidently fixed in Java 1.5. The workaround is to wrap #actionPerformed with SwingUtilities#invokeLater.


addMainMenu

public static javax.swing.JMenu addMainMenu(FeatureInstaller featureInstaller,
                                            java.lang.String[] menuPath,
                                            java.lang.String menuName,
                                            int index)

addMainMenuItem

public javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath,
                                             AbstractUiPlugIn plugIn)