Package io.github.jonestimd.swing
Class ButtonBarFactory
- java.lang.Object
-
- io.github.jonestimd.swing.ButtonBarFactory
-
public class ButtonBarFactory extends java.lang.Object
Helper class for building button bars usingButtonBarLayout
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
BUTTON_GAP
-
Constructor Summary
Constructors Constructor Description ButtonBarFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ButtonBarFactory
add(java.awt.Component... buttons)
ButtonBarFactory
add(javax.swing.Action... actions)
ButtonBarFactory
addActions(java.util.Collection<? extends javax.swing.Action> actions)
ButtonBarFactory
addButtons(java.util.Collection<? extends java.awt.Component> buttons)
ButtonBarFactory
alignRight()
Make the button bar right aligned.ButtonBarFactory
border(int top, int... borders)
Set an empty border on the button bar.static javax.swing.JComponent
createVerticalButtonBar(java.awt.Component... buttons)
Create a vertical button bar.static javax.swing.JComponent
createVerticalButtonBar(java.util.List<? extends java.awt.Component> components)
Create a vertical button bar.javax.swing.JComponent
get()
ButtonBarFactory
vertical()
-
-
-
Field Detail
-
BUTTON_GAP
public static final int BUTTON_GAP
- See Also:
- Constant Field Values
-
-
Method Detail
-
createVerticalButtonBar
public static javax.swing.JComponent createVerticalButtonBar(java.awt.Component... buttons)
Create a vertical button bar.- Parameters:
buttons
- the buttons to add to the button bar- Returns:
- the button bar
-
createVerticalButtonBar
public static javax.swing.JComponent createVerticalButtonBar(java.util.List<? extends java.awt.Component> components)
Create a vertical button bar.- Parameters:
components
- the components to add to the button bar- Returns:
- the button bar
-
alignRight
public ButtonBarFactory alignRight()
Make the button bar right aligned.- Returns:
- this factory
-
vertical
public ButtonBarFactory vertical()
-
border
public ButtonBarFactory border(int top, int... borders)
Set an empty border on the button bar. If onlytop
is specified then it is used for all edges. Ifbottom
is not specified then the value fortop
is used. Ifright
is not specified then the value forleft
(ortop
) is used.- Parameters:
top
- the top border widthborders
- theleft
,bottom
, andright
border widths- Returns:
- this factory
-
add
public ButtonBarFactory add(javax.swing.Action... actions)
-
addActions
public ButtonBarFactory addActions(java.util.Collection<? extends javax.swing.Action> actions)
-
add
public ButtonBarFactory add(java.awt.Component... buttons)
-
addButtons
public ButtonBarFactory addButtons(java.util.Collection<? extends java.awt.Component> buttons)
-
get
public javax.swing.JComponent get()
-
-