Class FWTabView
java.lang.Object
net.simplace.ui.tabview.FWTabView
- All Implemented Interfaces:
ActionListener, EventListener, ChangeListener, HyperlinkListener
Toolkit for arranging multiple extern panels in one target panel.
Just add the 'target'-panel to the desired viewcontainer.
Now u can create panels and use them as usuall (etc. adding some widgets,
setting viewport...). The manager will provide one tab/view if there
are * views. It also provides a popup with the default actions
- close all views.
- close this view.
- Author:
- Andreas Enders
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant-ID for the desktop.protected final FWTabViewPaneTabbedpane for displaying multiple views.protected final LinkedHashMap<Object, JPanel> Map containing the views(value) and their ids (key). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFWTabView(boolean aShowDesktopTab) Constructor for subclasses. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent aActionEvent) voidaddViewManagerListener(FWTabViewListener aListener) voidcloseSelectedView(boolean aSuppressApproving) Closes the selected view.booleancreateView(Object aID, String aCaption, JPanel aView, String aSystemID) Adds a view as new tab and selects it.booleancreateView(Object aID, JPanel aView, String aSystemID) Adds a view with the localised default caption, seecreateView(Object, String, JPanel, String).voidRemoves all views except the desktop, each with confirmation.voiddisposeAll(boolean aLeaveCurrent, boolean aForceDispose) Removes all views except the desktop.voiddisposeView(Object aID, boolean aShouldBeApproved) Removes the view.voidfireActionEvent(ActionListener aActionListener, String aCommand) Sends an action event with this tab view as source to the listener.getIDOfComponent(JPanel aComponent) Returns the id of a view.static FWTabViewReturns the only instance of this class.intReturns the view for the given oid.booleanindicates if a given view is already opened (author: jschoder)voidhyperlinkUpdate(HyperlinkEvent aHyperlinkEvent) This method is called when a click action is performed on a Link.booleanisViewVisible(String aViewID) Returns whether or not there is an existing view with the given id.voidremoveViewManagerListener(FWTabViewListener aListener) voidselectView(Object aID) voidsetDefaultCursor(String aSystemID) voidsetEmptyPanel(JPanel aNewEmptyPanel) Replaces the emptyPanel.voidsetTabPlacement(int aOrientation) Sets a new orientation to the tabpane.voidsetWaitCursor(String aSystemID) voidstateChanged(ChangeEvent aChangeEvent) Informs the listeners when a view is selected.
-
Field Details
-
DESKTOP_ID
-
iViewMap
Map containing the views(value) and their ids (key). -
iTabbedPane
Tabbedpane for displaying multiple views.
-
-
Constructor Details
-
FWTabView
protected FWTabView(boolean aShowDesktopTab) Constructor for subclasses. Initiates the basic elements.- Parameters:
aShowDesktopTab- whether the desktop tab is added
-
-
Method Details
-
getInstance
Returns the only instance of this class.- Returns:
- the singleton instance
-
createView
Adds a view as new tab and selects it. If a view of the system is already open, it is replaced; if a view with the id is already open, it is only selected.- Parameters:
aID- id of the viewaCaption- tab caption, ornullto use the localised<prefix>.tabview.<id>aView- the view panelaSystemID- system id; if not empty it is used as view key and for the icontool.<id>- Returns:
- true, if the view was created successfully, otherwise returns false
-
createView
Adds a view with the localised default caption, seecreateView(Object, String, JPanel, String).- Parameters:
aID- id of the viewaView- the view panelaSystemID- system id, ornull- Returns:
- true, if the view was created successfully, otherwise returns false
-
disposeView
Removes the view.- Parameters:
aID- id of the viewaShouldBeApproved- iftruethe user has to confirm closing (not in development mode and only for views of a functionality)
-
disposeAll
public void disposeAll()Removes all views except the desktop, each with confirmation. -
disposeAll
public void disposeAll(boolean aLeaveCurrent, boolean aForceDispose) Removes all views except the desktop.- Parameters:
aLeaveCurrent- whether the selected view is keptaForceDispose- iftruethe views are closed without confirmation
-
selectView
- Parameters:
aID- id of the view to select
-
getSelectedView
- Returns:
- Component at selected index
-
getView
-
getSelectedViewID
- Returns:
- selected view ID
-
closeSelectedView
public void closeSelectedView(boolean aSuppressApproving) Closes the selected view.- Parameters:
aSuppressApproving- iftruethe view is closed without confirmation
-
isViewVisible
Returns whether or not there is an existing view with the given id.- Parameters:
aViewID- id of the view- Returns:
trueif the view exists
-
getTabCount
public int getTabCount()- Returns:
- number of tabs without the desktop tab
-
getTargetPanel
- Returns:
- target Panel
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
fireActionEvent
Sends an action event with this tab view as source to the listener.- Parameters:
aActionListener- the listeneraCommand- the action command
-
stateChanged
Informs the listeners when a view is selected.- Specified by:
stateChangedin interfaceChangeListener
-
addViewManagerListener
- Parameters:
aListener- listener to add
-
removeViewManagerListener
- Parameters:
aListener- listener to remove
-
hyperlinkUpdate
This method is called when a click action is performed on a Link. Currently does nothing.- Specified by:
hyperlinkUpdatein interfaceHyperlinkListener
-
setTabPlacement
public void setTabPlacement(int aOrientation) Sets a new orientation to the tabpane.- Parameters:
aOrientation- tab placement (JTabbedPane.TOP,BOTTOM,LEFT,RIGHT)
-
setEmptyPanel
Replaces the emptyPanel.- Parameters:
aNewEmptyPanel- panel shown when no view is open
-
getIDOfComponent
-
hasView
indicates if a given view is already opened (author: jschoder)- Parameters:
aID- id of the view- Returns:
- true, if a given view is already opened, otherwise returns false
-
setWaitCursor
- Parameters:
aSystemID- id of the view showing the wait cursor
-
setDefaultCursor
- Parameters:
aSystemID- id of the view showing the default cursor
-