|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.layout.TableLayoutBuilder
public class TableLayoutBuilder
A panel builder that provides the capability to quickly build grid based forms. The builder allows for layout to be defined in a way that will be familiar to anyone used to HTML tables and JGoodies Forms. Key features:
TableLayoutBuilder table = new TableLayoutBuilder(); table .row() .separator("General 1") .row() .cell(new JLabel("Company"), "colSpec=right:pref colGrId=labels") .labelGapCol() .cell(new JFormattedTextField()) .row() .cell(new JLabel("Contact")) .cell(new JFormattedTextField()) .unrelatedGapRow() .separator("Propeller") .row() .cell(new JLabel("PTI [kW]")).cell(new JFormattedTextField()) .unrelatedGapCol() .cell(new JLabel("Description"), "colSpec=right:pref colGrId=labels") .labelGapCol() .cell(new JScrollPane(new JTextArea()), "rowspan=3") .row() .cell(new JLabel("R [mm]")) .cell(new JFormattedTextField()) .cell() .row() .cell(new JLabel("D [mm]")) .cell(new JFormattedTextField()) .cell(); table.getPanel();
Field Summary | |
---|---|
static String |
ALIGN
|
static String |
COLGROUPID
|
static String |
COLSPAN
|
static String |
COLSPEC
|
static int |
COLUMN_MAJOR_FOCUS_ORDER
Constant indicating column major focus traversal order. |
static String |
DEFAULT_LABEL_ATTRIBUTES
|
static int |
ROW_MAJOR_FOCUS_ORDER
Constant indicating row major focus traversal order. |
static String |
ROWGROUPID
|
static String |
ROWSPAN
|
static String |
ROWSPEC
|
static String |
VALIGN
|
Constructor Summary | |
---|---|
TableLayoutBuilder()
Creates a new TableLayoutBuilder. |
|
TableLayoutBuilder(JPanel panel)
Creates a new TableLayoutBuilder which will perform it's layout in the supplied JPanel. |
Method Summary | |
---|---|
TableLayoutBuilder |
cell()
Inserts an empty cell at the current row/column. |
TableLayoutBuilder |
cell(JComponent component)
Inserts a component at the current row/column. |
TableLayoutBuilder |
cell(JComponent component,
String attributes)
Inserts a component at the current row/column. |
TableLayoutBuilder |
cell(String attributes)
Inserts an empty cell at the current row/column. |
TableLayoutBuilder |
gapCol()
Inserts a related component gap column. |
TableLayoutBuilder |
gapCol(com.jgoodies.forms.layout.ColumnSpec colSpec)
Inserts a gap column with the specified colSpec. |
TableLayoutBuilder |
gapCol(String colSpec)
Inserts a gap column with the specified colSpec. |
ComponentFactory |
getComponentFactory()
Returns the ComponentFactory that this uses to create things like
labels. |
int |
getCurrentCol()
Returns the current column (zero-based) that the builder is putting components in. |
int |
getCurrentRow()
Returns the current row (zero-based) that the builder is putting components in. |
JPanel |
getPanel()
Creates and returns a JPanel with all the given components in it, using the "hints" that were provided to the builder. |
boolean |
hasGapAbove()
Return true if there is a gap row above of the current cell |
boolean |
hasGapToLeft()
Return true if there is a gap column to the left of the current cell |
protected void |
installFocusOrder(List focusOrder)
Install the specified focus order. |
TableLayoutBuilder |
labelGapCol()
Inserts a label component gap column. |
TableLayoutBuilder |
relatedGapRow()
Inserts a new row. |
TableLayoutBuilder |
row()
Inserts a new row. |
TableLayoutBuilder |
row(com.jgoodies.forms.layout.RowSpec gapRowSpec)
Inserts a new row. |
TableLayoutBuilder |
row(String gapRowSpec)
Inserts a new row. |
TableLayoutBuilder |
separator(String labelKey)
Inserts a separator with the given label. |
TableLayoutBuilder |
separator(String labelKey,
String attributes)
Inserts a separator with the given label. |
void |
setComponentFactory(ComponentFactory componentFactory)
Sets the ComponentFactory that this uses to create things like
labels. |
void |
setCustomFocusTraversalOrder(List focusOrder)
Set a custom focus traversal order using the provided list of components. |
void |
setFocusTraversalOrder(int traversalOrder)
Set the focus traversal order. |
TableLayoutBuilder |
unrelatedGapCol()
Inserts a unrelated component gap column. |
TableLayoutBuilder |
unrelatedGapRow()
Inserts a new row. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_LABEL_ATTRIBUTES
public static final String ALIGN
public static final String VALIGN
public static final String ROWSPEC
public static final String COLSPEC
public static final String ROWSPAN
public static final String COLSPAN
public static final String ROWGROUPID
public static final String COLGROUPID
public static final int COLUMN_MAJOR_FOCUS_ORDER
public static final int ROW_MAJOR_FOCUS_ORDER
Constructor Detail |
---|
public TableLayoutBuilder()
public TableLayoutBuilder(JPanel panel)
Method Detail |
---|
public ComponentFactory getComponentFactory()
ComponentFactory
that this uses to create things like
labels.
Application
'spublic void setComponentFactory(ComponentFactory componentFactory)
ComponentFactory
that this uses to create things like
labels.
public int getCurrentRow()
public int getCurrentCol()
public TableLayoutBuilder row()
public TableLayoutBuilder row(String gapRowSpec)
public TableLayoutBuilder row(com.jgoodies.forms.layout.RowSpec gapRowSpec)
public TableLayoutBuilder relatedGapRow()
public TableLayoutBuilder unrelatedGapRow()
public TableLayoutBuilder cell()
public TableLayoutBuilder cell(String attributes)
public TableLayoutBuilder cell(JComponent component)
public TableLayoutBuilder cell(JComponent component, String attributes)
public TableLayoutBuilder gapCol()
public TableLayoutBuilder gapCol(String colSpec)
public TableLayoutBuilder gapCol(com.jgoodies.forms.layout.ColumnSpec colSpec)
public TableLayoutBuilder labelGapCol()
public TableLayoutBuilder unrelatedGapCol()
public TableLayoutBuilder separator(String labelKey)
public TableLayoutBuilder separator(String labelKey, String attributes)
public boolean hasGapToLeft()
public boolean hasGapAbove()
public JPanel getPanel()
getPanel
in interface LayoutBuilder
public void setFocusTraversalOrder(int traversalOrder)
order
- forcus traversal order. Must be one of COLUMN_MAJOR_FOCUS_ORDER
or ROW_MAJOR_FOCUS_ORDER
.public void setCustomFocusTraversalOrder(List focusOrder)
focusOrder
- List of components in the order that focus should follow.protected void installFocusOrder(List focusOrder)
focusOrder
- List of components in the order that focus should follow.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |