com.jaxfront.swing.ui.tools
Class FormLayoutBuilder

java.lang.Object
  extended by com.jaxfront.swing.ui.tools.FormLayoutBuilder
All Implemented Interfaces:
ListVisualizer, Visualizer

public class FormLayoutBuilder
extends java.lang.Object
implements ListVisualizer


Constructor Summary
FormLayoutBuilder()
           
 
Method Summary
 void addTab(Type type)
           
static javax.swing.JComponent addTableCell(java.awt.Container container, Type model, Type context, TableCell cell, javax.swing.JPanel tablePanel, javax.swing.JComponent editingType)
           
static void addXPathLabelToVisualizer(javax.swing.JComponent labelComp, Type cellRefType, Type context)
           
static void applyFocus(java.awt.Container container, javax.swing.JComponent focusComponent, TableCell focusCell)
           
static javax.swing.JPanel applyTableLayout(java.awt.Container container, Type model, Type context, FormLayoutInfo layout, javax.swing.JPanel aComponentHolderPanel)
           
static javax.swing.JButton createButton(Type model, java.lang.String buttonName, java.lang.String actionClassString, java.lang.String commandName)
          Creates a new button with the given name and with the given action class.
static javax.swing.JButton createButton(Type model, java.lang.String buttonName, java.lang.String actionClassString, java.lang.String commandName, java.lang.String ruleId)
          Creates a new button with the given name and with the given action class.
static java.awt.event.ActionListener getAction(Type model, java.lang.Class actionClass)
          Returns the action listener for a given action class name.
static java.awt.event.ActionListener getAction(Type model, java.lang.Class actionClass, java.lang.String commandName)
          Returns the action listener for a given action class name.
 Type getContext()
           
 JAXDataTable getDataTable()
          Returns internal tabel representation.
 javax.swing.JDialog getEditDialog(Type selectedType)
          Returns the edit dialog for a given type.
 Visualizer getImplementation()
           
 java.lang.String getLabelText()
          Returns the label of this visualizer.
 ListType getListModel()
           
 Type getModel()
          Returns the model (type) of this visualizer.
 Type getSelectedType()
          Gets the selected type of the underlying list type.
 boolean isViewReleased()
           
 void jumpTo()
          Bring this visualizer to front and set the focus.
 void markError()
          Displays the error in a special way.
 void populateModel()
          Updates the model (type) that belongs to this visualizer.
 void populateView()
          Updates the view of this visualizer.
 void postInitialization()
          Gets called after the UI factory has created this visualizer.
 void release()
          Releases allocated resources for this visualizer.
 void removeLabel()
          Removes the label from the view.
 void removeTab(Type type)
           
 void resetError()
          Removes the error from this visualizer.
 void resetView()
           
 void selectType(Type type)
          Selects the requested type in the list.
 void selectType(Type type, boolean isUserAction)
          Selects the requested type in the list.
 void setApplicationRequired(boolean required)
          Sets the view component to be required or not defined by the application not by xml schema.
 void setEditable(boolean enabled)
          Sets the view component editable .
 void setEnabled(boolean enabled)
          Sets the view component enabled or disabled.
 void setLabelColor(java.awt.Color color)
          Sets the foreground color for the label.
 void setLabelText(java.lang.String text)
          Sets the label for this view
 void setModel(Type type)
          Sets the model (type) for this visualizer.
 void setRequired(boolean required)
          Sets the view component to be required or not.
 void setVisible(boolean visible)
          Sets the view component visible or not visible.
 void showLabel(boolean show)
          Sets the label of this visualizer visible or not visible.
 void showModel(Type type)
          Shows the visualizer for the passed type within my list.
 void showUpDownButtons(boolean showUpDownButtons)
          Sets the visibility of the up/down buttons for a list view.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormLayoutBuilder

public FormLayoutBuilder()
Method Detail

applyTableLayout

public static javax.swing.JPanel applyTableLayout(java.awt.Container container,
                                                  Type model,
                                                  Type context,
                                                  FormLayoutInfo layout,
                                                  javax.swing.JPanel aComponentHolderPanel)

addXPathLabelToVisualizer

public static void addXPathLabelToVisualizer(javax.swing.JComponent labelComp,
                                             Type cellRefType,
                                             Type context)

addTableCell

public static javax.swing.JComponent addTableCell(java.awt.Container container,
                                                  Type model,
                                                  Type context,
                                                  TableCell cell,
                                                  javax.swing.JPanel tablePanel,
                                                  javax.swing.JComponent editingType)

applyFocus

public static void applyFocus(java.awt.Container container,
                              javax.swing.JComponent focusComponent,
                              TableCell focusCell)

createButton

public static javax.swing.JButton createButton(Type model,
                                               java.lang.String buttonName,
                                               java.lang.String actionClassString,
                                               java.lang.String commandName)
Creates a new button with the given name and with the given action class.

Parameters:
buttonName - a name for the new button
actionClassString - the name of the action class for the new button
Returns:
JButton the new button

createButton

public static javax.swing.JButton createButton(Type model,
                                               java.lang.String buttonName,
                                               java.lang.String actionClassString,
                                               java.lang.String commandName,
                                               java.lang.String ruleId)
Creates a new button with the given name and with the given action class.

Parameters:
buttonName - a name for the new button
actionClassString - the name of the action class for the new button
Returns:
JButton the new button

getAction

public static java.awt.event.ActionListener getAction(Type model,
                                                      java.lang.Class actionClass)
Returns the action listener for a given action class name.

Parameters:
actionClass - an action class name
Returns:
ActionListener the required action listener

getAction

public static java.awt.event.ActionListener getAction(Type model,
                                                      java.lang.Class actionClass,
                                                      java.lang.String commandName)
Returns the action listener for a given action class name.

Parameters:
actionClass - an action class name
Returns:
ActionListener the required action listener

addTab

public void addTab(Type type)
Specified by:
addTab in interface ListVisualizer

getDataTable

public JAXDataTable getDataTable()
Description copied from interface: ListVisualizer
Returns internal tabel representation.

Specified by:
getDataTable in interface ListVisualizer

getEditDialog

public javax.swing.JDialog getEditDialog(Type selectedType)
Description copied from interface: ListVisualizer
Returns the edit dialog for a given type.

Specified by:
getEditDialog in interface ListVisualizer
Parameters:
selectedType - a given type
Returns:
JDialog the dialog for a type

getSelectedType

public Type getSelectedType()
Description copied from interface: ListVisualizer
Gets the selected type of the underlying list type.

Specified by:
getSelectedType in interface ListVisualizer
Returns:
the selected type of the list

removeTab

public void removeTab(Type type)
Specified by:
removeTab in interface ListVisualizer

resetView

public void resetView()
Specified by:
resetView in interface ListVisualizer

selectType

public void selectType(Type type)
Description copied from interface: ListVisualizer
Selects the requested type in the list.

Specified by:
selectType in interface ListVisualizer

showModel

public void showModel(Type type)
Description copied from interface: ListVisualizer
Shows the visualizer for the passed type within my list.

Specified by:
showModel in interface ListVisualizer
Parameters:
type - to visualize

showUpDownButtons

public void showUpDownButtons(boolean showUpDownButtons)
Description copied from interface: ListVisualizer
Sets the visibility of the up/down buttons for a list view.

Specified by:
showUpDownButtons in interface ListVisualizer
Parameters:
showUpDownButtons - true if the buttons should be shown

getContext

public Type getContext()
Specified by:
getContext in interface Visualizer

getImplementation

public Visualizer getImplementation()
Specified by:
getImplementation in interface Visualizer

getLabelText

public java.lang.String getLabelText()
Description copied from interface: Visualizer
Returns the label of this visualizer.

Specified by:
getLabelText in interface Visualizer

getModel

public Type getModel()
Description copied from interface: Visualizer
Returns the model (type) of this visualizer.

Specified by:
getModel in interface Visualizer

jumpTo

public void jumpTo()
Description copied from interface: Visualizer
Bring this visualizer to front and set the focus.

Specified by:
jumpTo in interface Visualizer

markError

public void markError()
Description copied from interface: Visualizer
Displays the error in a special way. For example: a red border around the visualized component.

Specified by:
markError in interface Visualizer

populateModel

public void populateModel()
Description copied from interface: Visualizer
Updates the model (type) that belongs to this visualizer.

Specified by:
populateModel in interface Visualizer

populateView

public void populateView()
Description copied from interface: Visualizer
Updates the view of this visualizer.

Specified by:
populateView in interface Visualizer

postInitialization

public void postInitialization()
Description copied from interface: Visualizer
Gets called after the UI factory has created this visualizer. Do whatever you want here.

Specified by:
postInitialization in interface Visualizer

release

public void release()
Description copied from interface: Visualizer
Releases allocated resources for this visualizer.

Specified by:
release in interface Visualizer

removeLabel

public void removeLabel()
Description copied from interface: Visualizer
Removes the label from the view.

Specified by:
removeLabel in interface Visualizer

resetError

public void resetError()
Description copied from interface: Visualizer
Removes the error from this visualizer.

Specified by:
resetError in interface Visualizer

setApplicationRequired

public void setApplicationRequired(boolean required)
Description copied from interface: Visualizer
Sets the view component to be required or not defined by the application not by xml schema.

Specified by:
setApplicationRequired in interface Visualizer
Parameters:
required - indicates if a visualizer required user input

setEditable

public void setEditable(boolean enabled)
Description copied from interface: Visualizer
Sets the view component editable .

Specified by:
setEditable in interface Visualizer
Parameters:
enabled - enable/disable this visualizer

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: Visualizer
Sets the view component enabled or disabled.

Specified by:
setEnabled in interface Visualizer
Parameters:
enabled - enable/disable this visualizer

setLabelColor

public void setLabelColor(java.awt.Color color)
Description copied from interface: Visualizer
Sets the foreground color for the label.

Specified by:
setLabelColor in interface Visualizer
Parameters:
color - label foreground color

setLabelText

public void setLabelText(java.lang.String text)
Description copied from interface: Visualizer
Sets the label for this view

Specified by:
setLabelText in interface Visualizer

setModel

public void setModel(Type type)
Description copied from interface: Visualizer
Sets the model (type) for this visualizer.

Specified by:
setModel in interface Visualizer
Parameters:
type - model for the visualizer

setRequired

public void setRequired(boolean required)
Description copied from interface: Visualizer
Sets the view component to be required or not. For example: the background of the view component may change its color.

Specified by:
setRequired in interface Visualizer
Parameters:
required - indicates if a visualizer requires user input

setVisible

public void setVisible(boolean visible)
Description copied from interface: Visualizer
Sets the view component visible or not visible.

Specified by:
setVisible in interface Visualizer
Parameters:
visible - visibility of the visualizer

showLabel

public void showLabel(boolean show)
Description copied from interface: Visualizer
Sets the label of this visualizer visible or not visible.

Specified by:
showLabel in interface Visualizer
Parameters:
show - visibility of the label

getListModel

public ListType getListModel()
Specified by:
getListModel in interface ListVisualizer

isViewReleased

public boolean isViewReleased()
Specified by:
isViewReleased in interface Visualizer

selectType

public void selectType(Type type,
                       boolean isUserAction)
Description copied from interface: ListVisualizer
Selects the requested type in the list.

Specified by:
selectType in interface ListVisualizer