public abstract class AbstractMDIMenuFactory extends java.lang.Object implements MDIMenuFactory
AbstractMDIApplication.| Modifier and Type | Field and Description |
|---|---|
protected MDIAbout |
aboutAction
The MDIApplication About component, if there is any.
|
protected GUIApplication |
appli
The MDIApplication.
|
protected java.util.Map<java.lang.String,javax.swing.JMenu> |
bookmarkedMenus
The bookmarked menus.
|
protected javax.swing.JMenuItem |
closeAllItem
The default Close all item for MDIApplication tabs.
|
protected javax.swing.JMenuItem |
closeItem
The default Close item for MDIApplication tabs.
|
protected javax.swing.JMenuItem |
closeOtherItem
The default Close other item for MDIApplication tabs.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
dynamicMenuKeyMap
The key map for dynamic menus.
|
protected javax.swing.AbstractAction |
exitAction
The default exit Action for the MDIApplication.
|
protected PluginsMenuFactory |
fac
The factory for Plugins menus management.
|
protected javax.swing.JMenuBar |
Mbar
The Menu bar.
|
protected ProgressInterface |
progress
The Splash Screen, if there is any.
|
protected MDISettings |
settingsAction
The MDIApplication Settings component, if there is any.
|
protected java.util.Map<java.lang.String,javax.swing.JMenu> |
staticMenuKeyMap
The key map for static menus.
|
protected javax.swing.JPanel |
tbarPanel
The Tool bar panel.
|
| Constructor and Description |
|---|
AbstractMDIMenuFactory()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPluginsToolBar()
Add the Toolbar for the Plugins.
|
boolean |
addToBookmarkedMenu(java.lang.String bookmark,
javax.swing.AbstractAction action)
Add an action to a bookmarked menu.
|
boolean |
addToBookmarkedMenu(java.lang.String bookmark,
javax.swing.JComponent comp)
Add a component to a bookmarked menu.
|
boolean |
addToDynamicMenuMap(java.lang.String menuKey,
javax.swing.AbstractAction action)
Add the AbstractAction to the dynamic menu Map, under the menuKey key.
|
boolean |
addToDynamicMenuMap(java.lang.String key,
javax.swing.JComponent comp)
Add the component to the dynamic menu Map, under the menuKey key.
|
protected void |
addToDynamicMenus(java.lang.String key,
java.lang.Object comp)
Add a menu component to the dynamic Menu Map.
|
protected void |
addToStaticMenus(java.lang.String key,
javax.swing.JMenu comp)
Add a menu to the static Menu Map.
|
boolean |
bookmarkMenu(java.lang.String bookmark,
javax.swing.JMenu menu)
Bookmark a menu.
|
protected void |
createDefaultClosePopupItems(javax.swing.JPopupMenu menu)
Creaate the default close menu items for the popup menu on a tab.
|
MDIAbout |
createDefaultMDIAbout(boolean modal)
Create thee default About component.
|
MDIAbout |
createDefaultMDIAbout(java.lang.String name,
boolean modal)
Create a default About component.
|
MDISettings |
createDefaultMDISettings(java.lang.String name)
Create a default settings component.
|
protected boolean |
createDynamicMenu(java.lang.String menuKey)
Create the dynamic plugin menu associated with the selected menu Key.
|
void |
createPopupMenu(javax.swing.JPopupMenu menu)
Create the Popup Menu.
|
javax.swing.JMenuItem |
createSettingsMenuItem()
Create a menu item for the settings action.
|
javax.swing.JMenuItem |
createSettingsMenuItem(java.lang.String name)
Create a menu item for the settings action.
|
protected void |
disableStaticMenus()
This method will disable high level menus which are registered in the
staticMenuKeyMap and which are empty. |
GUIApplication |
getApplication()
Return the Application.
|
javax.swing.JMenu |
getBookmarkedMenu(java.lang.String bookmark)
Return a bookmarked menu.
|
java.util.List<javax.swing.JMenuItem> |
getCompatibleMenuItems(MetaData meta,
boolean excludeSelected,
java.awt.event.ActionListener listener)
Return a list of JMenuItems for all the tabs compatible with a specific properties Map.
|
protected javax.swing.JMenuItem |
getDefaultCloseAllItems()
Return a default close all item for the selected application tab.
|
protected javax.swing.JMenuItem |
getDefaultCloseAllItems(java.lang.String name)
Return a default close item for the selected application tab.
|
protected javax.swing.JMenuItem |
getDefaultCloseItem()
Return a default close item for the selected application tab.
|
protected javax.swing.JMenuItem |
getDefaultCloseItem(java.lang.String name)
Return a default close item for the selected application tab.
|
protected javax.swing.JMenuItem |
getDefaultCloseOtherItems()
Return a default close other item for the selected application tab.
|
protected javax.swing.JMenuItem |
getDefaultCloseOtherItems(java.lang.String name)
Return a default close other item for the selected application tab.
|
protected javax.swing.AbstractAction |
getDefaultExitAction()
Return a default exit Action for the application.
|
protected javax.swing.AbstractAction |
getDefaultExitAction(java.lang.String name)
Return a default exit Action for the application.
|
java.lang.Object |
getDynamicMenuComponent(java.lang.String menuKey)
Return the Dynamic Menu Object under the key menu menuKey.
|
protected java.lang.Object |
getDynamicMenuItems(SwingFileProperties prop,
java.lang.String menuKey)
Return the dynamic menu items for the MDIApplication.
|
java.util.Map<java.lang.String,java.lang.Object> |
getDynamicMenuMap()
Return the Dynamic Menu Map.
|
MDIAbout |
getMDIAbout()
Return the About component.
|
MDISettings |
getMDISettings()
Return the MDIApplication settings component.
|
javax.swing.JMenuBar |
getMenuBar()
Return the MenuBar of the MDIApplication.
|
java.util.Set<java.lang.String> |
getMenuBookmarks()
Return the menu bookmarks keyset.
|
PluginsMenuFactory |
getPluginsMenuFactory()
Return the PluginsMenuFactory.
|
ProgressInterface |
getProgressInterface()
Return the progress interface for the menu factory.
|
java.util.Map<java.lang.String,javax.swing.JMenu> |
getStaticMenuMap()
Return the static Menu Map.
|
javax.swing.JPanel |
getToolBarPanel()
Return the ToolBar of the MDIApplication.
|
boolean |
hasMenuBookmark(java.lang.String key)
Return true if there is a menu bookmark of a specified key.
|
void |
init(GUIApplication appli,
boolean hasToolBar)
Initialize the Menu Factory.
|
protected abstract void |
initMenus()
Construct the MDIApplication internal menus.
|
protected void |
initMenusImpl()
The method which is responsible for creating the Menus.
|
void |
registerMenus()
Register the Plugins static menus if there are any Plugin.
|
boolean |
resetDynamicMenus()
Reset the dynamic menus (all dynamic menus that have been registered under menu keys).
|
void |
setLanguage(java.lang.String lang)
Set the menu localization language.
|
void |
setProgressInterface(ProgressInterface progress)
Set the progress interface for the menu factory.
|
void |
updateUI()
Update the UI of the menus.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupdateMenusprotected PluginsMenuFactory fac
protected GUIApplication appli
protected ProgressInterface progress
protected MDISettings settingsAction
protected MDIAbout aboutAction
protected javax.swing.JMenuBar Mbar
protected javax.swing.JPanel tbarPanel
protected javax.swing.JMenuItem closeItem
protected javax.swing.JMenuItem closeAllItem
protected javax.swing.JMenuItem closeOtherItem
protected javax.swing.AbstractAction exitAction
protected java.util.Map<java.lang.String,javax.swing.JMenu> staticMenuKeyMap
Objectss created by the factory.protected java.util.Map<java.lang.String,java.lang.Object> dynamicMenuKeyMap
Objectss created by the factory. These Objects can be of one these types:
AbstractActionJButtonJMenuItemJMenuprotected final java.util.Map<java.lang.String,javax.swing.JMenu> bookmarkedMenus
public void setProgressInterface(ProgressInterface progress)
setProgressInterface in interface MDIMenuFactoryprogress - the progress interfacepublic ProgressInterface getProgressInterface()
getProgressInterface in interface MDIMenuFactorypublic GUIApplication getApplication()
getApplication in interface MDIMenuFactorypublic void init(GUIApplication appli, boolean hasToolBar)
init in interface MDIMenuFactoryappli - the ApplicationhasToolBar - true if the Application must have toolbarsprotected abstract void initMenus()
protected final void initMenusImpl()
public void setLanguage(java.lang.String lang)
MenusLocalization.setLocale(java.lang.String).setLanguage in interface MDIMenuFactorylang - the languageprotected void createDefaultClosePopupItems(javax.swing.JPopupMenu menu)
menu - the menupublic void createPopupMenu(javax.swing.JPopupMenu menu)
createPopupMenu in interface MDIMenuFactorymenu - the Popup Menupublic javax.swing.JMenuItem createSettingsMenuItem()
getMDISettings()public javax.swing.JMenuItem createSettingsMenuItem(java.lang.String name)
name - the settings component namegetMDISettings()public MDISettings createDefaultMDISettings(java.lang.String name)
createDefaultMDISettings in interface MDIMenuFactoryname - the settings component namepublic MDIAbout getMDIAbout()
getMDIAbout in interface MDIMenuFactorypublic MDIAbout createDefaultMDIAbout(boolean modal)
modal - true if the dialog is modalpublic MDIAbout createDefaultMDIAbout(java.lang.String name, boolean modal)
createDefaultMDIAbout in interface MDIMenuFactoryname - the component namemodal - true if the dialog is modalpublic boolean addToDynamicMenuMap(java.lang.String key,
javax.swing.JComponent comp)
addToDynamicMenuMap in interface MDIMenuFactorykey - the menu keycomp - the componentpublic boolean bookmarkMenu(java.lang.String bookmark,
javax.swing.JMenu menu)
bookmarkMenu in interface MDIMenuFactorybookmark - the bookmarkmenu - the menupublic boolean hasMenuBookmark(java.lang.String key)
hasMenuBookmark in interface MDIMenuFactorykey - the bookmark keypublic java.util.Set<java.lang.String> getMenuBookmarks()
getMenuBookmarks in interface MDIMenuFactorypublic javax.swing.JMenu getBookmarkedMenu(java.lang.String bookmark)
getBookmarkedMenu in interface MDIMenuFactorybookmark - the bookmarkpublic boolean addToBookmarkedMenu(java.lang.String bookmark,
javax.swing.AbstractAction action)
addToBookmarkedMenu in interface MDIMenuFactorybookmark - the bookmarkaction - the actionpublic boolean addToBookmarkedMenu(java.lang.String bookmark,
javax.swing.JComponent comp)
JButtonJMenuItemJMenuaddToBookmarkedMenu in interface MDIMenuFactorybookmark - the bookmarkcomp - the componentpublic boolean addToDynamicMenuMap(java.lang.String menuKey,
javax.swing.AbstractAction action)
addToDynamicMenuMap in interface MDIMenuFactorymenuKey - the menu keyaction - the Actionpublic java.lang.Object getDynamicMenuComponent(java.lang.String menuKey)
AbstractActionJButtonJMenuItemJMenugetDynamicMenuComponent in interface MDIMenuFactorymenuKey - the menu keypublic java.util.Map<java.lang.String,java.lang.Object> getDynamicMenuMap()
AbstractActionJButtonJMenuItemJMenugetDynamicMenuMap in interface MDIMenuFactoryprotected void addToDynamicMenus(java.lang.String key,
java.lang.Object comp)
AbstractActionJButtonJMenuItemJMenukey - the menu keycomp - the menu componentpublic java.util.Map<java.lang.String,javax.swing.JMenu> getStaticMenuMap()
disableStaticMenus()).getStaticMenuMap in interface MDIMenuFactoryprotected void addToStaticMenus(java.lang.String key,
javax.swing.JMenu comp)
disableStaticMenus()).key - the menu keycomp - the menu componentpublic void registerMenus()
registerMenus in interface MDIMenuFactoryprotected void disableStaticMenus()
staticMenuKeyMap and which are empty.public boolean resetDynamicMenus()
resetDynamicMenus in interface MDIMenuFactoryprotected java.lang.Object getDynamicMenuItems(SwingFileProperties prop, java.lang.String menuKey)
menuKey - the PluginElementTypes type to retrieveprop - the properties of the panelprotected boolean createDynamicMenu(java.lang.String menuKey)
menuKey - the menu keypublic MDISettings getMDISettings()
getMDISettings in interface MDIMenuFactoryprotected final javax.swing.JMenuItem getDefaultCloseItem()
protected final javax.swing.JMenuItem getDefaultCloseAllItems()
protected final javax.swing.JMenuItem getDefaultCloseOtherItems()
protected final javax.swing.JMenuItem getDefaultCloseOtherItems(java.lang.String name)
name - the tab nameprotected final javax.swing.JMenuItem getDefaultCloseAllItems(java.lang.String name)
name - the tab nameprotected final javax.swing.JMenuItem getDefaultCloseItem(java.lang.String name)
name - the tab nameprotected final javax.swing.AbstractAction getDefaultExitAction()
protected final javax.swing.AbstractAction getDefaultExitAction(java.lang.String name)
name - the action namepublic PluginsMenuFactory getPluginsMenuFactory()
getPluginsMenuFactory in interface MDIMenuFactorypublic javax.swing.JPanel getToolBarPanel()
getToolBarPanel in interface MDIMenuFactorypublic javax.swing.JMenuBar getMenuBar()
getMenuBar in interface MDIMenuFactorypublic void addPluginsToolBar()
public void updateUI()
updateUI in interface MDIMenuFactorypublic java.util.List<javax.swing.JMenuItem> getCompatibleMenuItems(MetaData meta, boolean excludeSelected, java.awt.event.ActionListener listener)
meta - the properties MapexcludeSelected - true if the currently selected tab must be excluded from the listlistener - an ActionListener that listen to JMenuItems selection