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 |
closeItem
The default Close 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.
|
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 |
getDefaultCloseItem(java.lang.String name)
Return a default close item for the selected application tab.
|
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 |
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, wait
updateMenus
protected 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.AbstractAction exitAction
protected java.util.Map<java.lang.String,javax.swing.JMenu> staticMenuKeyMap
Objects
s created by the factory.protected java.util.Map<java.lang.String,java.lang.Object> dynamicMenuKeyMap
Objects
s created by the factory.
These Objects can be of one these types:
AbstractAction
JButton
JMenuItem
JMenu
protected final java.util.Map<java.lang.String,javax.swing.JMenu> bookmarkedMenus
public void setProgressInterface(ProgressInterface progress)
setProgressInterface
in interface MDIMenuFactory
progress
- the progress interfacepublic ProgressInterface getProgressInterface()
getProgressInterface
in interface MDIMenuFactory
public GUIApplication getApplication()
getApplication
in interface MDIMenuFactory
public void init(GUIApplication appli, boolean hasToolBar)
init
in interface MDIMenuFactory
appli
- the ApplicationhasToolBar
- true if the Application must have toolbarsprotected abstract void initMenus()
protected final void initMenusImpl()
public void createPopupMenu(javax.swing.JPopupMenu menu)
createPopupMenu
in interface MDIMenuFactory
menu
- 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 MDIMenuFactory
name
- the settings component namepublic MDIAbout getMDIAbout()
getMDIAbout
in interface MDIMenuFactory
public MDIAbout createDefaultMDIAbout(java.lang.String name, boolean modal)
createDefaultMDIAbout
in interface MDIMenuFactory
name
- the component namemodal
- true if the dialog is modalpublic boolean addToDynamicMenuMap(java.lang.String key, javax.swing.JComponent comp)
addToDynamicMenuMap
in interface MDIMenuFactory
key
- the menu keycomp
- the componentpublic boolean bookmarkMenu(java.lang.String bookmark, javax.swing.JMenu menu)
bookmarkMenu
in interface MDIMenuFactory
bookmark
- the bookmarkmenu
- the menupublic boolean hasMenuBookmark(java.lang.String key)
hasMenuBookmark
in interface MDIMenuFactory
key
- the bookmark keypublic java.util.Set<java.lang.String> getMenuBookmarks()
getMenuBookmarks
in interface MDIMenuFactory
public javax.swing.JMenu getBookmarkedMenu(java.lang.String bookmark)
getBookmarkedMenu
in interface MDIMenuFactory
bookmark
- the bookmarkpublic boolean addToBookmarkedMenu(java.lang.String bookmark, javax.swing.AbstractAction action)
addToBookmarkedMenu
in interface MDIMenuFactory
bookmark
- the bookmarkaction
- the actionpublic boolean addToBookmarkedMenu(java.lang.String bookmark, javax.swing.JComponent comp)
JButton
JMenuItem
JMenu
addToBookmarkedMenu
in interface MDIMenuFactory
bookmark
- the bookmarkcomp
- the componentpublic boolean addToDynamicMenuMap(java.lang.String menuKey, javax.swing.AbstractAction action)
addToDynamicMenuMap
in interface MDIMenuFactory
menuKey
- the menu keyaction
- the Actionpublic java.lang.Object getDynamicMenuComponent(java.lang.String menuKey)
AbstractAction
JButton
JMenuItem
JMenu
getDynamicMenuComponent
in interface MDIMenuFactory
menuKey
- the menu keypublic java.util.Map<java.lang.String,java.lang.Object> getDynamicMenuMap()
AbstractAction
JButton
JMenuItem
JMenu
getDynamicMenuMap
in interface MDIMenuFactory
protected void addToDynamicMenus(java.lang.String key, java.lang.Object comp)
AbstractAction
JButton
JMenuItem
JMenu
key
- the menu keycomp
- the menu componentpublic java.util.Map<java.lang.String,javax.swing.JMenu> getStaticMenuMap()
disableStaticMenus()
).getStaticMenuMap
in interface MDIMenuFactory
protected void addToStaticMenus(java.lang.String key, javax.swing.JMenu comp)
disableStaticMenus()
).key
- the menu keycomp
- the menu componentpublic void registerMenus()
registerMenus
in interface MDIMenuFactory
protected void disableStaticMenus()
staticMenuKeyMap
and which are
empty.public boolean resetDynamicMenus()
resetDynamicMenus
in interface MDIMenuFactory
protected 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 MDIMenuFactory
protected final javax.swing.JMenuItem getDefaultCloseItem(java.lang.String name)
name
- the tab nameprotected final javax.swing.AbstractAction getDefaultExitAction(java.lang.String name)
name
- the action namepublic PluginsMenuFactory getPluginsMenuFactory()
getPluginsMenuFactory
in interface MDIMenuFactory
public javax.swing.JPanel getToolBarPanel()
getToolBarPanel
in interface MDIMenuFactory
public javax.swing.JMenuBar getMenuBar()
getMenuBar
in interface MDIMenuFactory
public void addPluginsToolBar()
public void updateUI()
updateUI
in interface MDIMenuFactory
public 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