|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
info.aduna.swing.config.ConfigPanel
public class ConfigPanel
ConfigPanel is a generic user preferences component that shows a collection of ConfigSheets, selectable through a tree. ConfigPanel has been inspired by/modeled after Netscape/Mozilla's Preferences window and KDE's Control Center.
The ConfigSheets can be added one-by-one by using the two add methods. However, the ConfigSheets are not visible until the finishAdditions methods has been invoked. After that it is no longer possible to add ConfigSheets to the ConfigPanel.
ConfigPanel contains three buttons for its main operation. The apply and default buttons are for setting or resetting the settings of the current ConfigSheet. The apply button is initially disabled but is enabled automatically as soon as something changes in the current ConfigSheet (detected through the ConfigSheetListener interface). Finally, the close button sends a closeRequested event to the ConfigPanelListeners, which should then take an appropriate action.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ConfigPanel()
Create a new ConfigPanel showing an empty sheet selection browser and sheet display. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Dispatches the pressing of the Apply, Default or Close button to either the apply, default or the close method respectively. |
void |
add(ConfigSheet sheet)
Adds a ConfigSheet as a leaf node without a parent in the sheet browser. |
void |
add(ConfigSheet sheet,
ConfigSheet parent)
Adds a ConfigSheet beneath the specified parent ConfigSheet in the sheet browser. |
void |
addConfigPanelListener(ConfigPanelListener l)
|
void |
contentsChanged(ConfigSheet sheet)
If this event originates from the current ConfigSheet, the apply button will be enabled. |
void |
finishAdditions()
Indicates that the last ConfigSheet has been added and that the sheet browser can now be populated. |
JButton |
getApplyButton()
|
JButton |
getCloseButton()
|
ConfigSheet |
getCurrentSheet()
Returns the ConfigSheet that is currently visible in the ConfigPanel. |
JButton |
getDefaultButton()
|
void |
removeConfigPanelListener(ConfigPanelListener l)
|
void |
setTitleText(String text)
Sets the text of the title label in the upper part of the ConfigPanel. |
void |
valueChanged(TreeSelectionEvent e)
Switches to another ConfigSheet, based on the new selection in the sheet browser, and sends a corresponding event to all ConfigPanelListeners. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConfigPanel()
| Method Detail |
|---|
public JButton getApplyButton()
public JButton getDefaultButton()
public JButton getCloseButton()
public ConfigSheet getCurrentSheet()
public void setTitleText(String text)
public void add(ConfigSheet sheet)
throws IllegalArgumentException
IllegalArgumentException - when there is already a ConfigSheet added with the specified
name.
public void add(ConfigSheet sheet,
ConfigSheet parent)
throws IllegalArgumentException
IllegalArgumentException - when there is already a ConfigSheet added with the name of the
specified sheet or parent.public void finishAdditions()
public void contentsChanged(ConfigSheet sheet)
contentsChanged in interface ConfigSheetListenerpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic void valueChanged(TreeSelectionEvent e)
valueChanged in interface TreeSelectionListenerpublic void addConfigPanelListener(ConfigPanelListener l)
public void removeConfigPanelListener(ConfigPanelListener l)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||