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
FieldsModifier and TypeFieldDescriptionprotected Map<JPanel,AbstractShowPanelAction<? extends JPanel>>protected IMainFrameprotected static ShowPanelController -
Method Summary
Modifier and TypeMethodDescription(package private) static voidaddAction(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 AbstractActionReturns the action to close the current panel.(package private) static javax.help.HelpBrokerThis package method allows to initialize the broker's target from theAbstractShowPanelActionto allow showing the help associated to the current panel intoshowHelp()static IMainFrameThe main frame is the GUI component where the panels are shown.static AbstractActionReturns the action to display the next panel.static AbstractActionReturns the action to display the previous panel.(package private) static voidremoveAction(AbstractShowPanelAction<? extends JPanel> showPanelAction)Removes a showPanelAction from the available actions.(package private) static voidsetCurrentAction(AbstractShowPanelAction<? extends JPanel> action)Sets the action associated to the current panel as current action.static voidsetFrame(IMainFrame frame)Sets thegetIMainFrame()only if not previously defined.static voidsetFrame(IMainFrame frame, boolean replaceIfExists)Sets the main frame of the application, to use into this controller.static voidshowHelp()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-trueto replace existing frame,falseto 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 theAbstractShowPanelActionto 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-
-