public class SimpleForm extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_COMPONENT_ALIGNMENT |
static int |
DEFAULT_COMPONENT_COLUMN |
static int |
DEFAULT_LABEL_COLUMN |
protected static int |
DEFAULT_TEXT_FIELD_COLUMNS |
protected static String |
ENABLED_PROPERTY_NAME |
static Color |
HINT_TEXT_COLOR |
static int |
LONG_TEXT_FIELD_COLUMNS |
static int |
MEDIUM_TEXT_FIELD_COLUMNS |
static int |
SHORT_TEXT_FIELD_COLUMNS |
Constructor and Description |
---|
SimpleForm() |
SimpleForm(String columnSpec) |
SimpleForm(String columnSpec,
Border border) |
Modifier and Type | Method and Description |
---|---|
JButton |
addButtonWithoutLabelToTheRight(String text,
ActionListener actionListener) |
void |
addComponent(JComponent component) |
void |
addComponentWithoutLabel(JComponent component) |
void |
addHiddenValue(String name,
String value) |
void |
addInputFieldHintText(String text) |
<T extends JComponent> |
addLeftComponent(T component) |
JButton |
addRightButton(Action action) |
void |
addRightComponent(JComponent component) |
void |
addSpace() |
void |
addSpace(int size) |
void |
append(JComponent component) |
void |
append(String label,
JComponent component) |
<T extends JComponent> |
append(String name,
JLabel label,
T field) |
<T extends JComponent> |
append(String label,
T component,
String alignments) |
JButton |
appendButton(String label,
String tooltip) |
JButton |
appendButtonWithoutLabel(String text,
ActionListener actionListener) |
JCheckBox |
appendCheckBox(String caption,
String label,
boolean selected) |
JComboBox |
appendComboBox(String label,
ComboBoxModel model,
String tooltip) |
JComboBox |
appendComboBox(String label,
Map<?,?> values) |
JComboBox |
appendComboBox(String label,
Object[] values,
String tooltip) |
void |
appendFixed(String label,
JComponent component) |
void |
appendHeading(String text)
Appends a heading with bold text that streches from the default label column to the end of the form
|
void |
appendHeadingAndHelpButton(String text,
String helpUrl) |
void |
appendInOneRow(PropertyComponent... propertyComponents)
Appends a vararg of PropertyComponents to a single row in the form.
|
void |
appendLabelAsLink(String url,
String text)
Appens a label with hyperlink behaviour that streches from the default label column to the end of the form
|
JPasswordField |
appendPasswordField(String label,
String tooltip) |
JRadioButton |
appendRadioButton(String caption,
String label,
ButtonGroup group,
boolean selected) |
void |
appendSeparator() |
JTextArea |
appendTextArea(String label,
String tooltip) |
JTextField |
appendTextField(String label,
String tooltip)
Appends a label and a text field to the form
|
JTextField |
appendTextField(String label,
String name,
String tooltip,
int textFieldColumns)
Appends a label and a text field to the form
|
JComponent |
getComponent(String label) |
String |
getComponentValue(String label) |
int |
getDefaultTextAreaColumns() |
int |
getDefaultTextAreaRows() |
Font |
getLabelFont() |
JPanel |
getPanel() |
String |
getRowAlignment() |
int |
getRowCount() |
int |
getRowSpacing() |
void |
getValues(Map<String,String> values) |
boolean |
hasComponents() |
void |
removeComponent(JComponent component) |
void |
setBorder(Border border) |
void |
setComponentValue(String label,
String value) |
void |
setDefaultTextAreaColumns(int defaultTextAreaColumns) |
void |
setDefaultTextAreaRows(int defaultTextAreaRows) |
void |
setDefaultTextFieldColumns(int defaultTextFieldColumns) |
void |
setEnabled(boolean b) |
void |
setLabelFont(Font labelFont) |
void |
setRowAlignment(String rowAlignment) |
void |
setRowAlignment(String alignment,
String size,
String resize) |
void |
setRowSpacing(int rowSpacing) |
void |
setValues(Map<String,String> values) |
public static final int DEFAULT_COMPONENT_COLUMN
public static final int DEFAULT_LABEL_COLUMN
public static final int SHORT_TEXT_FIELD_COLUMNS
public static final int MEDIUM_TEXT_FIELD_COLUMNS
public static final int LONG_TEXT_FIELD_COLUMNS
public static final Color HINT_TEXT_COLOR
protected static final String DEFAULT_COMPONENT_ALIGNMENT
protected static final int DEFAULT_TEXT_FIELD_COLUMNS
protected static final String ENABLED_PROPERTY_NAME
public SimpleForm()
public SimpleForm(String columnSpec)
public JPanel getPanel()
public boolean hasComponents()
public int getRowCount()
public String getRowAlignment()
public Font getLabelFont()
public void setLabelFont(Font labelFont)
public void setRowAlignment(String rowAlignment)
public int getRowSpacing()
public void setRowSpacing(int rowSpacing)
public void setEnabled(boolean b)
public JComponent getComponent(String label)
public void setBorder(Border border)
public void addInputFieldHintText(String text)
public int getDefaultTextAreaColumns()
public void setDefaultTextFieldColumns(int defaultTextFieldColumns)
defaultTextFieldColumns
- Should be a constant defined in SimpleFormSimpleForm
public void setDefaultTextAreaColumns(int defaultTextAreaColumns)
public int getDefaultTextAreaRows()
public void setDefaultTextAreaRows(int defaultTextAreaRows)
public void appendLabelAsLink(String url, String text)
url
- The URL to open when clicking on the labeltext
- The text of the labelpublic void appendHeading(String text)
text
- The text of the headingpublic JComboBox appendComboBox(String label, ComboBoxModel model, String tooltip)
public JRadioButton appendRadioButton(String caption, String label, ButtonGroup group, boolean selected)
public JButton appendButtonWithoutLabel(String text, ActionListener actionListener)
public JButton addButtonWithoutLabelToTheRight(String text, ActionListener actionListener)
public JPasswordField appendPasswordField(String label, String tooltip)
public JTextField appendTextField(String label, String tooltip)
label
- The value of the label. Will also be the name of the text field.tooltip
- The value of the text field tool tippublic JTextField appendTextField(String label, String name, String tooltip, int textFieldColumns)
label
- The value of the labelname
- The name of the text fieldtooltip
- The value of the text field tool tiptextFieldColumns
- The number of columns to display for the text field. Should be a constant defined in SimpleFormSimpleForm
public void addSpace()
public void addSpace(int size)
public void appendSeparator()
public void addComponentWithoutLabel(JComponent component)
public <T extends JComponent> T addLeftComponent(T component)
public void addRightComponent(JComponent component)
public void addComponent(JComponent component)
public void removeComponent(JComponent component)
public void appendFixed(String label, JComponent component)
public void append(JComponent component)
public void append(String label, JComponent component)
public <T extends JComponent> T append(String label, T component, String alignments)
public <T extends JComponent> T append(String name, JLabel label, T field)
public void appendInOneRow(PropertyComponent... propertyComponents)
propertyComponents
- The PropertyComponents to be addedCopyright © 2019. All Rights Reserved.