|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.editor.policy.gui.AbstractComponentFactory
org.openpermis.editor.policy.gui.ControlFactory
public class ControlFactory
Factory for controls used by the client.
Use this factory to create controls in views and dialog boxes whenever possible to guarantee a consistent look and feel.
The factory delivers controls that can be configured by means of resource maps (property files) and action maps (action annotations) where appropriate.
Even though tool bars and menu bars have their own factories, the control factory offers access to those factories by redirecting calls to create those controls.
Nested Class Summary | |
---|---|
static interface |
ControlFactory.Resolver
Combines the various resolver interfaces to a single resolver interface. |
Constructor Summary | |
---|---|
ControlFactory(ActionMap actionMap,
org.jdesktop.application.ResourceMap resourceMap)
Creates a control factory that operates on the specified action and resource map. |
Method Summary | |
---|---|
JButton |
createButton(Action action)
Creates a button for the specified action. |
JButton |
createButton(String key)
Creates a button for the specified action and resource key. |
JButton |
createButton(String key,
Object target,
String method)
Creates a button for the specified resource key, target and method. |
JButton |
createChooserButton(Action action)
Creates a chooser button for the specified action. |
JButton |
createChooserButton(String key)
Creates a chooser style button for the specified action and resource key. |
JButton |
createChooserButton(String key,
Object target,
String method)
Creates a chooser style button for the specified resource key, target and method. |
JLabel |
createLabel(String key)
Creates a label with properties defined in the resource map. |
JLabel |
createLabel(String key,
Component component)
Creates a label with properties defined in the resource map. |
JMenuBar |
createMenuBar(String key)
Creates a menubar with the specified resource key name. |
JMenuBar |
createMenuBar(String key,
MenuBarFactory.Resolver resolver)
Creates a menubar with the specified resource key name. |
JPasswordField |
createPasswordField(String key)
Creates a password field that features an action listener which triggers the action with the specified key. |
JPasswordField |
createPasswordField(String key,
int columns)
Creates a password field that features an action listener which triggers the action with the specified key. |
JComponent |
createSeparator(String key)
Creates a named horizontal separator. |
JTextField |
createTextField(Object target,
String method)
Creates a text field that features an action listener which triggers the method on the specified target. |
JTextField |
createTextField(Object target,
String method,
int columns)
Creates a text field that features an action listener which triggers the method on the specified target. |
JTextField |
createTextField(String key)
Creates a text field that features an action listener which triggers the action with the specified key. |
JTextField |
createTextField(String key,
int columns)
Creates a text field that features an action listener which triggers the action with the specified key. |
JToolBar |
createToolBar(String key)
Creates a tool bar from the specfied resource key. |
JToolBar |
createToolBar(String key,
ToolBarFactory.Resolver resolver)
Creates a tool bar from the specfied resource key. |
Methods inherited from class org.openpermis.editor.policy.gui.AbstractComponentFactory |
---|
getAction, getAction, getActionMap, getEntries, getResourceMap, isComposite, isGlue, isPlaceholder, isSeparator, unmaskComposite |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ControlFactory(ActionMap actionMap, org.jdesktop.application.ResourceMap resourceMap)
actionMap
- the action map this factory operates on.resourceMap
- the resource map this factory operates on.Method Detail |
---|
public JMenuBar createMenuBar(String key)
key
- the name of the menu bar configuration in the resource map.
MenuBarFactory.createMenuBar(String)
public JMenuBar createMenuBar(String key, MenuBarFactory.Resolver resolver)
key
- the name of the menu bar configuration in the resource map.resolver
- the resolver to use for placeholders.
MenuBarFactory.createMenuBar(String)
public JToolBar createToolBar(String key)
key
- the resource key from which to create tool bar.
ToolBarFactory.createToolBar(String)
public JToolBar createToolBar(String key, ToolBarFactory.Resolver resolver)
key
- the resource key from which to create tool bar.resolver
- the resolver to use for placeholders.
ToolBarFactory.createToolBar(String, ToolBarFactory.Resolver)
public JButton createButton(Action action)
Uses the action name to set the name of the button.
action
- the action to use for creating the button.
public JButton createButton(String key)
key
- the action and resource key used to create the button.
public JButton createButton(String key, Object target, String method)
key
- the resource key used to translate the button.target
- the target on which to trigger the method.method
- the method to trigger if the button is pressed.
public JButton createChooserButton(Action action)
Uses the action name to set the name of the button.
action
- the action to use for creating the button.
public JButton createChooserButton(String key)
key
- the action and resource key used to create the button.
public JButton createChooserButton(String key, Object target, String method)
key
- the resource key used to translate the button.target
- the target on which to trigger the method.method
- the method to trigger if the button is pressed.
public JLabel createLabel(String key)
key
- the resource key of the label as it appears in the resource map.
public JLabel createLabel(String key, Component component)
key
- the resource key of the label as it appears in the resource map.component
- the component this label is for, or null
if the label is not the
label for a component.
public JTextField createTextField(String key)
key
- the action key to trigger if enter or return is pressed on the text field.
public JTextField createTextField(String key, int columns)
key
- the action key to trigger if enter or return is pressed on the text field.columns
- the number of columns to use to calculate the preferred width; if columns is
set to zero, the preferred width will be whatever naturally results from the component
implementation, see JTextField.JTextField(int)
.
public JTextField createTextField(Object target, String method)
target
- the target on which to trigger the method.method
- the method to trigger if enter or return is pressed on the text field.
public JTextField createTextField(Object target, String method, int columns)
target
- the target on which to trigger the method.method
- the method to trigger if enter or return is pressed on the text field.columns
- the number of columns to use to calculate the preferred width; if columns is
set to zero, the preferred width will be whatever naturally results from the component
implementation, see JTextField.JTextField(int)
.
public JPasswordField createPasswordField(String key)
key
- the action key to trigger if enter or return is pressed on the password field.
public JPasswordField createPasswordField(String key, int columns)
key
- the action key to trigger if enter or return is pressed on the password field.columns
- the number of columns to use to calculate the preferred width; if columns is
set to zero, the preferred width will be whatever naturally results from the component
implementation, see JPasswordField.JPasswordField(int)
.
public JComponent createSeparator(String key)
key
- the resource key for the name of the separator.
|
![]() |
||||||||
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