Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.javatools.ui.layout
Class FieldLayoutBuilder

java.lang.Object
  extended by oracle.javatools.ui.layout.FieldLayoutBuilder

public final class FieldLayoutBuilder
extends java.lang.Object

A fluent-interface based API for manipulating panels with a simple layout.

Example:

  JPanel p = new JPanel();
  FieldLayoutBuilder b = new FieldLayoutBuilder( p );

  b.add( field().
    label( new JLabel() ).withText( "User &name:" ).
    component( new JTextField() ).
    button( new JButton() ).withText( "&Browse..." ) );

  b.add( field().
    component( new JCheckBox() ).withCaption( "Remember pas&sword" ).
    addToContainer().

  b.addVerticalSpring();

 


Nested Class Summary
static class FieldLayoutBuilder.ButtonSetup
           
static class FieldLayoutBuilder.ButtonTextSetup
           
static class FieldLayoutBuilder.ComponentSetup
           
static class FieldLayoutBuilder.ComponentTextSetup
           
static class FieldLayoutBuilder.ComponentTextSetupWithButton
           
static class FieldLayoutBuilder.FieldSetup
           
static class FieldLayoutBuilder.HeaderSetup
           
static class FieldLayoutBuilder.LabelSetup
           
static class FieldLayoutBuilder.LabelTextSetup
           
 
Constructor Summary
FieldLayoutBuilder(java.awt.Container container)
          Creates a new FieldLayoutBuilder that will add components to the specified container.
 
Method Summary
 void add(FieldLayoutBuilder.ComponentTextSetup c)
           
 void add(FieldLayoutBuilder.FieldSetup f)
           
 void addHintText(java.lang.String text)
           
 void addRow(java.awt.Component c)
           
 void addVerticalField(javax.swing.JLabel label, java.awt.Component c)
           
 void addVerticalField(javax.swing.JLabel label, java.awt.Component c, float componentVerticalWeight)
           
 void addVerticalField(java.lang.String labelText, java.awt.Component c)
           
 void addVerticalField(java.lang.String labelText, java.awt.Component c, float componentVerticalWeight)
           
 void addVerticalGap()
           
 void addVerticalSpring()
           
 FieldLayoutBuilder.LabelSetup field()
           
 FieldLayoutBuilder.HeaderSetup headerField()
           
 FieldLayoutBuilder.LabelSetup indentedField()
           
 void setAlignLabelsLeft(boolean alignLabelsLeft)
          Sets whether to align labels to the left.
 void setMinimumWidth(int width)
           
 void setStretchComponentsWithNoButton(boolean stretchComponents)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldLayoutBuilder

public FieldLayoutBuilder(java.awt.Container container)
Creates a new FieldLayoutBuilder that will add components to the specified container.

Parameters:
container - a container to add components to. Must not be null.
Method Detail

setAlignLabelsLeft

public void setAlignLabelsLeft(boolean alignLabelsLeft)
Sets whether to align labels to the left.

Parameters:
alignLabelsLeft -

setStretchComponentsWithNoButton

public void setStretchComponentsWithNoButton(boolean stretchComponents)

setMinimumWidth

public void setMinimumWidth(int width)

field

public FieldLayoutBuilder.LabelSetup field()

indentedField

public FieldLayoutBuilder.LabelSetup indentedField()

headerField

public FieldLayoutBuilder.HeaderSetup headerField()

add

public void add(FieldLayoutBuilder.ComponentTextSetup c)

add

public void add(FieldLayoutBuilder.FieldSetup f)

addVerticalGap

public void addVerticalGap()

addRow

public void addRow(java.awt.Component c)

addHintText

public void addHintText(java.lang.String text)

addVerticalField

public void addVerticalField(javax.swing.JLabel label,
                             java.awt.Component c)

addVerticalField

public void addVerticalField(javax.swing.JLabel label,
                             java.awt.Component c,
                             float componentVerticalWeight)

addVerticalField

public void addVerticalField(java.lang.String labelText,
                             java.awt.Component c)

addVerticalField

public void addVerticalField(java.lang.String labelText,
                             java.awt.Component c,
                             float componentVerticalWeight)

addVerticalSpring

public void addVerticalSpring()

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.