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 class
AbstractTabbedUI.ExitAction
An exit action.

Field Summary

static String
GLOBAL_MENU_PROPERTY
The global menu property.
static String
JMENUBAR_PROPERTY
The menu bar property key.

Constructor Summary

AbstractTabbedUI()
Default constructor.

Method Summary

void
addRootEditor(RootEditor rootPanel)
Adds a root editor.
protected abstract void
attempExit()
Attempts to exit.
protected Action
createCloseAction()
Creates a close action.
Action
getCloseAction()
Returns the close action.
JMenuBar
getJMenuBar()
Returns the menu bar.
protected abstract JMenu[]
getPostfixMenus()
The postfix menus.
protected abstract JMenu[]
getPrefixMenus()
Returns the prefix menus.
RootEditor
getRootEditor(int pos)
Returns the specified editor.
int
getRootEditorCount()
Returns the number of root editors.
int
getSelectedEditor()
Returns the selected editor.
protected JTabbedPane
getTabbedPane()
Returns the tabbed pane.
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.
void
setGlobalMenu(boolean globalMenu)
Sets the global menu flag.
protected void
setJMenuBar(JMenuBar menuBar)
Sets the menu bar.
void
setSelectedEditor(int selectedEditor)
Sets the selected editor.
protected void
updateRootEditorEnabled(RootEditor editor)
Update handler for the enable state of the root editor.

Field Details

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 Details

AbstractTabbedUI

public AbstractTabbedUI()
Default constructor.

Method Details

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.