public class FeatureInstaller
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
FeatureInstaller.JumpMenuListener |
static interface |
FeatureInstaller.Menu |
Constructor and Description |
---|
FeatureInstaller(WorkbenchContext workbenchContext) |
Modifier and Type | Method and Description |
---|---|
void |
addLayerNameViewMenuItem(PlugIn executable,
java.lang.String[] menuPath,
java.lang.String menuItemName)
Deprecated.
|
void |
addLayerNameViewMenuItem(PlugIn executable,
java.lang.String menuName,
java.lang.String menuItemName)
Deprecated.
|
void |
addLayerViewMenuItem(PlugIn executable,
java.lang.String[] menuPath,
java.lang.String menuItemName)
Deprecated.
|
void |
addLayerViewMenuItem(PlugIn executable,
java.lang.String menuName,
java.lang.String menuItemName)
Deprecated.
|
static javax.swing.JMenu |
addMainMenu(FeatureInstaller featureInstaller,
java.lang.String[] menuPath,
java.lang.String menuName,
int pos)
Create and add a sub menu entry. index < 0 adds it to the end.
|
javax.swing.JMenuItem |
addMainMenuItem(PlugIn plugin,
java.lang.String[] menuPath,
javax.swing.JMenuItem menuItem,
EnableCheck enableCheck)
Deprecated.
use addMainMenuPlugin() instead
|
javax.swing.JMenuItem |
addMainMenuItem(PlugIn plugin,
java.lang.String[] menuPath,
javax.swing.JMenuItem menuItem,
EnableCheck enableCheck,
int pos)
Deprecated.
use addMainMenuPlugin() instead
|
void |
addMainMenuItem(PlugIn executable,
java.lang.String[] menuPath,
java.lang.String menuItemName,
boolean checkBox,
javax.swing.Icon icon,
EnableCheck enableCheck)
Deprecated.
|
void |
addMainMenuItem(PlugIn executable,
java.lang.String menuName,
java.lang.String menuItemName,
javax.swing.Icon icon,
EnableCheck enableCheck)
Deprecated.
|
javax.swing.JMenuItem |
addMainMenuItem(java.lang.String[] menuPath,
AbstractUiPlugIn plugin)
Deprecated.
use addMainMenuPlugin() instead
|
javax.swing.JMenuItem |
addMainMenuItem(java.lang.String[] menuPath,
AbstractUiPlugIn plugin,
EnableCheck enableCheck)
Deprecated.
use addMainMenuPlugin() instead
|
javax.swing.JMenuItem |
addMainMenuItem(java.lang.String[] menuPath,
AbstractUiPlugIn plugin,
EnableCheck enableCheck,
int pos)
Deprecated.
use addMainMenuPlugin() instead
|
javax.swing.JMenuItem |
addMainMenuItem(java.lang.String[] menuPath,
AbstractUiPlugIn plugin,
int pos)
Deprecated.
use addMainMenuPlugin() instead
|
javax.swing.JMenuItem |
addMainMenuItem(java.lang.String[] menuPath,
AbstractUiPlugIn plugin,
javax.swing.JMenuItem menuItem,
EnableCheck enableCheck,
int pos)
Deprecated.
use addMainMenuPlugin() instead
|
javax.swing.JMenuItem |
addMainMenuItem(java.lang.String[] menuPath,
AbstractUiPlugIn plugin,
javax.swing.JMenuItem menuItem,
int pos)
Deprecated.
use addMainMenuPlugin() instead
|
javax.swing.JMenuItem |
addMainMenuPlugin(PlugIn executable,
java.lang.String[] menuPath) |
javax.swing.JMenuItem |
addMainMenuPlugin(PlugIn executable,
java.lang.String[] menuPath,
java.lang.String menuItemName,
boolean checkBox,
javax.swing.Icon icon,
EnableCheck enableCheck)
Convenience method without position parameter.
|
javax.swing.JMenuItem |
addMainMenuPlugin(PlugIn executable,
java.lang.String[] menuPath,
java.lang.String menuItemName,
boolean checkBox,
javax.swing.Icon icon,
EnableCheck enableCheck,
int pos)
Replacement for the retired methods above and below.
|
void |
addMenuItemShownListener(javax.swing.JMenuItem menuItem,
MenuItemShownListener menuItemShownListener) |
javax.swing.JMenuItem |
addMenuPlugin(java.lang.String menuKey,
PlugIn plugin)
a generic addMenu method, fetching all settings from workbench properties
and the plugin object. used in PluginManager
|
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[] menuPath,
java.lang.String menuItemName,
boolean checkBox,
javax.swing.Icon icon,
EnableCheck enableCheck)
Deprecated.
use addPopupMenuPlugin instead
|
void |
addPopupMenuItem(javax.swing.JPopupMenu popupMenu,
PlugIn executable,
java.lang.String menuItemName,
boolean checkBox,
javax.swing.Icon icon,
EnableCheck enableCheck)
Deprecated.
use addPopupMenuPlugin instead
|
javax.swing.JMenuItem |
addPopupMenuPlugin(javax.swing.JPopupMenu popupMenu,
PlugIn executable)
Ultimate convenience method for attaching a plugin to a popupmenu.
|
javax.swing.JMenuItem |
addPopupMenuPlugin(javax.swing.JPopupMenu popupMenu,
PlugIn executable,
java.lang.String[] menuPath)
Convenience method for entries with menupath
|
javax.swing.JMenuItem |
addPopupMenuPlugin(javax.swing.JPopupMenu popupMenu,
PlugIn executable,
java.lang.String[] menuPath,
java.lang.String menuItemName,
boolean checkBox,
javax.swing.Icon icon,
EnableCheck enableCheck)
Analogue to addMainMenuPlugin().
|
javax.swing.JMenuItem |
addPopupMenuPlugin(javax.swing.JPopupMenu popupMenu,
PlugIn executable,
java.lang.String menuItemName,
boolean checkBox,
javax.swing.Icon icon,
EnableCheck enableCheck)
Convenience method for entries without menupath
|
void |
addPopupMenuSeparator(javax.swing.JPopupMenu popupMenu,
java.lang.String[] menuPath) |
static javax.swing.JMenuItem |
childMenuItem(java.lang.String childName,
FeatureInstaller.Menu menu)
Find the first occurrence of a menu item with the given name and return it.
|
MultiEnableCheck |
createFenceExistsCheck()
Deprecated.
Use the EnableCheckFactory methods instead
|
MultiEnableCheck |
createLayersSelectedCheck()
Deprecated.
Use the EnableCheckFactory methods instead
|
static FeatureInstaller.Menu |
createMenusIfNecessary(FeatureInstaller.Menu parent,
java.lang.String[] menuPath) |
static FeatureInstaller.Menu |
createMenusIfNecessary(FeatureInstaller.Menu parent,
java.lang.String[] menuPath,
java.lang.Object[] menuPathPositions) |
MultiEnableCheck |
createOneLayerSelectedCheck()
Deprecated.
Use the EnableCheckFactory methods instead
|
MultiEnableCheck |
createVectorsExistCheck()
Deprecated.
Use the EnableCheckFactory methods instead
|
java.lang.String |
fetchKeyForMenu(java.lang.Object menu) |
FeatureInstaller.Menu |
fetchMenuForKey(java.lang.String key) |
static FeatureInstaller |
getInstance() |
static javax.swing.JMenuItem |
installMnemonic(javax.swing.JMenuItem menuItem,
javax.swing.MenuElement parent) |
boolean |
isSeparatingEnabled() |
javax.swing.JMenuBar |
menuBar() |
javax.swing.JMenu |
menuBarMenu(java.lang.String childName) |
static javax.swing.JMenu |
popupMenu(javax.swing.JPopupMenu popupMenu,
java.lang.String childName) |
void |
setSeparatingEnabled(boolean onoff) |
void |
updateSeparatorsInAllMenus() |
static FeatureInstaller.Menu |
wrapMenu(javax.swing.JMenu menu) |
static FeatureInstaller.Menu |
wrapMenu(javax.swing.JMenuBar menu) |
static FeatureInstaller.Menu |
wrapMenu(javax.swing.JPopupMenu popupMenu) |
public FeatureInstaller(WorkbenchContext workbenchContext)
public static final FeatureInstaller getInstance()
public MultiEnableCheck createLayersSelectedCheck()
public MultiEnableCheck createOneLayerSelectedCheck()
public MultiEnableCheck createVectorsExistCheck()
public MultiEnableCheck createFenceExistsCheck()
public void addMenuSeparator(java.lang.String menu)
public void addMenuSeparator(java.lang.String[] menuPath)
public void addMenuSeparator(javax.swing.JMenu menu)
public void addLayerViewMenuItem(PlugIn executable, java.lang.String menuName, java.lang.String menuItemName)
public void addLayerNameViewMenuItem(PlugIn executable, java.lang.String menuName, java.lang.String menuItemName)
public void addLayerViewMenuItem(PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName)
public void addLayerNameViewMenuItem(PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName)
public void addMainMenuItem(PlugIn executable, java.lang.String menuName, java.lang.String menuItemName, javax.swing.Icon icon, EnableCheck enableCheck)
public static javax.swing.JMenu addMainMenu(FeatureInstaller featureInstaller, java.lang.String[] menuPath, java.lang.String menuName, int pos)
featureInstaller
- menuPath
- menuName
- pos
- public javax.swing.JMenuItem addMainMenuPlugin(PlugIn executable, java.lang.String[] menuPath)
public javax.swing.JMenuItem addMainMenuPlugin(PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck)
public javax.swing.JMenuItem addMainMenuPlugin(PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck, int pos)
executable
- menuPath
- string array of sub menu entries to place the entry inmenuItemName
- name of the menu itemcheckBox
- whether to create a JCheckBoxMenuItem or a JMenuItemicon
- an Icon or nullenableCheck
- conditions to make the plugin available to the userpos
- defines the position of the menu item in the menuGUIUtil.toSmallIcon(javax.swing.ImageIcon)
public javax.swing.JMenuItem addMenuPlugin(java.lang.String menuKey, PlugIn plugin)
menuKey
- plugin
- public javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath, AbstractUiPlugIn plugin)
menuPath
- path from the main menu to the menu itemplugin
- the plugin associated to this menu itempublic javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath, AbstractUiPlugIn plugin, int pos)
menuPath
- path from the main menu to the menu itemplugin
- the plugin associated to this menu itempos
- defines the position of the menu item in the menu -1 adds menuItem
at the end except for FILE menu where -1 adds menuItem before the
separator preceding exit menu itempublic javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath, AbstractUiPlugIn plugin, EnableCheck enableCheck)
menuPath
- path from the main menu to the menu itemplugin
- the plugin associated to this menu itemenableCheck
- conditions making the plugin enabledpublic javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath, AbstractUiPlugIn plugin, EnableCheck enableCheck, int pos)
menuPath
- path from the main menu to the menu itemplugin
- the plugin associated to this menu itemenableCheck
- conditions making the plugin enabledpos
- defines the position of the menu item in the menu -1 adds menuItem
at the end except for FILE menu where -1 adds menuItem before the
separator preceding exit menu itempublic javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath, AbstractUiPlugIn plugin, javax.swing.JMenuItem menuItem, int pos)
menuPath
- path from the main menu to the menu itemplugin
- the plugin associated to this menu itemmenuItem
- the menu item (JMenuItem, JCheckBoxMenuItem, JMenu,
JRadioButtonMenuItem)pos
- defines the position of the menu item in the menu -1 adds menuItem
at the end except for FILE menu where -1 adds menuItem before the
separator preceding exit menu itempublic javax.swing.JMenuItem addMainMenuItem(java.lang.String[] menuPath, AbstractUiPlugIn plugin, javax.swing.JMenuItem menuItem, EnableCheck enableCheck, int pos)
menuPath
- the menu path made of the menu and submenu namesplugin
- the plugin to execute with this itemmenuItem
- the JMenuItem (or JCheckBoxMenuItem or JRadioButtonMenuItem) to
the parent menuenableCheck
- conditions making the plugin enabledpos
- defines the position of the menu item in the menu -1 adds menuItem
at the end except for FILE menu where -1 adds menuItem before the
separator preceding exit menu itempublic void addMainMenuItem(PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck)
menuPath
- separate items with slashes; items will be created if they do not
already existmenuItemName
- name of the menu itemcheckBox
- whether to create a JCheckBoxMenuItem or a JMenuItemicon
- an Icon or nullenableCheck
- conditions to make the plugin available to the userGUIUtil.toSmallIcon(javax.swing.ImageIcon)
public javax.swing.JMenuItem addMainMenuItem(PlugIn plugin, java.lang.String[] menuPath, javax.swing.JMenuItem menuItem, EnableCheck enableCheck)
plugin
- the plugin to execute with this itemmenuPath
- the menu path made of the menu and submenu namesmenuItem
- the JMenuItem (or JCheckBoxMenuItem or JRadioButtonMenuItem) to
the parent menuenableCheck
- conditions making the plugin enabledpublic javax.swing.JMenuItem addMainMenuItem(PlugIn plugin, java.lang.String[] menuPath, javax.swing.JMenuItem menuItem, EnableCheck enableCheck, int pos)
plugin
- the plugin to execute with this itemmenuPath
- the menu path made of the menu and submenu namesmenuItem
- the JMenuItem (or JCheckBoxMenuItem or JRadioButtonMenuItem) to
the parent menuenableCheck
- conditions making the plugin enabledpos
- defines the position of menuItem in the menu -1 adds menuItem at
the end of the menu except for FILE menu where -1 adds menuItem
before the separator preceding exit menuItempublic void addMenuItemShownListener(javax.swing.JMenuItem menuItem, MenuItemShownListener menuItemShownListener)
public javax.swing.JMenuItem addPopupMenuPlugin(javax.swing.JPopupMenu popupMenu, PlugIn executable)
popupMenu
- executable
- public javax.swing.JMenuItem addPopupMenuPlugin(javax.swing.JPopupMenu popupMenu, PlugIn executable, java.lang.String[] menuPath)
public javax.swing.JMenuItem addPopupMenuPlugin(javax.swing.JPopupMenu popupMenu, PlugIn executable, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck)
checkBox
- true for item to be checkableenableCheck
- , icon null to leave unspecifiedpublic javax.swing.JMenuItem addPopupMenuPlugin(javax.swing.JPopupMenu popupMenu, PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck)
popupMenu
- executable
- menuPath
- menuItemName
- checkBox
- icon
- enableCheck
- public void addPopupMenuItem(javax.swing.JPopupMenu popupMenu, PlugIn executable, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck)
public void addPopupMenuItem(javax.swing.JPopupMenu popupMenu, PlugIn executable, java.lang.String[] menuPath, java.lang.String menuItemName, boolean checkBox, javax.swing.Icon icon, EnableCheck enableCheck)
public boolean isSeparatingEnabled()
public void setSeparatingEnabled(boolean onoff)
public void updateSeparatorsInAllMenus()
public java.lang.String fetchKeyForMenu(java.lang.Object menu)
public FeatureInstaller.Menu fetchMenuForKey(java.lang.String key)
public void addPopupMenuSeparator(javax.swing.JPopupMenu popupMenu, java.lang.String[] menuPath)
public static javax.swing.JMenu popupMenu(javax.swing.JPopupMenu popupMenu, java.lang.String childName)
public static FeatureInstaller.Menu wrapMenu(javax.swing.JPopupMenu popupMenu)
public static FeatureInstaller.Menu wrapMenu(javax.swing.JMenu menu)
public static FeatureInstaller.Menu wrapMenu(javax.swing.JMenuBar menu)
public javax.swing.JMenuBar menuBar()
public javax.swing.JMenu menuBarMenu(java.lang.String childName)
public static FeatureInstaller.Menu createMenusIfNecessary(FeatureInstaller.Menu parent, java.lang.String[] menuPath)
public static FeatureInstaller.Menu createMenusIfNecessary(FeatureInstaller.Menu parent, java.lang.String[] menuPath, java.lang.Object[] menuPathPositions)
public static javax.swing.JMenuItem childMenuItem(java.lang.String childName, FeatureInstaller.Menu menu)
childName
- menu
- public static javax.swing.JMenuItem installMnemonic(javax.swing.JMenuItem menuItem, javax.swing.MenuElement parent)