/** * Adds the standard horizontal gap for related components. * * @see LayoutStyle#getRelatedComponentsPadX() */ public void addRelatedGap() { appendRelatedComponentsGapColumn(); nextColumn(); }
/** * Adds the standard horizontal gap for unrelated components. * * @see LayoutStyle#getUnrelatedComponentsPadX() */ public void addUnrelatedGap() { appendUnrelatedComponentsGapColumn(); nextColumn(); }
/** * Adds the standard horizontal gap for related components. * * @return this builder * * @see LayoutStyle#getRelatedComponentsPadX() */ public ButtonBarBuilder2 addRelatedGap() { appendRelatedComponentsGapColumn(); nextColumn(); return this; }
/** * Adds the standard horizontal gap for unrelated components. * * @return this builder * * @see LayoutStyle#getUnrelatedComponentsPadX() */ public ButtonBarBuilder2 addUnrelatedGap() { appendUnrelatedComponentsGapColumn(); nextColumn(); return this; }
/** * Adds a glue that will be given the extra space, * if this button bar is larger than its preferred size. */ public void addGlue() { appendGlueColumn(); nextColumn(); }
/** * Adds a glue that will be given the extra space, * if this button bar is larger than its preferred size. * * @return this builder */ public ButtonBarBuilder2 addGlue() { appendGlueColumn(); nextColumn(); return this; }
/** * Adds a fixed size component with narrow margin. Unlike the gridded * components, this component keeps its individual preferred dimension. * * @param component the component to add */ public void addFixed(JComponent component) { component.putClientProperty(NARROW_KEY, Boolean.TRUE); getLayout().appendColumn(FormFactory.PREF_COLSPEC); add(component); nextColumn(); }
/** * Adds a button or other component that grows if the container grows. * The component's initial size (before it grows) is specified * by the {@link LayoutStyle#getDefaultButtonWidth()}. * * @param component the component to add */ public void addGrowing(JComponent component) { getLayout().appendColumn(FormFactory.GROWING_BUTTON_COLSPEC); component.putClientProperty(NARROW_KEY, Boolean.TRUE); add(component); nextColumn(); }
/** * Adds a fixed size component with narrow margin. Unlike the gridded * components, this component keeps its individual preferred dimension. * * @param component the component to add * * @return this builder */ public ButtonBarBuilder2 addFixed(JComponent component) { component.putClientProperty(NARROW_KEY, Boolean.TRUE); getLayout().appendColumn(FormFactory.PREF_COLSPEC); add(component); nextColumn(); return this; }
/** * Adds a command button component that has a minimum width * specified by the {@link LayoutStyle#getDefaultButtonWidth()}.<p> * * Although a JButton is expected, any JComponent is accepted * to allow custom button component types. * * @param button the component to add * * @throws NullPointerException if {@code button} is {@code null} */ public void addButton(JComponent button) { button.putClientProperty(NARROW_KEY, Boolean.TRUE); getLayout().appendColumn(FormFactory.BUTTON_COLSPEC); add(button); nextColumn(); }
/** * Adds a button or other component that grows if the container grows. * The component's initial size (before it grows) is specified * by the {@link LayoutStyle#getDefaultButtonWidth()}. * * @param component the component to add * * @return this builder */ public ButtonBarBuilder2 addGrowing(JComponent component) { getLayout().appendColumn(FormFactory.GROWING_BUTTON_COLSPEC); component.putClientProperty(NARROW_KEY, Boolean.TRUE); add(component); nextColumn(); return this; }
/** * Adds a command button component that has a minimum width * specified by the {@link LayoutStyle#getDefaultButtonWidth()}.<p> * * Although a JButton is expected, any JComponent is accepted * to allow custom button component types. * * @param button the component to add * * @return this builder * * @throws NullPointerException if {@code button} is {@code null} */ public ButtonBarBuilder2 addButton(JComponent button) { button.putClientProperty(NARROW_KEY, Boolean.TRUE); getLayout().appendColumn(FormFactory.BUTTON_COLSPEC); add(button); nextColumn(); return this; }
/** * Adds a horizontal strut of the specified width. * For related and unrelated components use {@link #addRelatedGap()} * and {@link #addUnrelatedGap()} respectively. * * @param width describes the gap width * * @see ColumnSpec#createGap(ConstantSize) */ public void addStrut(ConstantSize width) { getLayout().appendColumn(ColumnSpec.createGap(width)); nextColumn(); }
/** * Adds a horizontal strut of the specified width. * For related and unrelated components use {@link #addRelatedGap()} * and {@link #addUnrelatedGap()} respectively. * * @param width describes the gap width * * @return this builder * * @see ColumnSpec#createGap(ConstantSize) */ public ButtonBarBuilder2 addStrut(ConstantSize width) { getLayout().appendColumn(ColumnSpec.createGap(width)); nextColumn(); return this; }