LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.struts
Class LyStrutsRow

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.web.LyWebObject
          extended by leon.view.web.struts.LyStrutsRow
All Implemented Interfaces:
LyGraphicalComponent, LyGraphicalRow, LyViewComponent, LyFreeInterface, LySetColorInterface, LySetHiddenInterface, LySetImageInterface, LySetLabelInterface, LyWebComponent

public class LyStrutsRow
extends LyWebObject
implements LyGraphicalRow

This class implements the Row object (as described in the dtd) for struts viewer.

ROW: Row
A row of a list is a set of non-empty cells (or input fields). It is possible to indicate if the row is selected, if an image is assigned to it and if a tooltip is associated to it.

See Also:
LyRow

Field Summary
static java.lang.String __VERSION
           
static boolean USE_COLUMN_INDEX_FOR_DOUBLE_CLICK
          Indicates if column index must be sent to server for double-clicks
static boolean USE_CONTEXT_MENU
          Indicates if context menu must be used on row.
 
Fields inherited from class leon.view.web.LyWebObject
WEB_COMPONENT_ID, WEB_CONTROLLER_ID, WEB_SESSION_ID
 
Constructor Summary
LyStrutsRow(LyRow row)
          Class constructor of a Row object for the Struts target.
 
Method Summary
 void addComponent(LyComponent component, int pos)
          Inserts a sub-component components at given position.
 java.lang.String getAdditionalStyle()
          Computes an additional style for a row.
 java.lang.String getAlignment()
          Gets the alignment of the row.
 java.lang.String getBackgroundColorStyle()
          Gets the HTML CSS style piece of tag for the background color of the row.
 java.lang.String getCellEditionScript(LyWebPageWriter pw, int rowIndex, int columnIndex)
          Gets the Javascript code used when double-clicking on an editable cell.
 java.lang.String getClickScript(LyWebPageWriter pw, int rowIndex)
          Gets the Javascript code used when clicking on the row.
 java.lang.String getContextMenuScript(LyWebPageWriter pw, int rowIndex, java.lang.String selectColor)
          Gets the Javascript code used when a context menu is performed.
 java.lang.String getDoubleClickScript(LyWebPageWriter pw, int rowIndex, int columnIndex)
          Gets the Javascript code used when double-clicking on the row.
 java.lang.String getExpandRowScript(LyWebPageWriter pw)
          Gets the expand row action and writes associated javascript function for this table.
 LyHeader.Align getHeaderAlignment()
          Gets the header alignment of the row.
 java.lang.String getLinesAdditionalStyle()
          Computes an additional style for row lines.
 java.lang.String getMouseOverScript(LyWebPageWriter pw, int rowIndex, java.lang.String color)
          Gets the Javascript code used when mouse is over the row.
 java.lang.String getRowStyle(int rowIndex)
          Gets the row style.
 java.lang.String getStatusScript(LyWebPageWriter pw)
          Gets the Javascript code used when clicking on the status of the row.
 boolean hasComponents(boolean testToolbar)
          Indicates if current row contains at least one component (field, editable cell or toolbar).
 void initialize()
          Initialization method.
 void removeComponent(LyComponent components)
          Removes a sub-component components.
 void setBorderColor(java.lang.String color)
          Updates attribute borderColor to the given value.
 void setBorderHeight(int height)
          Updates attribute borderHeight to the given value.
 void setColor(java.lang.String key)
          Updates attribute color to the given value.
 void setHidden(boolean hidden)
          Updates attribute hidden to the given value.
 void setImage(java.lang.String key)
          Updates attribute image to the given value.
 void setIndex(java.lang.String index)
          Updates attribute index to the given value.
 void setLabel(java.lang.String label)
          Updates attribute label to the given value.
 void setOpen(boolean open)
          Updates attribute open to the given value.
 void setTooltip(java.lang.String tooltip)
          Updates attribute tooltip to the given value.
 void writeHtml(LyWebPageWriter pw)
          Write HTML description corresponding to this component.
 void writeHtml(LyWebPageWriter pw, int rowIndex)
          Writes HTML description corresponding to this row.
 void writeHtml(LyWebPageWriter pw, int rowIndex, int rowIndexInParent)
          Writes HTML description corresponding to this row.
 
Methods inherited from class leon.view.web.LyWebObject
addFileScript, decodeUrl, displayUpPage, encodeUrl, encodeUrlXhtml, expandUrl, free, getDisabledImageUrl, getFontSize, getFontString, getFontString, getFontString, getHexColor, getHexColor, getHtmlEntitiesString, getHtmlString, getImageSize, getImageSize, getImageUrl, getJavascriptString, getLastFrameName, getLyFont, getMessage, getRootUrl, getRootURL, getScrollHeightForSplitter, getUrl, getWebViewManager, refresh, replaceUrl, replaceUrl, setUpdating, updateRefreshInfo, writeJson
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, getBounds, getChildrenBounds, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
free, getViewComponent
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

USE_COLUMN_INDEX_FOR_DOUBLE_CLICK

public static boolean USE_COLUMN_INDEX_FOR_DOUBLE_CLICK
Indicates if column index must be sent to server for double-clicks


USE_CONTEXT_MENU

public static boolean USE_CONTEXT_MENU
Indicates if context menu must be used on row.

Constructor Detail

LyStrutsRow

public LyStrutsRow(LyRow row)
Class constructor of a Row object for the Struts target. Calls the super implementation

Parameters:
row - the generic Row defined for every type of view targets.
Method Detail

writeHtml

public void writeHtml(LyWebPageWriter pw,
                      int rowIndex)
Writes HTML description corresponding to this row.

Parameters:
pw - the page writer
rowIndex - the index of this row
See Also:
LyWebComponent.writeHtml(LyWebPageWriter)

writeHtml

public void writeHtml(LyWebPageWriter pw,
                      int rowIndex,
                      int rowIndexInParent)
Writes HTML description corresponding to this row.

Parameters:
pw - the page writer
rowIndex - the index of this row
rowIndexInParent - the index of this row in this parent rows
See Also:
LyWebComponent.writeHtml(LyWebPageWriter)

getMouseOverScript

public java.lang.String getMouseOverScript(LyWebPageWriter pw,
                                           int rowIndex,
                                           java.lang.String color)
Gets the Javascript code used when mouse is over the row.

Parameters:
pw - the page writer
rowIndex - the index of this row
color - the color to be passed to the Javascript function
Returns:
the String describing the Javascript code when mouse is over the row

getClickScript

public java.lang.String getClickScript(LyWebPageWriter pw,
                                       int rowIndex)
Gets the Javascript code used when clicking on the row.

Parameters:
pw - the page writer
rowIndex - the index of this row
Returns:
the String describing the Javascript code when clicking on the row

getDoubleClickScript

public java.lang.String getDoubleClickScript(LyWebPageWriter pw,
                                             int rowIndex,
                                             int columnIndex)
Gets the Javascript code used when double-clicking on the row.

Parameters:
pw - the page writer
rowIndex - the index of this row
columnIndex - the index of the column
Returns:
the String describing the Javascript code when double-clicking on the row

getStatusScript

public java.lang.String getStatusScript(LyWebPageWriter pw)
Gets the Javascript code used when clicking on the status of the row.

Parameters:
pw - the page writer
Returns:
the String describing the Javascript code when clicking on the status of the row

getExpandRowScript

public java.lang.String getExpandRowScript(LyWebPageWriter pw)
Gets the expand row action and writes associated javascript function for this table.

Parameters:
pw - the page writer
Returns:
the expand row action javascript tag

getContextMenuScript

public java.lang.String getContextMenuScript(LyWebPageWriter pw,
                                             int rowIndex,
                                             java.lang.String selectColor)
Gets the Javascript code used when a context menu is performed.

Parameters:
pw - the page writer
rowIndex - the index of this row
selectColor - the color to be passed to the Javascript function
Returns:
the String describing the Javascript code when a context menu is performed.

getCellEditionScript

public java.lang.String getCellEditionScript(LyWebPageWriter pw,
                                             int rowIndex,
                                             int columnIndex)
Gets the Javascript code used when double-clicking on an editable cell.

Parameters:
pw - the page writer
rowIndex - the index of this row
columnIndex - the index of the cell column
Returns:
the String describing the Javascript code when double-clicking on the row

setColor

public void setColor(java.lang.String key)
Description copied from interface: LyGraphicalRow
Updates attribute color to the given value.

Specified by:
setColor in interface LyGraphicalRow
Specified by:
setColor in interface LySetColorInterface
Parameters:
key - New value of color.

initialize

public void initialize()
Initialization method.
Sets row style, additional style, row index and the sub cell writing status to default values.
Sets colors and button image with default values defined in resources.


writeHtml

public void writeHtml(LyWebPageWriter pw)
Description copied from interface: LyWebComponent
Write HTML description corresponding to this component.

Specified by:
writeHtml in interface LyWebComponent
Parameters:
pw - the page writer

hasComponents

public boolean hasComponents(boolean testToolbar)
Indicates if current row contains at least one component (field, editable cell or toolbar).

Parameters:
testToolbar - indicates if we must test the presence of a toolbar
Returns:
true if contains at least one component, false otherwise

getAdditionalStyle

public java.lang.String getAdditionalStyle()
Computes an additional style for a row.

Returns:
a string containing the CSS additional style

getLinesAdditionalStyle

public java.lang.String getLinesAdditionalStyle()
Computes an additional style for row lines.

Returns:
a string containing the CSS additional style for row lines

getRowStyle

public java.lang.String getRowStyle(int rowIndex)
Gets the row style.

Parameters:
rowIndex - the index of the row
Returns:
if the row is an even row, return "RE"
else if the row is an odd row, return "RO"
if a sub-cell is written, add the prefix "SUB".

getBackgroundColorStyle

public java.lang.String getBackgroundColorStyle()
Gets the HTML CSS style piece of tag for the background color of the row.

Returns:
the String describing the background color of the row

getAlignment

public java.lang.String getAlignment()
Gets the alignment of the row.

Returns:
the row alignment

getHeaderAlignment

public LyHeader.Align getHeaderAlignment()
Gets the header alignment of the row.

Returns:
the header alignment

setImage

public void setImage(java.lang.String key)
Description copied from interface: LyGraphicalRow
Updates attribute image to the given value.

Specified by:
setImage in interface LyGraphicalRow
Specified by:
setImage in interface LySetImageInterface
Parameters:
key - New value of image.

setTooltip

public void setTooltip(java.lang.String tooltip)
Description copied from interface: LyGraphicalRow
Updates attribute tooltip to the given value.

Specified by:
setTooltip in interface LyGraphicalRow
Parameters:
tooltip - New value of tooltip.

setOpen

public void setOpen(boolean open)
Description copied from interface: LyGraphicalRow
Updates attribute open to the given value.

Specified by:
setOpen in interface LyGraphicalRow
Parameters:
open - Boolean indicating if attribute open is set or unset.

setHidden

public void setHidden(boolean hidden)
Description copied from interface: LyGraphicalRow
Updates attribute hidden to the given value.

Specified by:
setHidden in interface LyGraphicalRow
Specified by:
setHidden in interface LySetHiddenInterface
Parameters:
hidden - Boolean indicating if attribute hidden is set or unset.

setBorderHeight

public void setBorderHeight(int height)
Description copied from interface: LyGraphicalRow
Updates attribute borderHeight to the given value.

Specified by:
setBorderHeight in interface LyGraphicalRow
Parameters:
height - New value of borderHeight.

setBorderColor

public void setBorderColor(java.lang.String color)
Description copied from interface: LyGraphicalRow
Updates attribute borderColor to the given value.

Specified by:
setBorderColor in interface LyGraphicalRow
Parameters:
color - New value of borderColor.

setLabel

public void setLabel(java.lang.String label)
Description copied from interface: LyGraphicalRow
Updates attribute label to the given value.

Specified by:
setLabel in interface LyGraphicalRow
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - New value of label.

setIndex

public void setIndex(java.lang.String index)
Description copied from interface: LyGraphicalRow
Updates attribute index to the given value.

Specified by:
setIndex in interface LyGraphicalRow
Parameters:
index - New value of index.
See Also:
leon.view.setinterface.LyGraphicalRow#setIndex(java.lang.String)

addComponent

public void addComponent(LyComponent component,
                         int pos)
Description copied from interface: LyGraphicalRow
Inserts a sub-component components at given position.

Specified by:
addComponent in interface LyGraphicalRow
Parameters:
component - The components to add to components list.
pos - Position where the sub-component is inserted.

removeComponent

public void removeComponent(LyComponent components)
Description copied from interface: LyGraphicalRow
Removes a sub-component components.

Specified by:
removeComponent in interface LyGraphicalRow
Parameters:
components - The components to remove to components list.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com