Class ButtonBarFactory
java.lang.Object
com.jgoodies.forms.factories.ButtonBarFactory
A factory class that consists only of static methods to build frequently used
button bars. Utilizes the
ButtonBarBuilder2
that in turn uses the FormLayout
to lay out the bars.The button bars returned by this builder comply with popular UI style guides.
- Version:
- $Revision: 1.8 $
- Author:
- Karsten Lentzsch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic JPanelbuildAddRemoveBar(JButton add, JButton remove) Builds and returns a filled button bar with Add and Remove.static JPanelbuildAddRemoveLeftBar(JButton add, JButton remove) Builds and returns a left aligned button bar with Add and Remove.static JPanelbuildAddRemovePropertiesBar(JButton add, JButton remove, JButton properties) Builds and returns a filled button bar with Add, Remove, and Properties.static JPanelbuildAddRemovePropertiesLeftBar(JButton add, JButton remove, JButton properties) Builds and returns a left aligned button bar with Add, Remove, and Properties.static JPanelbuildAddRemovePropertiesRightBar(JButton add, JButton remove, JButton properties) Builds and returns a right aligned button bar with Add, Remove, and Properties.static JPanelbuildAddRemoveRightBar(JButton add, JButton remove) Builds and returns a right aligned button bar with Add and Remove.static JPanelbuildCenteredBar(JButton button1) Builds and returns a centered bar with one button.static JPanelbuildCenteredBar(JButton[] buttons) Builds and returns a centered button bar with the given buttons.static JPanelbuildCenteredBar(JButton button1, JButton button2) Builds and returns a centered bar with two buttons.static JPanelbuildCenteredBar(JButton button1, JButton button2, JButton button3) Builds and returns a centered bar with three buttons.static JPanelbuildCenteredBar(JButton button1, JButton button2, JButton button3, JButton button4) Builds and returns a centered bar with four buttons.static JPanelbuildCenteredBar(JButton button1, JButton button2, JButton button3, JButton button4, JButton button5) Builds and returns a centered bar with five buttons.static JPanelbuildCloseBar(JButton close) Builds and returns a button bar with Close.static JPanelbuildCloseHelpBar(JButton close, JButton help) Builds and returns a button bar with Close and Help.static JPanelbuildGrowingBar(JButton button1) Builds and returns a filled bar with one button.static JPanelbuildGrowingBar(JButton[] buttons) Builds and returns a button bar with the given buttons.static JPanelbuildGrowingBar(JButton button1, JButton button2) Builds and returns a filled button bar with two buttons.static JPanelbuildGrowingBar(JButton button1, JButton button2, JButton button3) Builds and returns a filled bar with three buttons.static JPanelbuildGrowingBar(JButton button1, JButton button2, JButton button3, JButton button4) Builds and returns a filled bar with four buttons.static JPanelbuildGrowingBar(JButton button1, JButton button2, JButton button3, JButton button4, JButton button5) Builds and returns a filled bar with five buttons.static JPanelbuildHelpBar(JButton help, JButton button1) Builds and returns a right aligned bar with help and one button.static JPanelbuildHelpBar(JButton help, JButton[] buttons) Builds and returns a right aligned bar with help and other buttons.static JPanelbuildHelpBar(JButton help, JButton button1, JButton button2) Builds and returns a right aligned bar with help and two buttons.static JPanelbuildHelpBar(JButton help, JButton button1, JButton button2, JButton button3) Builds and returns a right aligned bar with help and three buttons.static JPanelBuilds and returns a right aligned bar with help and four buttons.static JPanelbuildHelpCloseBar(JButton help, JButton close) Builds and returns a button bar with Help and Close.static JPanelbuildHelpOKBar(JButton help, JButton ok) Builds and returns a button bar with Help and OK.static JPanelbuildHelpOKCancelApplyBar(JButton help, JButton ok, JButton cancel, JButton apply) Builds and returns a button bar with Help, OK, Cancel and Apply.static JPanelbuildHelpOKCancelBar(JButton help, JButton ok, JButton cancel) Builds and returns a button bar with Help, OK and Cancel.static JPanelbuildLeftAlignedBar(JButton button1) Builds and returns a left aligned bar with one button.static JPanelbuildLeftAlignedBar(JButton[] buttons) Builds and returns a left aligned button bar with the given buttons.static JPanelbuildLeftAlignedBar(JButton[] buttons, boolean leftToRightButtonOrder) Builds and returns a left aligned button bar with the given buttons.static JPanelbuildLeftAlignedBar(JButton button1, JButton button2) Builds and returns a left aligned bar with two buttons.static JPanelbuildLeftAlignedBar(JButton button1, JButton button2, JButton button3) Builds and returns a left aligned bar with three buttons.static JPanelbuildLeftAlignedBar(JButton button1, JButton button2, JButton button3, JButton button4) Builds and returns a left aligned bar with four buttons.static JPanelbuildLeftAlignedBar(JButton button1, JButton button2, JButton button3, JButton button4, JButton button5) Builds and returns a left aligned bar with five buttons.static JPanelbuildOKBar(JButton ok) Builds and returns a button bar with OK.static JPanelbuildOKCancelApplyBar(JButton ok, JButton cancel, JButton apply) Builds and returns a button bar with OK, Cancel and Apply.static JPanelbuildOKCancelApplyHelpBar(JButton ok, JButton cancel, JButton apply, JButton help) Builds and returns a button bar with OK, Cancel, Apply and Help.static JPanelbuildOKCancelBar(JButton ok, JButton cancel) Builds and returns a button bar with OK and Cancel.static JPanelbuildOKCancelHelpBar(JButton ok, JButton cancel, JButton help) Builds and returns a button bar with OK, Cancel, and Help.static JPanelbuildOKHelpBar(JButton ok, JButton help) Builds and returns a button bar with OK and Help.static JPanelbuildRightAlignedBar(JButton button1) Builds and returns a right aligned bar with one button.static JPanelbuildRightAlignedBar(JButton[] buttons) Builds and returns a right aligned button bar with the given buttons.static JPanelbuildRightAlignedBar(JButton[] buttons, boolean leftToRightButtonOrder) Builds and returns a right aligned button bar with the given buttons.static JPanelbuildRightAlignedBar(JButton button1, JButton button2) Builds and returns a right aligned bar with two buttons.static JPanelbuildRightAlignedBar(JButton button1, JButton button2, JButton button3) Builds and returns a right aligned bar with three buttons.static JPanelbuildRightAlignedBar(JButton button1, JButton button2, JButton button3, JButton button4) Builds and returns a right aligned bar with four buttons.static JPanelbuildRightAlignedBar(JButton button1, JButton button2, JButton button3, JButton button4, JButton button5) Builds and returns a right aligned bar with five buttons.static JPanelbuildWizardBar(JButton[] leftAlignedButtons, JButton back, JButton next, JButton[] rightAlignedButtons) Builds and returns a wizard button bar.static JPanelbuildWizardBar(JButton[] leftAlignedButtons, JButton back, JButton next, JButton overlaidFinish, JButton[] rightAlignedButtons) Builds and returns a wizard button bar.static JPanelbuildWizardBar(JButton back, JButton next, JButton[] rightAlignedButtons) Builds and returns a wizard button bar that consists of the back and next buttons, and some right aligned buttons.static JPanelbuildWizardBar(JButton back, JButton next, JButton finish, JButton cancel) Builds and returns a wizard button bar with: Back, Next, Finish, Cancel.static JPanelBuilds and returns a wizard button bar with: Help and Back, Next, Finish, Cancel.
-
Method Details
-
buildLeftAlignedBar
-
buildLeftAlignedBar
-
buildLeftAlignedBar
Builds and returns a left aligned bar with three buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to add- Returns:
- a button bar with the given buttons
-
buildLeftAlignedBar
public static JPanel buildLeftAlignedBar(JButton button1, JButton button2, JButton button3, JButton button4) Builds and returns a left aligned bar with four buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to addbutton4- the fourth button to add- Returns:
- a button bar with the given buttons
-
buildLeftAlignedBar
public static JPanel buildLeftAlignedBar(JButton button1, JButton button2, JButton button3, JButton button4, JButton button5) Builds and returns a left aligned bar with five buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to addbutton4- the fourth button to addbutton5- the fifth button to add- Returns:
- a button bar with the given buttons
-
buildLeftAlignedBar
-
buildLeftAlignedBar
Builds and returns a left aligned button bar with the given buttons.- Parameters:
buttons- an array of buttons to addleftToRightButtonOrder- the order in which the buttons to add- Returns:
- a left aligned button bar with the given buttons
-
buildCenteredBar
-
buildCenteredBar
-
buildCenteredBar
Builds and returns a centered bar with three buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to add- Returns:
- a button bar with the given buttons
-
buildCenteredBar
public static JPanel buildCenteredBar(JButton button1, JButton button2, JButton button3, JButton button4) Builds and returns a centered bar with four buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to addbutton4- the fourth button to add- Returns:
- a button bar with the given buttons
-
buildCenteredBar
public static JPanel buildCenteredBar(JButton button1, JButton button2, JButton button3, JButton button4, JButton button5) Builds and returns a centered bar with five buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to addbutton4- the fourth button to addbutton5- the fifth button to add- Returns:
- a button bar with the given buttons
-
buildCenteredBar
-
buildGrowingBar
-
buildGrowingBar
-
buildGrowingBar
-
buildGrowingBar
public static JPanel buildGrowingBar(JButton button1, JButton button2, JButton button3, JButton button4) Builds and returns a filled bar with four buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to addbutton4- the fourth button to add- Returns:
- a button bar with the given buttons
-
buildGrowingBar
public static JPanel buildGrowingBar(JButton button1, JButton button2, JButton button3, JButton button4, JButton button5) Builds and returns a filled bar with five buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to addbutton4- the fourth button to addbutton5- the fifth button to add- Returns:
- a button bar with the given buttons
-
buildGrowingBar
-
buildRightAlignedBar
-
buildRightAlignedBar
-
buildRightAlignedBar
Builds and returns a right aligned bar with three buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to add- Returns:
- a button bar with the given buttons
-
buildRightAlignedBar
public static JPanel buildRightAlignedBar(JButton button1, JButton button2, JButton button3, JButton button4) Builds and returns a right aligned bar with four buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to addbutton4- the fourth button to add- Returns:
- a button bar with the given buttons
-
buildRightAlignedBar
public static JPanel buildRightAlignedBar(JButton button1, JButton button2, JButton button3, JButton button4, JButton button5) Builds and returns a right aligned bar with five buttons.- Parameters:
button1- the first button to addbutton2- the second button to addbutton3- the third button to addbutton4- the fourth button to addbutton5- the fifth button to add- Returns:
- a button bar with the given buttons
-
buildRightAlignedBar
-
buildRightAlignedBar
Builds and returns a right aligned button bar with the given buttons.- Parameters:
buttons- an array of buttons to addleftToRightButtonOrder- the order in which the buttons to add- Returns:
- a right aligned button bar with the given buttons
-
buildHelpBar
-
buildHelpBar
Builds and returns a right aligned bar with help and two buttons.- Parameters:
help- the help button to add on the left sidebutton1- the first button to addbutton2- the second button to add- Returns:
- a button bar with the given buttons
-
buildHelpBar
Builds and returns a right aligned bar with help and three buttons.- Parameters:
help- the help button to add on the left sidebutton1- the first button to addbutton2- the second button to addbutton3- the third button to add- Returns:
- a button bar with the given buttons
-
buildHelpBar
public static JPanel buildHelpBar(JButton help, JButton button1, JButton button2, JButton button3, JButton button4) Builds and returns a right aligned bar with help and four buttons.- Parameters:
help- the help button to add on the left sidebutton1- the first button to addbutton2- the second button to addbutton3- the third button to addbutton4- the fourth button to add- Returns:
- a button bar with the given buttons
-
buildHelpBar
-
buildCloseBar
-
buildOKBar
-
buildOKCancelBar
-
buildOKCancelApplyBar
-
buildHelpCloseBar
-
buildHelpOKBar
-
buildHelpOKCancelBar
-
buildHelpOKCancelApplyBar
public static JPanel buildHelpOKCancelApplyBar(JButton help, JButton ok, JButton cancel, JButton apply) Builds and returns a button bar with Help, OK, Cancel and Apply.- Parameters:
help- the Help buttonok- the OK buttoncancel- the Cancel buttonapply- the Apply button- Returns:
- a panel that contains the button(s)
-
buildCloseHelpBar
-
buildOKHelpBar
-
buildOKCancelHelpBar
-
buildOKCancelApplyHelpBar
public static JPanel buildOKCancelApplyHelpBar(JButton ok, JButton cancel, JButton apply, JButton help) Builds and returns a button bar with OK, Cancel, Apply and Help.- Parameters:
ok- the OK buttoncancel- the Cancel buttonapply- the Apply buttonhelp- the Help button- Returns:
- a panel that contains the button(s)
-
buildAddRemoveLeftBar
-
buildAddRemoveBar
-
buildAddRemoveRightBar
-
buildAddRemovePropertiesLeftBar
public static JPanel buildAddRemovePropertiesLeftBar(JButton add, JButton remove, JButton properties) Builds and returns a left aligned button bar with Add, Remove, and Properties.- Parameters:
add- the Add buttonremove- the Remove buttonproperties- the Properties button- Returns:
- a panel that contains the button(s)
-
buildAddRemovePropertiesBar
Builds and returns a filled button bar with Add, Remove, and Properties.- Parameters:
add- the Add buttonremove- the Remove buttonproperties- the Properties button- Returns:
- a panel that contains the button(s)
-
buildAddRemovePropertiesRightBar
public static JPanel buildAddRemovePropertiesRightBar(JButton add, JButton remove, JButton properties) Builds and returns a right aligned button bar with Add, Remove, and Properties.- Parameters:
add- the Add buttonremove- the Remove buttonproperties- the Properties button- Returns:
- a panel that contains the button(s)
-
buildWizardBar
Builds and returns a wizard button bar with: Back, Next, Finish, Cancel.- Parameters:
back- the Back buttonnext- the Next buttonfinish- the Finish buttoncancel- the Cancel button- Returns:
- a wizard button bar for back, next, finish, cancel
-
buildWizardBar
public static JPanel buildWizardBar(JButton help, JButton back, JButton next, JButton finish, JButton cancel) Builds and returns a wizard button bar with: Help and Back, Next, Finish, Cancel.- Parameters:
help- the Help buttonback- the Back buttonnext- the Next buttonfinish- the Finish buttoncancel- the Cancel button- Returns:
- a wizard button bar for help, back, next, finish, cancel
-
buildWizardBar
Builds and returns a wizard button bar that consists of the back and next buttons, and some right aligned buttons.- Parameters:
back- the mandatory back buttonnext- the mandatory next buttonrightAlignedButtons- an optional array of buttons that will be located in the bar's right hand side- Returns:
- a wizard button bar with back, next and a bunch of buttons
-
buildWizardBar
public static JPanel buildWizardBar(JButton[] leftAlignedButtons, JButton back, JButton next, JButton[] rightAlignedButtons) Builds and returns a wizard button bar. It consists of some left aligned buttons, the back and next buttons, and some right aligned buttons.- Parameters:
leftAlignedButtons- an optional array of buttons that will be positioned in the bar's left hand sideback- the mandatory back buttonnext- the mandatory next buttonrightAlignedButtons- an optional array of buttons that will be located in the bar's right hand side- Returns:
- a wizard button bar with back, next and a bunch of buttons
-
buildWizardBar
public static JPanel buildWizardBar(JButton[] leftAlignedButtons, JButton back, JButton next, JButton overlaidFinish, JButton[] rightAlignedButtons) Builds and returns a wizard button bar. It consists of some left aligned buttons, the back, next group, and some right aligned buttons. To allow the finish button to overlay the next button, you can optionally provide theoverlayedFinishparameter.- Parameters:
leftAlignedButtons- an optional array of buttons that will be positioned in the bar's left hand sideback- the mandatory back buttonnext- the mandatory next buttonoverlaidFinish- the optional overlaid finish buttonrightAlignedButtons- an optional array of buttons that will be located in the bar's right hand side- Returns:
- a wizard button bar with back, next and a bunch of buttons
-