|
||||||||||
| 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 MessageSourceAwarepublic void setIconSource(IconSource iconSource)
public void setButtonFactory(ButtonFactory buttonFactory)
public void setMenuFactory(MenuFactory menuFactory)
public void setEnumResolver(LabeledEnumResolver enumResolver)
LabeledEnumprotected LabeledEnumResolver getEnumResolver()
ApplicationServicesLocator to find one if no resolver is
explicitly set.
public JLabel createLabel(String labelKey)
createLabel in interface ComponentFactorylabelKey - 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 ComponentFactoryprotected 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 ComponentFactoryargumentValueHolders - The value model of the arguments;
public JLabel createTitleLabel(String labelKey)
ComponentFactory
createTitleLabel in interface ComponentFactorylabelKey - 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 ComponentFactorylabelKey - 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 ComponentFactorylabelKey - 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 ComponentFactorycomponent - the labeled component
protected JLabel createNewLabel()
public JButton createButton(String labelKey)
ComponentFactory
createButton in interface ComponentFactorylabelKey - 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 ComponentFactorylabelKey - 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 ComponentFactorylabelKey - 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 ComponentFactorylabelKeys - 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 ComponentFactorylabelKey - 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 ComponentFactorylabelKeys - 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 ComponentFactorylabelKey - 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 ComponentFactorylabelKeys - 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 ComponentFactorylabelKey - 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 ComponentFactorylabelKey - 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 ComponentFactorypublic JComboBox createComboBox()
ComponentFactory
createComboBox in interface ComponentFactorypublic 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 ComponentFactoryenumType - The enumeration type.public int getTextFieldColumns()
JTextFieldpublic void setTextFieldColumns(int columns)
the - default column count. Must not be lower than 0JTextFieldpublic JFormattedTextField createFormattedTextField(JFormattedTextField.AbstractFormatterFactory formatterFactory)
ComponentFactory
createFormattedTextField in interface ComponentFactoryformatterFactory - AbstractFormatterFactory used for formatting.
public JTextField createTextField()
ComponentFactory
createTextField in interface ComponentFactoryprotected void configureTextField(JTextField textField)
textField - the field to configure. Must not be nullpublic JPasswordField createPasswordField()
ComponentFactory
createPasswordField in interface ComponentFactorypublic JTextArea createTextArea()
ComponentFactory
createTextArea in interface ComponentFactory
public JTextArea createTextArea(int rows,
int columns)
ComponentFactory
createTextArea in interface ComponentFactorypublic JTextArea createTextAreaAsLabel()
ComponentFactory
createTextAreaAsLabel in interface ComponentFactorypublic JTabbedPane createTabbedPane()
ComponentFactory
createTabbedPane in interface ComponentFactory
public void addConfiguredTab(JTabbedPane tabbedPane,
String labelKey,
JComponent tabComponent)
ComponentFactorylabelKey property.
The tab title text, icon, mnemonic, and mnemonic index are all
configurable.
addConfiguredTab in interface ComponentFactorypublic JScrollPane createScrollPane()
ComponentFactory
createScrollPane in interface ComponentFactoryJScrollPane.JScrollPane()public JScrollPane createScrollPane(Component view)
ComponentFactory
createScrollPane in interface ComponentFactoryview - 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 ComponentFactoryview - 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 ComponentFactoryJPanelpublic JPanel createPanel(LayoutManager layoutManager)
ComponentFactory
createPanel in interface ComponentFactorylayoutManager - 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 ComponentFactorymodel - the table model
public JTable createTable(TableModel model)
createTable in interface ComponentFactorymodel - 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 | |||||||||