|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.editor.policy.view.WizardDialog
public abstract class WizardDialog
Base class for wizard dialogs.
Nested Class Summary | |
---|---|
protected static class |
WizardDialog.ContentStyle
Determines how the content is presented. |
Field Summary | |
---|---|
protected static String |
CHOOSER_TEXT
The text on the directory chooser buttons. |
protected static String |
NEXT_FOCUS
Client property for chooser buttons that contains the next focus field. |
protected static int |
TEXT_AREA_ROWS
The number of default rows in a text area. |
protected static int |
TEXT_FIELD_COLUMNS
The number of columns in a text field. |
Constructor Summary | |
---|---|
WizardDialog(ApplicationContext context)
Creates a wizard dialog with the specified settings. |
Method Summary | ||
---|---|---|
protected File |
chooseFile(ApplicationContext.FileChooserType chooserType,
FileType fileType,
JTextField target)
Opens a file chooser of the specified type and file type for the target text field. |
|
void |
close(boolean resultCode)
Closes this dialog if it is currently showing. |
|
protected
|
configure(T component)
Configures the specified text component. |
|
protected void |
configureButton(JButton button,
Action action)
Configures a button that has the specified action. |
|
protected JComponent |
createButtonPane(ControlFactory controlFactory)
Creates the button pane of this dialog. |
|
protected JButton |
createChooser(ApplicationContext.FileChooserType chooserType,
FileType fileType,
JTextField target)
Creates a file chooser button for the specified target field. |
|
protected JComponent |
createContentPane(ControlFactory controlFactory)
Creates the content pane of this dialog. |
|
protected JComponent |
createDialogContent(ControlFactory controlFactory)
Creates the complete content pane of the dialog. |
|
protected JTextField |
createDisplayTextField(Action action)
Creates and configures a disabled text field. |
|
protected FormBuilder |
createFormBuilder()
Creates a form builder that is configured for use with this wizard. |
|
protected JComponent |
createHeaderPane(ControlFactory controlFactory)
Creates the header pane of this dialog. |
|
protected JLabel |
createLabel(String name)
Creates a named label for automated translation. |
|
protected JPasswordField |
createPasswordField()
Creates and configures a password field. |
|
protected void |
focusNextComponent(JComponent target)
Programmatically moves the focus to the next focus component for the specified target. |
|
protected Action |
getAction(String name)
Returns the action from the action map with the specified name. |
|
protected ActionMap |
getActionMap()
|
|
protected ApplicationContext |
getApplicationContext()
Returns the context of the application that owns this view. |
|
protected List<Action> |
getButtonActions()
Returns a list of actions to use for buttons at the bottom of the dialog. |
|
protected Action |
getCancelAction()
Returns the default action to trigger if the cancel key is pressed. |
|
protected WizardDialog.ContentStyle |
getContentStyle()
Returns the content pane wrapping style. |
|
protected JButton |
getDefaultButton()
|
|
protected JDialog |
getDialog()
|
|
protected String |
getDialogTitle()
Returns the title used by the wizard dialog. |
|
protected Action |
getExecuteAction()
Returns the default action to trigger if the enter key is pressed. |
|
protected org.jdesktop.application.ResourceMap |
getResourceMap()
|
|
protected String |
getTitleDescriptionKey()
Returns the key of the title description to display. |
|
protected String |
getTitleIconKey()
Returns the key of the icon to display. |
|
protected String |
getTitleTextKey()
Returns the key of the title text to display. |
|
protected abstract boolean |
initialize(Component parent)
Initialize some wizard specific fields. |
|
protected boolean |
sameAction(Action a1,
Action a2)
Compares the names of two actions and returns true if they are equivalent. |
|
protected void |
setNextFocusComponent(JComponent target,
JComponent nextFocus)
Sets the next focus for a target component. |
|
boolean |
show(Component parent)
Starts the wizard. |
|
protected void |
showErrorDialog(Component parent,
String key,
Object... args)
Shows an error dialog with the specified title, message and paramters. |
|
protected void |
showErrorDialog(String key,
Object... args)
Shows an error dialog with the specified title, message and paramters. |
|
protected abstract void |
updateActions()
Updates the actions according to the values in the wizard fields. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int TEXT_FIELD_COLUMNS
20
protected static final int TEXT_AREA_ROWS
5
protected static final String CHOOSER_TEXT
"..."
protected static final String NEXT_FOCUS
"chooserNextFocus"
Constructor Detail |
---|
public WizardDialog(ApplicationContext context)
context
- the application context used to lookup the action and resource map.Method Detail |
---|
protected String getTitleIconKey()
Lookup of the actual icon is performed using the getResourceMap()
.
The default value returned is View.icon.
protected String getTitleTextKey()
Lookup of the actual text is performed using the getResourceMap()
.
The default value returned is View.title.
protected String getTitleDescriptionKey()
Lookup of the actual text is performed using the getResourceMap()
.
The default value returned is View.description.
protected List<Action> getButtonActions()
The default value returned is a list containing the name of the
getCancelAction()
and getExecuteAction()
.
protected Action getExecuteAction()
Returns the action with the name execute by default.
null
to disable key binding.protected Action getCancelAction()
Returns the action with the name cancel by default.
null
to disable key binding.protected JComponent createDialogContent(ControlFactory controlFactory)
controlFactory
- the control factory to use for creating controls.
protected JComponent createHeaderPane(ControlFactory controlFactory)
The default implementation creates a HeaderPane
with the dialog
icon
, title
and
description
.
controlFactory
- the control factory to use for creating controls.
protected String getDialogTitle()
protected WizardDialog.ContentStyle getContentStyle()
protected JComponent createContentPane(ControlFactory controlFactory)
controlFactory
- the control factory to use for creating controls.
protected boolean sameAction(Action a1, Action a2)
true
if they are equivalent.
a1
- the first action.a2
- the second action.
true
if both actions have the same name, false
otherwise.protected void configureButton(JButton button, Action action)
button
- the button to configure.action
- the action of the button.protected JComponent createButtonPane(ControlFactory controlFactory)
The default implementation creates a panel with buttons for all the
getButtonActions()
.
Sets the default button according to the default action.
controlFactory
- the control factory to use for creating controls.
protected abstract void updateActions()
protected abstract boolean initialize(Component parent)
parent
- the parent component of the dialog.
protected final ApplicationContext getApplicationContext()
protected final ActionMap getActionMap()
protected final Action getAction(String name)
name
- the name of the action to return.
null
if the action is not defined.getActionMap()
protected final org.jdesktop.application.ResourceMap getResourceMap()
protected final JDialog getDialog()
protected final JButton getDefaultButton()
public boolean show(Component parent)
parent
- the parent component of the dialog.
public void close(boolean resultCode)
resultCode
- the return value for show(Component)
.protected FormBuilder createFormBuilder()
protected final <T extends JTextComponent> T configure(T component)
Changes to the document of the text component will cause the actions of the wizard
to be updated (see updateActions()
.
T
- the type of text component to configure.component
- the text component to configure.
protected final JLabel createLabel(String name)
name
- the name of the label.
protected final JTextField createDisplayTextField(Action action)
Display text fields are usually paired with a chooser button.
action
- optional that is responsible for filling the text field, if non-null
the action is used as single-click target on the text field.
protected final JPasswordField createPasswordField()
protected final void setNextFocusComponent(JComponent target, JComponent nextFocus)
target
- the target for which to set the next focus.nextFocus
- the next focus component.focusNextComponent(JComponent)
protected final void focusNextComponent(JComponent target)
target
- the target for which to move the focus.setNextFocusComponent(JComponent, JComponent)
protected final File chooseFile(ApplicationContext.FileChooserType chooserType, FileType fileType, JTextField target)
The choice is stored in the target text field.
chooserType
- the type of chooser to open.fileType
- the file type to filter choices on.target
- the text field target to receive the selected file name.
null
if the user aborted.protected final JButton createChooser(ApplicationContext.FileChooserType chooserType, FileType fileType, JTextField target)
chooserType
- the file chooser type, either JFileChooser.OPEN_DIALOG or
FileChooser.SAVE_DIALOG .fileType
- the file filter to use.target
- the field to store the chosen file to.
protected void showErrorDialog(String key, Object... args)
key
- translation key for the title.args
- optional parameters for the title and message.protected void showErrorDialog(Component parent, String key, Object... args)
parent
- the parent component to show the error dialog for.key
- translation key for the title.args
- optional parameters for the title and message.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG