org.jfree.ui.tabbedui

Class AbstractTabbedUI

public abstract class AbstractTabbedUI extends JComponent

A tabbed GUI. All views on the data are contained in tabs.

Author: Thomas Morgner

Nested Class Summary
protected classAbstractTabbedUI.ExitAction
An exit action.
Field Summary
static StringGLOBAL_MENU_PROPERTY
The global menu property.
static StringJMENUBAR_PROPERTY
The menu bar property key.
Constructor Summary
AbstractTabbedUI()
Default constructor.
Method Summary
voidaddRootEditor(RootEditor rootPanel)
Adds a root editor.
protected abstract voidattempExit()
Attempts to exit.
protected ActioncreateCloseAction()
Creates a close action.
ActiongetCloseAction()
Returns the close action.
JMenuBargetJMenuBar()
Returns the menu bar.
protected abstract JMenu[]getPostfixMenus()
The postfix menus.
protected abstract JMenu[]getPrefixMenus()
Returns the prefix menus.
RootEditorgetRootEditor(int pos)
Returns the specified editor.
intgetRootEditorCount()
Returns the number of root editors.
intgetSelectedEditor()
Returns the selected editor.
protected JTabbedPanegetTabbedPane()
Returns the tabbed pane.
booleanisGlobalMenu()
Defines whether to use a global unified menu bar, which contains all menus from all tab-panes or whether to use local menubars.
voidsetGlobalMenu(boolean globalMenu)
Sets the global menu flag.
protected voidsetJMenuBar(JMenuBar menuBar)
Sets the menu bar.
voidsetSelectedEditor(int selectedEditor)
Sets the selected editor.
protected voidupdateRootEditorEnabled(RootEditor editor)
Update handler for the enable state of the root editor.

Field Detail

GLOBAL_MENU_PROPERTY

public static final String GLOBAL_MENU_PROPERTY
The global menu property.

JMENUBAR_PROPERTY

public static final String JMENUBAR_PROPERTY
The menu bar property key.

Constructor Detail

AbstractTabbedUI

public AbstractTabbedUI()
Default constructor.

Method Detail

addRootEditor

public void addRootEditor(RootEditor rootPanel)
Adds a root editor.

Parameters: rootPanel the root panel.

attempExit

protected abstract void attempExit()
Attempts to exit.

createCloseAction

protected Action createCloseAction()
Creates a close action.

Returns: A close action.

getCloseAction

public Action getCloseAction()
Returns the close action.

Returns: The close action.

getJMenuBar

public JMenuBar getJMenuBar()
Returns the menu bar.

Returns: The menu bar.

getPostfixMenus

protected abstract JMenu[] getPostfixMenus()
The postfix menus.

Returns: The postfix menus.

getPrefixMenus

protected abstract JMenu[] getPrefixMenus()
Returns the prefix menus.

Returns: The prefix menus.

getRootEditor

public RootEditor getRootEditor(int pos)
Returns the specified editor.

Parameters: pos the position index.

Returns: The editor at the given position.

getRootEditorCount

public int getRootEditorCount()
Returns the number of root editors.

Returns: The count.

getSelectedEditor

public int getSelectedEditor()
Returns the selected editor.

Returns: The selected editor.

getTabbedPane

protected JTabbedPane getTabbedPane()
Returns the tabbed pane.

Returns: The tabbed pane.

isGlobalMenu

public boolean isGlobalMenu()
Defines whether to use a global unified menu bar, which contains all menus from all tab-panes or whether to use local menubars.

From an usability point of view, global menubars should be preferred, as this way users always see which menus are possibly available and do not wonder where the menus are disappearing.

Returns: true, if global menus should be used, false otherwise.

setGlobalMenu

public void setGlobalMenu(boolean globalMenu)
Sets the global menu flag.

Parameters: globalMenu the flag.

setJMenuBar

protected void setJMenuBar(JMenuBar menuBar)
Sets the menu bar.

Parameters: menuBar the menu bar.

setSelectedEditor

public void setSelectedEditor(int selectedEditor)
Sets the selected editor.

Parameters: selectedEditor the selected editor.

updateRootEditorEnabled

protected void updateRootEditorEnabled(RootEditor editor)
Update handler for the enable state of the root editor.

Parameters: editor the editor.