com.sibvisions.rad.ui.gwt.client
Class GWTFactory

java.lang.Object
  extended by com.sibvisions.rad.ui.gwt.client.GWTFactory

public class GWTFactory
extends Object

The GWTFactory creates GWT components by name and configures the relevant properties.


Constructor Summary
GWTFactory()
           
 
Method Summary
static void applyFormat(FormattedValue pValue, Field<Object> pField, int pAlignment)
          Applies the value format to a field.
static CellEditor createCellEditor(StyledCellEditor pEditor)
          Creates the cell editor for a cell editor definition.
 Component createComponent(String pComponentName, String pComponentId)
          Creates a component for the given name.
static Field<?> createField(StyledCellEditor pEditor)
          Creates a field for a cell editor definition.
 LayoutData getLayoutData(LayoutContainer pParent, String pConstraints)
          Gets the correct LayoutData for the given parent, component and constraints.
 void setProperty(Component pComponent, String pComponentName, String pPropertyName, Object pValue)
          Sets the value of a property from a specific component identified by the property name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GWTFactory

public GWTFactory()
Method Detail

createComponent

public Component createComponent(String pComponentName,
                                 String pComponentId)
Creates a component for the given name.

Parameters:
pComponentName - the component name
pComponentId - the id of the component
Returns:
the component
Throws:
IllegalArgumentException - if the component is unknown or not supported

setProperty

public void setProperty(Component pComponent,
                        String pComponentName,
                        String pPropertyName,
                        Object pValue)
Sets the value of a property from a specific component identified by the property name. Only supported property names will work.

Parameters:
pComponent - the component
pComponentName - the component name
pPropertyName - the property name
pValue - the value
Throws:
IllegalArgumentException - if the property is unknown or not supported

getLayoutData

public LayoutData getLayoutData(LayoutContainer pParent,
                                String pConstraints)
Gets the correct LayoutData for the given parent, component and constraints.

Parameters:
pParent - the parent.
pConstraints - the constraints.
Returns:
constraints.

applyFormat

public static void applyFormat(FormattedValue pValue,
                               Field<Object> pField,
                               int pAlignment)
Applies the value format to a field.

Parameters:
pValue - the formatted value
pField - the field
pAlignment - the field alignment

createField

public static Field<?> createField(StyledCellEditor pEditor)
Creates a field for a cell editor definition.

Parameters:
pEditor - the cell editor definition
Returns:
the field

createCellEditor

public static CellEditor createCellEditor(StyledCellEditor pEditor)
Creates the cell editor for a cell editor definition.

Parameters:
pEditor - the cell editor definition
Returns:
the cell editor


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.