Class ButtonBarBuilder


  • public final class ButtonBarBuilder
    extends AbstractButtonPanelBuilder<ButtonBarBuilder>
    Builds consistent button bars that comply with popular style guides. Utilizes the JGoodies FormLayout and honors the platform's LayoutStyle regarding button sizes, and gaps.

    Examples:

     // 1) Build and return a bar with three related buttons
     return ButtonBarBuilder.create()
         .addButton(newButton)
         .addRelatedGap()
         .addButton(editButton)
         .addRelatedGap()
         .addButton(deleteButton)
         .build();
    
     // 2) Short hand for example 1)
     return ButtonBarBuilder.create()
         .addButton(newButton, editButton, deleteButton)
         .build();
    
     // 3) Build and return a bar with two sections
     return ButtonBarBuilder.create()
         .addButton(newButton, editButton, deleteButton)
         .addUnrelatedGap()
         .addButton(moveUpButton, moveDownButton)
         .build();
    
     // 4) Short hand for example 3)
     return ButtonBarBuilder.create()
         .addButton(newButton, editButton, deleteButton,
                    null,
                    moveUpButton, moveDownButton)
         .build();
    
     // 5) Build and return a complex button bar
     return ButtonBarBuilder.create()
         .addButton(newButton, editButton, deleteButton)
         .addUnrelatedGap()
         .addButton(moveUpButton, moveDownButton)
         .addGlue()
         .addGrowing(legendComponent)
         .build();
     
    Since:
    1.6
    Version:
    $Revision: 1.18 $
    See Also:
    ButtonStackBuilder, LayoutStyle