Module is.codion.swing.common.ui
Class DefaultFormBuilder<B extends FormBuilder<B>>
java.lang.Object
is.codion.swing.common.ui.component.builder.AbstractComponentBuilder<JPanel,B>
is.codion.swing.common.ui.component.panel.DefaultFormBuilder<B>
- Type Parameters:
B- the builder type
- All Implemented Interfaces:
ComponentBuilder<JPanel,,B> FormBuilder<B>,Supplier<JPanel>
- Direct Known Subclasses:
EditorComponents.ComponentFactory.AttributeFormBuilder
public class DefaultFormBuilder<B extends FormBuilder<B>>
extends AbstractComponentBuilder<JPanel,B>
implements FormBuilder<B>
A default
FormBuilder implementation, extendable in order to add further ways of adding inputs.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Badd(Supplier<? extends JComponent> component) Adds a label/input pair, the label being the one associated with the component viaJLabel.setLabelFor(java.awt.Component), if any, otherwise the component occupies the input column alone, the label cell empty.final Badd(Supplier<? extends JComponent> label, Supplier<? extends JComponent> component) Adds a label/input pair.final Badd(JComponent component) Adds a label/input pair, the label being the one associated with the component viaJLabel.setLabelFor(java.awt.Component), if any, otherwise the component occupies the input column alone, the label cell empty.final Badd(JComponent label, JComponent component) Adds a label/input pair.final Bcolumns(int columns) protected final JPanelCreates the component.final BlabelAlignment(int labelAlignment) final Bspan(Supplier<? extends JComponent> component) Adds a component occupying a row of its own.final Bspan(JComponent component) Adds a component occupying a row of its own.Methods inherited from class is.codion.swing.common.ui.component.builder.AbstractComponentBuilder
ancestorListener, background, border, build, build, clientProperty, componentListener, componentOrientation, configureComponent, enable, enabled, enabled, focusable, focusable, focusCycleRoot, focusListener, font, font, foreground, hierarchyListener, input, keyEvent, keyListener, label, label, label, label, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, name, onBuild, onSetVisible, opaque, popupControl, popupControls, popupControls, popupMenu, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, self, setName, toolTipText, toolTipText, transferFocusOnEnter, transferFocusOnEnter, transferHandler, visible, visibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
ancestorListener, background, border, build, build, clientProperty, componentListener, componentOrientation, enabled, enabled, focusable, focusable, focusCycleRoot, focusListener, font, font, foreground, get, hierarchyListener, keyEvent, keyListener, label, label, label, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, name, onBuild, onSetVisible, opaque, popupControl, popupControls, popupControls, popupMenu, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, toolTipText, transferFocusOnEnter, transferFocusOnEnter, transferHandler, visible, visible
-
Constructor Details
-
DefaultFormBuilder
protected DefaultFormBuilder()Instantiates a newDefaultFormBuilder
-
-
Method Details
-
columns
- Specified by:
columnsin interfaceFormBuilder<B extends FormBuilder<B>>- Parameters:
columns- the number of label/input pairs per row, default 1- Returns:
- this builder instance
-
labelAlignment
- Specified by:
labelAlignmentin interfaceFormBuilder<B extends FormBuilder<B>>- Parameters:
labelAlignment- the horizontal alignment of the labels within the label column,SwingConstants.LEADING(default) orSwingConstants.TRAILING- Returns:
- this builder instance
-
add
Description copied from interface:FormBuilderAdds a label/input pair, the label being the one associated with the component viaJLabel.setLabelFor(java.awt.Component), if any, otherwise the component occupies the input column alone, the label cell empty.- Specified by:
addin interfaceFormBuilder<B extends FormBuilder<B>>- Parameters:
component- the input component- Returns:
- this builder instance
-
add
Description copied from interface:FormBuilderAdds a label/input pair, the label being the one associated with the component viaJLabel.setLabelFor(java.awt.Component), if any, otherwise the component occupies the input column alone, the label cell empty.- Specified by:
addin interfaceFormBuilder<B extends FormBuilder<B>>- Parameters:
component- the input component- Returns:
- this builder instance
-
add
Description copied from interface:FormBuilderAdds a label/input pair. AJLabelcarrying no association of its own is associated with the component, so that its mnemonic focuses it.- Specified by:
addin interfaceFormBuilder<B extends FormBuilder<B>>- Parameters:
label- the labelcomponent- the input component- Returns:
- this builder instance
-
add
Description copied from interface:FormBuilderAdds a label/input pair. AJLabelcarrying no association of its own is associated with the component, so that its mnemonic focuses it.- Specified by:
addin interfaceFormBuilder<B extends FormBuilder<B>>- Parameters:
label- the labelcomponent- the input component- Returns:
- this builder instance
-
span
Description copied from interface:FormBuilderAdds a component occupying a row of its own. A label associated with the component keeps the label column, the component spanning the rest of the row, otherwise the component spans the full width.- Specified by:
spanin interfaceFormBuilder<B extends FormBuilder<B>>- Parameters:
component- the component- Returns:
- this builder instance
-
span
Description copied from interface:FormBuilderAdds a component occupying a row of its own. A label associated with the component keeps the label column, the component spanning the rest of the row, otherwise the component spans the full width.- Specified by:
spanin interfaceFormBuilder<B extends FormBuilder<B>>- Parameters:
component- the component- Returns:
- this builder instance
-
createComponent
Description copied from class:AbstractComponentBuilderCreates the component.- Specified by:
createComponentin classAbstractComponentBuilder<JPanel,B extends FormBuilder<B>> - Returns:
- a new component instance
-