Package be.gaudry.swing.action
Class ShowPanelController
java.lang.Object
be.gaudry.swing.action.ShowPanelController
The ShowPanelController allows to manage screens navigation into
the application. This is also a facade to get the top level component.
Provided by the broldev.core.swing project.
- Since:
- 1.0 (Mar 23, 2009), broldev.core.swing 0.0.1-SNAPSHOT dependency
- Version:
- 1.0 (Mar 23, 2009)
- Author:
- Steph GAUDRY
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<JPanel,AbstractShowPanelAction<? extends JPanel>>
protected IMainFrame
protected static ShowPanelController
-
Method Summary
Modifier and TypeMethodDescription(package private) static void
addAction(AbstractShowPanelAction<? extends JPanel> showPanelAction)
Adds a showPanelAction to the existing actions.static Map<JPanel,AbstractShowPanelAction<? extends JPanel>>
The actions to show the panels are available thru an unmodifiable map, keyed by the panels.static AbstractAction
Returns the action to close the current panel.(package private) static javax.help.HelpBroker
This package method allows to initialize the broker's target from theAbstractShowPanelAction
to allow showing the help associated to the current panel intoshowHelp()
static IMainFrame
The main frame is the GUI component where the panels are shown.static AbstractAction
Returns the action to display the next panel.static AbstractAction
Returns the action to display the previous panel.(package private) static void
removeAction(AbstractShowPanelAction<? extends JPanel> showPanelAction)
Removes a showPanelAction from the available actions.(package private) static void
setCurrentAction(AbstractShowPanelAction<? extends JPanel> action)
Sets the action associated to the current panel as current action.static void
setFrame(IMainFrame frame)
Sets thegetIMainFrame()
only if not previously defined.static void
setFrame(IMainFrame frame, boolean replaceIfExists)
Sets the main frame of the application, to use into this controller.static void
showHelp()
Shows the help associated to the current panel
-
Field Details
-
frame
-
actions
-
instance
-
-
Method Details
-
setFrame
Sets the main frame of the application, to use into this controller.- Parameters:
frame
- application main screenreplaceIfExists
-true
to replace existing frame,false
to set the frame only if not exists.
-
setFrame
Sets thegetIMainFrame()
only if not previously defined. \nTo set a new IMainFrame, use thesetFrame(IMainFrame, boolean)
method.- Parameters:
frame
- application main screen
-
getIMainFrame
The main frame is the GUI component where the panels are shown.- Returns:
- the main screen of the application
-
showHelp
public static void showHelp()Shows the help associated to the current panel -
getHelpBroker
static javax.help.HelpBroker getHelpBroker()This package method allows to initialize the broker's target from theAbstractShowPanelAction
to allow showing the help associated to the current panel intoshowHelp()
- Returns:
- the helpBroker
-
getActions
The actions to show the panels are available thru an unmodifiable map, keyed by the panels. Only the currently existing panels(visible or hidden by the current panel) are into this collection; if a panel has not yet been shown, or if a panel has been closed, it will not be into the collection.- Returns:
- the actions
-
addAction
Adds a showPanelAction to the existing actions. This package method is only called by theAbstractShowPanelAction.showPanel()
when a panel is shown the first time.- Parameters:
showPanelAction
- action to add
-
removeAction
Removes a showPanelAction from the available actions. This package method is only called by theAbstractShowPanelAction.close()
when the panel is closed.- Parameters:
showPanelAction
- action to remove
-
getCloseAction
Returns the action to close the current panel.- Returns:
- the close action
-
getShowPreviousPanelAction
Returns the action to display the previous panel.- Returns:
- the action
-
getShowNextPanelAction
Returns the action to display the next panel.- Returns:
- the action
-
setCurrentAction
Sets the action associated to the current panel as current action. This package method is only called by theAbstractShowPanelAction.showPanel()
when a panel is shown.- Parameters:
action
-
-