LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.struts
Class LyStrutsForm

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.web.LyWebObject
          extended by leon.view.web.struts.LyStrutsFieldItem
              extended by leon.view.web.struts.LyStrutsPanel
                  extended by leon.view.web.struts.LyStrutsForm
All Implemented Interfaces:
LyGraphicalComponent, LyGraphicalFieldItem, LyGraphicalForm, LyGraphicalPanel, LyViewComponent, LyFreeInterface, LyResetContentInterface, LySetEditableInterface, LySetEnabledInterface, LySetLabelInterface, LySetPopupMenuInterface, LyWebComponent

public class LyStrutsForm
extends LyStrutsPanel
implements LyGraphicalForm, LySetEnabledInterface, LyResetContentInterface

This class implements the Form object (as described in the dtd) for web viewer.

FORM: Form
A form allows to show a set of fields. This type of component is used to allow a user of an application to consult application data (non editable form) or else to input data (editable form). The default arrangement of the fields inside a form is based on a grid of two columns comprising as many lines as there are fields. The first column contains the labels of the fields and the second one contains the input fields.

See Also:
LyForm

Field Summary
static java.lang.String __VERSION
           
static boolean COMPOSITION_TABLE_WORKAROUND
          Workaround for IE 5.0 and tables width within forms.
static int DEBUG_BORDER
          Width of the border used for HTML tables (for debug).
static int DECO_CAPTION_PARAMETER
          Constant used to generate CSS class name for caption.
static int DECO_FORM_PARAMETER
          Constant used to generate CSS class name for form.
static int DECO_ITEM_PARAMETER
          Constant used to generate CSS class name for field item.
static int LABEL_LENGTH_WRAP
          Maximum length for not wrapped labels.
 
Fields inherited from class leon.view.web.LyWebObject
WEB_COMPONENT_ID, WEB_CONTROLLER_ID, WEB_SESSION_ID
 
Constructor Summary
LyStrutsForm(LyForm form)
          Class constructor of a Form object for the struts target.
 
Method Summary
 boolean generateCellForHiddenFields()
          Indicates whether an HTML cell must be used for hidden fields.
 java.lang.String getAttachmentDirectory()
          Gets the attachment handler directory.
 java.lang.String getAttachmentHandler()
          Gets the attachment handler.
 int getCellBottomPadding(LyFormField formField)
          Returns the bottom padding of the HTML cell containing given field.
 int getCellHeight(LyFormField formField)
          Returns the height of the HTML cell containing given field if fixed.
 int getCellLeftPadding(LyFormField formField)
          Returns the left padding of the HTML cell containing given field.
 int getCellPadding()
          Returns the cell padding that must be used for the internal HTML table generated for form.
 int getCellRightPadding(LyFormField formField)
          Returns the right padding of the HTML cell containing given field.
 int getCellSpacing()
          Returns the cell spacing that must be used for the internal HTML table generated for form.
 int getCellTopPadding(LyFormField formField)
          Returns the top padding of the HTML cell containing given field.
 int getCellWidth(LyFormField formField)
          Returns the width of the HTML cell containing given field if fixed.
 java.lang.String getControllerId()
          Gets the form generic component controller id.
 java.lang.String getName()
          Gets the HTML name of the form.
 void initialize()
          Initialization method.
 void resetContent()
          (non-Javadoc).
 void resetContent(boolean full)
          (non-Javadoc).
 void setAttachmentDirectory(java.lang.String attachmentDirectory)
          Sets the attachment handler directory.
 void setAttachmentHandler(java.lang.String handler)
          Sets the attachment handler.
 void setEditable(boolean editable)
          (non-Javadoc).
 void setEnabled(boolean enabled)
          (non-Javadoc).
 void writeHtml(LyWebPageWriter pw)
          (non-Javadoc).
 
Methods inherited from class leon.view.web.struts.LyStrutsPanel
getPopupMenuView, setPopupMenu
 
Methods inherited from class leon.view.web.struts.LyStrutsFieldItem
canDisabled, getCaption, getController, getFieldItem, getForm, getFormField, getFormName, getHtmlForm, getId, isEditable, isNetscape, isOptional, needCheck, setLabel
 
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, 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

COMPOSITION_TABLE_WORKAROUND

public static boolean COMPOSITION_TABLE_WORKAROUND
Workaround for IE 5.0 and tables width within forms.


DECO_CAPTION_PARAMETER

public static int DECO_CAPTION_PARAMETER
Constant used to generate CSS class name for caption.


DECO_ITEM_PARAMETER

public static int DECO_ITEM_PARAMETER
Constant used to generate CSS class name for field item.


DECO_FORM_PARAMETER

public static int DECO_FORM_PARAMETER
Constant used to generate CSS class name for form.


LABEL_LENGTH_WRAP

public static int LABEL_LENGTH_WRAP
Maximum length for not wrapped labels.


DEBUG_BORDER

public static int DEBUG_BORDER
Width of the border used for HTML tables (for debug).

Constructor Detail

LyStrutsForm

public LyStrutsForm(LyForm form)
Class constructor of a Form object for the struts target.

Parameters:
form - the generic Form defined for every type of view targets
Method Detail

initialize

public void initialize()
Initialization method.
Sets the form name, attachment handler and directory to null.
Sets the label font and colors with values defined in resources files.


writeHtml

public void writeHtml(LyWebPageWriter pw)
(non-Javadoc).

Specified by:
writeHtml in interface LyWebComponent
Parameters:
pw - the page writer
See Also:
LyWebComponent.writeHtml(leon.view.web.LyWebPageWriter)

getName

public java.lang.String getName()
Gets the HTML name of the form.

Returns:
the form name

getControllerId

public java.lang.String getControllerId()
Gets the form generic component controller id.

Returns:
the controller id

setAttachmentHandler

public void setAttachmentHandler(java.lang.String handler)
Sets the attachment handler. Default value is null, this value is set by a File fieldItem in the form.

Parameters:
handler - the new handler, or null if none is specified
See Also:
getAttachmentHandler()

getAttachmentHandler

public java.lang.String getAttachmentHandler()
Gets the attachment handler.

Returns:
the attachment handler
See Also:
setAttachmentHandler(String)

setAttachmentDirectory

public void setAttachmentDirectory(java.lang.String attachmentDirectory)
Sets the attachment handler directory.

Parameters:
attachmentDirectory - the new attachment directory
See Also:
getAttachmentDirectory()

getAttachmentDirectory

public java.lang.String getAttachmentDirectory()
Gets the attachment handler directory.

Returns:
the attachment handler directory
See Also:
setAttachmentDirectory(String)

setEnabled

public void setEnabled(boolean enabled)
(non-Javadoc).

Specified by:
setEnabled in interface LySetEnabledInterface
See Also:
LySetEnabledInterface.setEnabled(boolean)

setEditable

public void setEditable(boolean editable)
(non-Javadoc).

Specified by:
setEditable in interface LyGraphicalForm
Specified by:
setEditable in interface LySetEditableInterface
Parameters:
editable - Boolean indicating if attribute editable is set or unset.
See Also:
LySetEditableInterface.setEditable(boolean)

resetContent

public void resetContent()
(non-Javadoc).

Specified by:
resetContent in interface LyResetContentInterface
See Also:
LyResetContentInterface.resetContent()

resetContent

public void resetContent(boolean full)
(non-Javadoc).

Specified by:
resetContent in interface LyResetContentInterface
Parameters:
full - indicates whether old components must be removed from graphical view.
See Also:
LyResetContentInterface.resetContent(boolean)

getCellWidth

public int getCellWidth(LyFormField formField)
Returns the width of the HTML cell containing given field if fixed.

Returns:
the width of the cell or a negative value if there is no fixed width.

getCellHeight

public int getCellHeight(LyFormField formField)
Returns the height of the HTML cell containing given field if fixed.

Returns:
the height of the cell or a negative value if there is no fixed height.

getCellLeftPadding

public int getCellLeftPadding(LyFormField formField)
Returns the left padding of the HTML cell containing given field.

Returns:
the left padding of the cell or a negative value if there is no left padding.

getCellRightPadding

public int getCellRightPadding(LyFormField formField)
Returns the right padding of the HTML cell containing given field.

Returns:
the right padding of the cell or a negative value if there is no right padding.

getCellTopPadding

public int getCellTopPadding(LyFormField formField)
Returns the top padding of the HTML cell containing given field.

Returns:
the top padding of the cell or a negative value if there is no top padding.

getCellBottomPadding

public int getCellBottomPadding(LyFormField formField)
Returns the bottom padding of the HTML cell containing given field.

Returns:
the bottom padding of the cell or a negative value if there is no bottom padding.

getCellSpacing

public int getCellSpacing()
Returns the cell spacing that must be used for the internal HTML table generated for form.

Returns:
the cell spacing in pixels.

getCellPadding

public int getCellPadding()
Returns the cell padding that must be used for the internal HTML table generated for form.

Returns:
the cell padding in pixels.

generateCellForHiddenFields

public boolean generateCellForHiddenFields()
Indicates whether an HTML cell must be used for hidden fields.

Returns:
true if an HTML cell must be used, false otherwise.

(c) January 2013 - W4 S.A.

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