|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.factory.DefaultComponentFactory
public class DefaultComponentFactory
Default component factory implementation that delegates to JGoodies component factory.
Constructor Summary | |
---|---|
DefaultComponentFactory()
|
Method Summary | |
---|---|
void |
addConfiguredTab(JTabbedPane tabbedPane,
String labelKey,
JComponent tabComponent)
Adds a tab to the provided tabbed pane, configuring the tab's appearance from information retrieved using the labelKey property. |
void |
configureForEnum(JComboBox comboBox,
Class enumType)
Configure a combo box to be populated with all enums of the specified enumeration type. |
protected void |
configureTextField(JTextField textField)
Configures the text field. |
JButton |
createButton(String labelKey)
Create and configure a button with the specified label key. |
JCheckBox |
createCheckBox(String labelKey)
Create a configured checkbox. |
JCheckBox |
createCheckBox(String[] labelKeys)
Create a configured checkbox. |
JComboBox |
createComboBox()
Create a combo box using this component factory. |
JComboBox |
createComboBox(Class enumType)
Create a combo box using this component factory, to be populated by the list of all enums of the specified type, resolved using this factory's enum resolver. |
JFormattedTextField |
createFormattedTextField(JFormattedTextField.AbstractFormatterFactory formatterFactory)
Create a formatted text field using this component factory. |
JLabel |
createLabel(String labelKey)
Create and configure a label with the specified label key. |
JLabel |
createLabel(String[] labelKeys)
Create and configure a label with the specified label key. |
JLabel |
createLabel(String labelKey,
Object[] arguments)
Creates and configure a label with the specified label key and parameterized arguments. |
JLabel |
createLabel(String labelKey,
ValueModel[] argumentValueHolders)
Creates and configure a label with the specified label key and parameterized arguments. |
JComponent |
createLabeledSeparator(String labelKey)
Create and configure an left-aligned label acting as a form dividing separator; that is, a control that displays a label and a separator immediately underneath it. |
JComponent |
createLabeledSeparator(String labelKey,
Alignment alignment)
Create and configure an aligned label acting as a form dividing separator; that is, a control that displays a label and a separator immediately underneath it. |
JLabel |
createLabelFor(String[] labelKeys,
JComponent component)
Create and configure a label for the provided component. |
JLabel |
createLabelFor(String labelKey,
JComponent component)
Create and configure a label for the provided component. |
JList |
createList()
Create a list using this component factory. |
JComboBox |
createListValueModelComboBox(ValueModel selectedItemValueModel,
ValueModel selectableItemsListHolder,
String renderedPropertyPath)
Create a combo box using this component factory. |
JMenuItem |
createMenuItem(String labelKey)
Create a configured menu item. |
protected JCheckBox |
createNewCheckBox()
|
protected JLabel |
createNewLabel()
|
protected JRadioButton |
createNewRadioButton()
|
protected AbstractButton |
createNewToggleButton()
|
JPanel |
createPanel()
Creates a panel using this component factory. |
JPanel |
createPanel(LayoutManager layoutManager)
Creates a panel with the supplied LayoutManager using this component factory. |
JPasswordField |
createPasswordField()
Create a standard password field using this component factory. |
JRadioButton |
createRadioButton(String labelKey)
Create a configured radio button. |
JRadioButton |
createRadioButton(String[] labelKeys)
Create a configured radio button. |
JScrollPane |
createScrollPane()
Create a scroll pane using this component factory. |
JScrollPane |
createScrollPane(Component view)
Create a scroll pane using this component factory, with the specified component as the viewport view. |
JScrollPane |
createScrollPane(Component view,
int vsbPolicy,
int hsbPolicy)
Create a scroll pane using this component factory, with the specified component as the viewport view and with the specified vertical and horizontal scrollbar policies. |
JTabbedPane |
createTabbedPane()
Create and return a new tabbed pane. |
JTable |
createTable()
Construct a JTable with a default model It will delegate the creation to a TableFactory if it exists. |
JTable |
createTable(TableModel model)
Construct a JTable with the specified table model. |
JTextArea |
createTextArea()
Create a text area using this component factory. |
JTextArea |
createTextArea(int rows,
int columns)
Create a text area using this component factory. |
JTextArea |
createTextAreaAsLabel()
Create a text area that looks like a label (but with cut/copy/paste enabled!) using this component factory. |
JTextField |
createTextField()
Create a standard text field using this component factory. |
JComponent |
createTitledBorderFor(String labelKey,
JComponent component)
Creates a titled border for the specified component. |
JLabel |
createTitleLabel(String labelKey)
Create and configure a title label with the specified label key. |
JToggleButton |
createToggleButton(String labelKey)
Create a configured toggle button. |
JToggleButton |
createToggleButton(String[] labelKeys)
Create a configured toggle button. |
JComponent |
createToolBar()
Construct a JToolBar. |
protected ButtonFactory |
getButtonFactory()
|
protected CommandButtonLabelInfo |
getButtonLabelInfo(String label)
|
protected LabeledEnumResolver |
getEnumResolver()
Returns the resolver used for enumerations. |
protected LabelInfo |
getLabelInfo(String label)
Parse the given label to create a LabelInfo . |
protected MenuFactory |
getMenuFactory()
|
protected String |
getOptionalMessage(String messageKey)
|
protected String |
getRequiredMessage(String messageKey)
Get the message for the given key. |
protected String |
getRequiredMessage(String[] messageKeys)
Get the message for the given key. |
int |
getTextFieldColumns()
Returns the default column count for new text fields (including formatted text and password fields) |
void |
setButtonFactory(ButtonFactory buttonFactory)
Set the button factory. |
void |
setEnumResolver(LabeledEnumResolver enumResolver)
Set the resolver used to create messages for enumerations. |
void |
setIconSource(IconSource iconSource)
Set the source for retrieving icons. |
void |
setMenuFactory(MenuFactory menuFactory)
Set the menu factory. |
void |
setMessageSource(MessageSource messageSource)
|
void |
setTableFactory(TableFactory tableFactory)
Allow configuration via XML of a table factory. |
void |
setTextFieldColumns(int columns)
Defines the default column count for new text fields (including formatted text and password fields) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultComponentFactory()
Method Detail |
---|
public void setMessageSource(MessageSource messageSource)
setMessageSource
in interface MessageSourceAware
public void setIconSource(IconSource iconSource)
public void setButtonFactory(ButtonFactory buttonFactory)
public void setMenuFactory(MenuFactory menuFactory)
public void setEnumResolver(LabeledEnumResolver enumResolver)
LabeledEnum
protected LabeledEnumResolver getEnumResolver()
ApplicationServicesLocator
to find one if no resolver is
explicitly set.
public JLabel createLabel(String labelKey)
createLabel
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.
public JLabel createLabel(String[] labelKeys)
createLabel
in interface ComponentFactory
public JLabel createLabel(String labelKey, Object[] arguments)
createLabel
in interface ComponentFactory
protected LabelInfo getLabelInfo(String label)
LabelInfo
.
label
- The label to parse.
LabelInfo
representing the label.LabelInfo.valueOf(String)
protected String getRequiredMessage(String messageKey)
messageKey
- Key to lookup the message.
protected String getRequiredMessage(String[] messageKeys)
messageKeys
- The keys to use when looking for the message.
public JLabel createLabel(String labelKey, ValueModel[] argumentValueHolders)
createLabel
in interface ComponentFactory
argumentValueHolders
- The value model of the arguments;
public JLabel createTitleLabel(String labelKey)
ComponentFactory
createTitleLabel
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.
public JComponent createTitledBorderFor(String labelKey, JComponent component)
ComponentFactory
createTitledBorderFor
in interface ComponentFactory
labelKey
- the title label message code.component
- the component to attach a titled border to.
public JLabel createLabelFor(String labelKey, JComponent component)
ComponentFactory
createLabelFor
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.component
- the labeled component
public JLabel createLabelFor(String[] labelKeys, JComponent component)
ComponentFactory
createLabelFor
in interface ComponentFactory
component
- the labeled component
protected JLabel createNewLabel()
public JButton createButton(String labelKey)
ComponentFactory
createButton
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.
protected CommandButtonLabelInfo getButtonLabelInfo(String label)
protected ButtonFactory getButtonFactory()
public JComponent createLabeledSeparator(String labelKey)
ComponentFactory
createLabeledSeparator
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.
public JCheckBox createCheckBox(String labelKey)
ComponentFactory
createCheckBox
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.
public JCheckBox createCheckBox(String[] labelKeys)
ComponentFactory
createCheckBox
in interface ComponentFactory
labelKeys
- The label message codes; may also be the label text if
no message source is configured.
protected JCheckBox createNewCheckBox()
public JToggleButton createToggleButton(String labelKey)
ComponentFactory
createToggleButton
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.
public JToggleButton createToggleButton(String[] labelKeys)
ComponentFactory
createToggleButton
in interface ComponentFactory
labelKeys
- The label message codes; may also be the label text if
no message source is configured.
protected AbstractButton createNewToggleButton()
public JRadioButton createRadioButton(String labelKey)
ComponentFactory
createRadioButton
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.
protected JRadioButton createNewRadioButton()
public JRadioButton createRadioButton(String[] labelKeys)
ComponentFactory
createRadioButton
in interface ComponentFactory
labelKeys
- The label message codes; may also be the label text if
no message source is configured.
public JMenuItem createMenuItem(String labelKey)
ComponentFactory
createMenuItem
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.
protected MenuFactory getMenuFactory()
public JComponent createLabeledSeparator(String labelKey, Alignment alignment)
ComponentFactory
createLabeledSeparator
in interface ComponentFactory
labelKey
- The label message code; may also be the label text if no
message source is configured.alignment
- The label's alignment.
public JList createList()
ComponentFactory
createList
in interface ComponentFactory
public JComboBox createComboBox()
ComponentFactory
createComboBox
in interface ComponentFactory
public JComboBox createComboBox(Class enumType)
ComponentFactory
createComboBox
in interface ComponentFactory
public JComboBox createListValueModelComboBox(ValueModel selectedItemValueModel, ValueModel selectableItemsListHolder, String renderedPropertyPath)
ComponentFactory
createListValueModelComboBox
in interface ComponentFactory
public void configureForEnum(JComboBox comboBox, Class enumType)
ComponentFactory
configureForEnum
in interface ComponentFactory
enumType
- The enumeration type.public int getTextFieldColumns()
JTextField
public void setTextFieldColumns(int columns)
the
- default column count. Must not be lower than 0JTextField
public JFormattedTextField createFormattedTextField(JFormattedTextField.AbstractFormatterFactory formatterFactory)
ComponentFactory
createFormattedTextField
in interface ComponentFactory
formatterFactory
- AbstractFormatterFactory used for formatting.
public JTextField createTextField()
ComponentFactory
createTextField
in interface ComponentFactory
protected void configureTextField(JTextField textField)
textField
- the field to configure. Must not be nullpublic JPasswordField createPasswordField()
ComponentFactory
createPasswordField
in interface ComponentFactory
public JTextArea createTextArea()
ComponentFactory
createTextArea
in interface ComponentFactory
public JTextArea createTextArea(int rows, int columns)
ComponentFactory
createTextArea
in interface ComponentFactory
public JTextArea createTextAreaAsLabel()
ComponentFactory
createTextAreaAsLabel
in interface ComponentFactory
public JTabbedPane createTabbedPane()
ComponentFactory
createTabbedPane
in interface ComponentFactory
public void addConfiguredTab(JTabbedPane tabbedPane, String labelKey, JComponent tabComponent)
ComponentFactory
labelKey
property.
The tab title text, icon, mnemonic, and mnemonic index are all
configurable.
addConfiguredTab
in interface ComponentFactory
public JScrollPane createScrollPane()
ComponentFactory
createScrollPane
in interface ComponentFactory
JScrollPane.JScrollPane()
public JScrollPane createScrollPane(Component view)
ComponentFactory
createScrollPane
in interface ComponentFactory
view
- the component to display in the scrollpane's viewport
JScrollPane.JScrollPane(java.awt.Component)
public JScrollPane createScrollPane(Component view, int vsbPolicy, int hsbPolicy)
ComponentFactory
createScrollPane
in interface ComponentFactory
view
- the component to display in the scrollpane's viewportvsbPolicy
- set the vertical scrollbar policy.hsbPolicy
- set the horizontal scrollbar policy.
JScrollPane.JScrollPane(java.awt.Component, int, int)
public JPanel createPanel()
ComponentFactory
createPanel
in interface ComponentFactory
JPanel
public JPanel createPanel(LayoutManager layoutManager)
ComponentFactory
createPanel
in interface ComponentFactory
layoutManager
- the LayoutManager that will be used by the returned
panel
JPanel.JPanel(java.awt.LayoutManager)
protected String getOptionalMessage(String messageKey)
public JTable createTable()
createTable
in interface ComponentFactory
model
- the table model
public JTable createTable(TableModel model)
createTable
in interface ComponentFactory
model
- the table model
public void setTableFactory(TableFactory tableFactory)
tableFactory
- the table factory to usepublic JComponent createToolBar()
createToolBar
in interface ComponentFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |