com.sapportals.htmlb

Class FormLayout

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.Container
          extended bycom.sapportals.htmlb.FormLayout

public class FormLayout
extends Container

Title: FormLayout Description: FormLayout defines a layout component to design forms

Copyright 2004 SAP AG


Field Summary
static int FORMLAYOUT_BEGIN
           
static int FORMLAYOUT_CELL_BEGIN
           
static int FORMLAYOUT_CELL_CONTENT
           
static int FORMLAYOUT_CELL_END
           
static int FORMLAYOUT_END
           
static int FORMLAYOUT_ROW_BEGIN
           
static int FORMLAYOUT_ROW_END
           
static String UI_ID
           
 
Fields inherited from class com.sapportals.htmlb.Container
elements
 
Constructor Summary
FormLayout()
           
 
Method Summary
 FormLayoutCell addComponent(int row, int cell, Component component)
          add the component to the specific cell.
 FormLayoutRow addRow()
          adds a new row to this FormLayout.
 FormLayoutRow addRow(Component[] components)
          creates a new row and adds a cell for each component that is passes.
 int getChildCount()
          get the number of children of this container
 int getColumnCount()
           
 int getCurrentColumnIndex()
          INTERNAL USE ONLY.
 int getCurrentRowIndex()
          INTERNAL USE ONLY.
 String getMarginBottom()
           
 String getMarginLeft()
           
 String getMarginRight()
           
 String getMarginTop()
           
 FormLayoutRow getRow(int index)
          gets the nth row of the FormLayout.
 int getRowCount()
           
 Object[] getRows()
           
 String getUI()
          get a identification String for the renderer that is unique across all supported components.
 String getWidth()
           
 boolean isDebugMode()
           
 Iterator iterator()
          get an Iterator of the children
 boolean requiresForm()
          check if a special component really requires a form around it.
 void setColumnCount(int columnCount)
           
 void setCurrentColumnIndex(int currentColumnIndex)
          INTERNAL USE ONLY.
 void setCurrentRowIndex(int currentRowIndex)
          INTERNAL USE ONLY.
 void setDebugMode(boolean debugMode)
           
 void setMargin(String marginTop, String marginRight, String marginBottom, String marginLeft)
           
 void setMarginBottom(String marginBottom)
          sets the bottom margin for the form layout.
 void setMarginLeft(String marginLeft)
          sets the left margin for the form layout.
 void setMarginRight(String marginRight)
          sets the right margin for the form layout.
 void setMarginTop(String marginTop)
          sets the top margin for the form layout.
 void setWidth(String width)
           
 
Methods inherited from class com.sapportals.htmlb.Container
addComponent, addRawText, addText, preRender, removeComponent, render
 
Methods inherited from class com.sapportals.htmlb.Component
getEncodedIdForForm, getId, getParent, initFromPageContext, initFromShortId, initializeFromId, isJsObjectNeeded, render, renderAsString, setId, setJsObjectNeeded, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_ID

public static final String UI_ID
See Also:
Constant Field Values

FORMLAYOUT_BEGIN

public static final int FORMLAYOUT_BEGIN
See Also:
Constant Field Values

FORMLAYOUT_ROW_BEGIN

public static final int FORMLAYOUT_ROW_BEGIN
See Also:
Constant Field Values

FORMLAYOUT_CELL_BEGIN

public static final int FORMLAYOUT_CELL_BEGIN
See Also:
Constant Field Values

FORMLAYOUT_CELL_CONTENT

public static final int FORMLAYOUT_CELL_CONTENT
See Also:
Constant Field Values

FORMLAYOUT_CELL_END

public static final int FORMLAYOUT_CELL_END
See Also:
Constant Field Values

FORMLAYOUT_ROW_END

public static final int FORMLAYOUT_ROW_END
See Also:
Constant Field Values

FORMLAYOUT_END

public static final int FORMLAYOUT_END
See Also:
Constant Field Values
Constructor Detail

FormLayout

public FormLayout()
Method Detail

getColumnCount

public int getColumnCount()

setColumnCount

public void setColumnCount(int columnCount)

getRowCount

public int getRowCount()

addRow

public FormLayoutRow addRow()
adds a new row to this FormLayout. Application developers can then add cells to the FormLayoutRow

Returns:
the newly added FormLayoutRow

addRow

public FormLayoutRow addRow(Component[] components)
creates a new row and adds a cell for each component that is passes.

Parameters:
components - the components to be added to the new row
Returns:
the newly added row.

addComponent

public FormLayoutCell addComponent(int row,
                                   int cell,
                                   Component component)
add the component to the specific cell. This will create additional rows and cells if necessary. Indices for row and cell are 1 based.

Parameters:
row - the row where the component will be added
cell - the cell where the component will be added
component -
Returns:

getMarginTop

public String getMarginTop()

getMarginRight

public String getMarginRight()

getMarginBottom

public String getMarginBottom()

getMarginLeft

public String getMarginLeft()

setMarginTop

public void setMarginTop(String marginTop)
sets the top margin for the form layout. The value must conform to HTML syntax, e.g. "5px"

Parameters:
marginTop -

setMarginRight

public void setMarginRight(String marginRight)
sets the right margin for the form layout. The value must conform to HTML syntax, e.g. "5px"

Parameters:
marginRight -

setMarginBottom

public void setMarginBottom(String marginBottom)
sets the bottom margin for the form layout. The value must conform to HTML syntax, e.g. "5px"

Parameters:
marginBottom -

setMarginLeft

public void setMarginLeft(String marginLeft)
sets the left margin for the form layout. The value must conform to HTML syntax, e.g. "5px"

Parameters:
marginLeft -

setMargin

public void setMargin(String marginTop,
                      String marginRight,
                      String marginBottom,
                      String marginLeft)

getRows

public Object[] getRows()

getRow

public FormLayoutRow getRow(int index)
gets the nth row of the FormLayout. Note that the index is 1 based.

Parameters:
index - an index in the range [1 .. getRowCount()]
Returns:
the row or null if no such row exists.

getWidth

public String getWidth()

setWidth

public void setWidth(String width)

isDebugMode

public boolean isDebugMode()

setDebugMode

public void setDebugMode(boolean debugMode)

getUI

public String getUI()
Description copied from class: Component
get a identification String for the renderer that is unique across all supported components. E.g. you could simply return the class name of the component class. The reason for using a separate method and not some internal reflection method is that you can more easily extend the functionality or your Component class without having to rewrite the view class.

Specified by:
getUI in class Component
Returns:
a unique identification string for this Component

requiresForm

public boolean requiresForm()
Description copied from class: Component
check if a special component really requires a form around it. Subclasses should override this if they do not require a form.

Basically, any Component that is capable of firing a server side event or that contains user input must be placed in a form.

Overrides:
requiresForm in class Component
Returns:
true if the component must be placed in a form.

iterator

public Iterator iterator()
get an Iterator of the children

Overrides:
iterator in class Container
Returns:
an Iterator of the children

getChildCount

public int getChildCount()
get the number of children of this container

Overrides:
getChildCount in class Container
Returns:
the number of children

getCurrentRowIndex

public int getCurrentRowIndex()
INTERNAL USE ONLY. APPLICATION DEVELOPERS MUST NOT USE THIS METHOD. returns the current row index Used by the rendering classes during rendering


setCurrentRowIndex

public void setCurrentRowIndex(int currentRowIndex)
INTERNAL USE ONLY. APPLICATION DEVELOPERS MUST NOT USE THIS METHOD. returns the current row index Used by the rendering classes during rendering


getCurrentColumnIndex

public int getCurrentColumnIndex()
INTERNAL USE ONLY. APPLICATION DEVELOPERS MUST NOT USE THIS METHOD. returns the current row index Used by the rendering classes during rendering


setCurrentColumnIndex

public void setCurrentColumnIndex(int currentColumnIndex)
INTERNAL USE ONLY. APPLICATION DEVELOPERS MUST NOT USE THIS METHOD. returns the current row index Used by the rendering classes during rendering



Copyright 2006 SAP AG Complete Copyright Notice