本文整理汇总了Java中org.springframework.richclient.layout.TableLayoutBuilder类的典型用法代码示例。如果您正苦于以下问题:Java TableLayoutBuilder类的具体用法?Java TableLayoutBuilder怎么用?Java TableLayoutBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableLayoutBuilder类属于org.springframework.richclient.layout包,在下文中一共展示了TableLayoutBuilder类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogContentPane
import org.springframework.richclient.layout.TableLayoutBuilder; //导入依赖的package包/类
protected JComponent createDialogContentPane() {
TableLayoutBuilder layoutBuilder = new TableLayoutBuilder();
if (this.inputField == null) {
this.inputField = getComponentFactory().createTextField();
}
// work around for bug in JFormattedTextField text field for selectAll
if (inputField instanceof JFormattedTextField) {
SelectAllBugFixer selectAllBugFixer = new SelectAllBugFixer();
inputField.addFocusListener(selectAllBugFixer);
}
layoutBuilder.cell(createInputLabel(), TableLayoutBuilder.DEFAULT_LABEL_ATTRIBUTES);
layoutBuilder.labelGapCol();
layoutBuilder.cell(inputField);
layoutBuilder.unrelatedGapRow();
layoutBuilder.cell(getMessagePane().getControl());
layoutBuilder.relatedGapRow();
layoutBuilder.separator("");
return layoutBuilder.getPanel();
}
示例2: createControl
import org.springframework.richclient.layout.TableLayoutBuilder; //导入依赖的package包/类
protected JComponent createControl() {
titleLabel = new JLabel();
titleLabel.setName("title");
titleLabel.setOpaque(false);
titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
titleLabel.setText(title);
iconLabel = new JLabel();
iconLabel.setName("icon");
iconLabel.setBackground(getBackgroundColor());
iconLabel.setIcon(getIcon());
JPanel panel = new JPanel();
panel.setName("panel");
panel.setBackground(getBackgroundColor());
TableLayoutBuilder table = new TableLayoutBuilder(panel);
table.row(FormFactory.LINE_GAP_ROWSPEC);
table.gapCol();
table.cell(titleLabel);
table.gapCol();
table.cell(iconLabel, "rowspan=2 colspec=pref");
table.row(FormFactory.NARROW_LINE_GAP_ROWSPEC);
table.cell(messagePane.getControl());
table.row(FormFactory.NARROW_LINE_GAP_ROWSPEC);
return table.getPanel();
}
示例3: addBinding
import org.springframework.richclient.layout.TableLayoutBuilder; //导入依赖的package包/类
/**
* adds a field binding to the form
*
* @param binding
* the binding of the field
* @param wrappedComponent
* the optional wrapped component. If null the component of the binding is used. This Parameter should be
* used if the component of the binding is being wrapped inside this component
* @param attributes
* optional layout attributes for the wrapped component. If null no layout attributes will be applied to
* the component. See {@link TableLayoutBuilder} for syntax details
* @param attributes
* optional layout attributes for the label. If null no layout attributes will be applied to the label.
* See {@link TableLayoutBuilder} for syntax details
* @return an array containing the label, the component of the field binding and the wrapped component
*/
public JComponent[] addBinding(Binding binding, JComponent wrappedComponent, String attributes,
String labelAttributes) {
Assert.notNull(binding, "binding is null");
Assert.isTrue(getFormModel() == binding.getFormModel(),
"Binding's form model must match FormBuilder's form model");
JComponent component = binding.getControl();
final JLabel label = createLabelFor(binding.getProperty(), component);
if (wrappedComponent == null) {
wrappedComponent = component;
}
TableLayoutBuilder layoutBuilder = getLayoutBuilder();
if (!layoutBuilder.hasGapToLeft()) {
layoutBuilder.gapCol();
}
layoutBuilder.cell(label, labelAttributes);
layoutBuilder.labelGapCol();
layoutBuilder.cell(wrappedComponent, attributes);
return new JComponent[] { label, component, wrappedComponent };
}
示例4: createDialogContentPane
import org.springframework.richclient.layout.TableLayoutBuilder; //导入依赖的package包/类
protected JComponent createDialogContentPane() {
TableLayoutBuilder builder = new TableLayoutBuilder();
JComponent selectionComponent = createSelectionComponent();
Assert.state(selectionComponent != null, "createSelectionComponent cannot return null");
if (StringUtils.hasText(description)) {
builder.cell(getComponentFactory().createLabelFor(description, selectionComponent));
builder.relatedGapRow();
builder.row();
}
builder.cell(selectionComponent);
return builder.getPanel();
}
示例5: createContentControl
import org.springframework.richclient.layout.TableLayoutBuilder; //导入依赖的package包/类
protected JPanel createContentControl() {
TableLayoutBuilder panelBuilder = new TableLayoutBuilder();
String colSpec = "colSpec=" + getTreeControlWidth() + " rowSpec=fill:default:grow";
panelBuilder.cell(new JScrollPane(pageTree), colSpec);
panelBuilder.gapCol();
panelBuilder.cell(pagePanel, "valign=top");
return panelBuilder.getPanel();
}
示例6: createSelectionComponent
import org.springframework.richclient.layout.TableLayoutBuilder; //导入依赖的package包/类
protected JComponent createSelectionComponent() {
TableLayoutBuilder builder = new TableLayoutBuilder();
JComponent filterComponent = createFilterComponent();
builder.cell(filterComponent);
builder.row();
builder.relatedGapRow();
builder.cell(super.createSelectionComponent());
return builder.getPanel();
}
示例7: SimplePanel
import org.springframework.richclient.layout.TableLayoutBuilder; //导入依赖的package包/类
public SimplePanel() {
TableLayoutBuilder builder = new TableLayoutBuilder(this);
stringField = new JTextField(10);
stringField.setName("stringProperty");
comboBox = new JComboBox(new String[] { "item 0", "item 1", "item 2" });
comboBox.setName("comboProperty");
checkBox = new JCheckBox("checkbox");
checkBox.setName("booleanProperty");
builder.cell(new JLabel("string"));
builder.gapCol();
builder.cell(stringField);
builder.relatedGapRow();
builder.cell(new JLabel("combo"));
builder.gapCol();
builder.cell(comboBox);
builder.relatedGapRow();
builder.cell(checkBox);
builder.relatedGapRow();
JPanel nestedPanel =new JPanel();
nestedField = new JTextField("test");
nestedField.setName("nestedField");
nestedPanel.add(nestedField);
builder.cell(nestedPanel);
builder.getPanel();
}
示例8: addTextArea
import org.springframework.richclient.layout.TableLayoutBuilder; //导入依赖的package包/类
/**
* Adds the field to the form by using a text area component which is wrapped inside a scrollpane.
* {@link #createTextArea(String)} is used to create the component for the text area field
* <p>
* Note: this method ensures that the the label of the textarea has a top vertical alignment if <code>valign</code>
* is not defined in the default label attributes
*
* @param fieldName
* the name of the field to add
* @param attributes
* optional layout attributes for the scrollpane. See {@link TableLayoutBuilder} for syntax details
* @return an array containing the label, the textarea and the scrollpane and which where added to the form
*
* @see #createTextArea(String)
*/
public JComponent[] addTextArea(String fieldName, String attributes) {
JComponent textArea = createTextArea(fieldName);
String labelAttributes = getLabelAttributes();
if (labelAttributes == null) {
labelAttributes = VALIGN_TOP;
} else if (!labelAttributes.contains(TableLayoutBuilder.VALIGN)) {
labelAttributes += " " + VALIGN_TOP;
}
return addBinding(createBinding(fieldName, textArea), new JScrollPane(textArea), attributes, labelAttributes);
}
示例9: TableFormBuilder
import org.springframework.richclient.layout.TableLayoutBuilder; //导入依赖的package包/类
/**
* Creates an instances of the TableFormBuilder by using a {@link BindingFactory} and a given {@ TableLayoutBuilder}
*
* @param bindingFactory
* the binding factory to use to create field bindings.
*/
public TableFormBuilder(BindingFactory bindingFactory, TableLayoutBuilder tableLayoutBuilder) {
super(bindingFactory);
this.builder = tableLayoutBuilder;
}