com.ivata.mask.web.struts
Class InputMaskForm

java.lang.Object
  extended byorg.apache.struts.action.ActionForm
      extended bycom.ivata.mask.web.struts.DialogForm
          extended bycom.ivata.mask.web.struts.MaskForm
              extended bycom.ivata.mask.web.struts.InputMaskForm
All Implemented Interfaces:
java.io.Serializable

public class InputMaskForm
extends MaskForm

This form references a single value object to be displayed.

Since:
ivata masks 0.1 (2004-05-09)
Version:
$Revision: 1.7.2.1 $
Author:
Colin MacLeod colin.macleod@ivata.com
See Also:
Serialized Form

Field Summary
static java.lang.String REQUEST_ATTRIBUTE
           Request attribute under which name this form is stored.
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
InputMaskForm(com.ivata.mask.valueobject.ValueObject valueObjectParam, com.ivata.mask.Mask maskParam, java.lang.Class baseClassParam)
           Create a new mask form for the given value object.
 
Method Summary
protected  void clear()
           Clear all bean properties to their default state.The difference between this and reset is that all properties are changed, regardless of current request state.
 java.lang.String getResourceFieldPath()
           The resource field path is the "stem" - the first string before the dot separator (.) - in the application resources for the fields in this form.
 com.ivata.mask.valueobject.ValueObject getValueObject()
          Value object whose values are to be displayed in the mask.
 boolean isApplyButtonHidden()
          Should the 'apply' button be shown or hidden?
 boolean isClearButtonHidden()
          Should the 'new' button be shown or hidden?
 boolean isDeleteButtonHidden()
          Should the 'delete' button be shown or hidden?
 boolean isDeleteWithoutWarn()
          Sets whether or not the dialog should warn before deleting a value object.
 boolean isDisplayOnly()
          If the mask is marked display only, only the text values of the fields are show (i.e.
 boolean isRefreshOpener()
          For pop-up windows, it is often useful to refresh the page which opened the pop-up, after the pop-up has changed something.
 void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Refer to DialogForm.reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest).
protected  void saveProperty(java.lang.String propertyNameParam)
          Mark a property to be saved.
 void setApplyButtonHidden(boolean applyButtonHiddenParam)
          Refer to isApplyButtonHidden().
 void setClearButtonHidden(boolean clearButtonHiddenParam)
          Refer to isClearButtonHidden().
 void setDeleteButtonHidden(boolean deleteButtonHiddenParam)
          Refer to isDeleteButtonHidden().
 void setDeleteWithoutWarn(boolean deleteWithoutWarnParam)
          Refer to isDeleteWithoutWarn().
 void setDisplayOnly(boolean b)
          Refer to isDisplayOnly().
 void setRefreshOpener(boolean refreshOpenerParam)
          Refer to isRefreshOpener().
 void setResourceFieldPath(java.lang.String resourceFieldPathParam)
          Refer to getResourceFieldPath().
 com.ivata.mask.validation.ValidationErrors validate(javax.servlet.http.HttpServletRequest requestParam, javax.servlet.http.HttpSession sessionParam)
          Overridden to check mandatory fields.
 
Methods inherited from class com.ivata.mask.web.struts.MaskForm
getBaseClass, getMask
 
Methods inherited from class com.ivata.mask.web.struts.DialogForm
getApply, getBundle, getClear, getDefaultForwardApply, getDefaultForwardDelete, getDefaultForwardOk, getDeleteConfirm, getDeleteKey, getDeleteWarn, getHelpKey, getOk, setApply, setBundle, setClear, setDefaultForwardApply, setDefaultForwardDelete, setDefaultForwardOk, setDeleteConfirm, setDeleteKey, setDeleteWarn, setHelpKey, setOk, validate
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_ATTRIBUTE

public static final java.lang.String REQUEST_ATTRIBUTE

Request attribute under which name this form is stored.

See Also:
Constant Field Values
Constructor Detail

InputMaskForm

public InputMaskForm(com.ivata.mask.valueobject.ValueObject valueObjectParam,
                     com.ivata.mask.Mask maskParam,
                     java.lang.Class baseClassParam)

Create a new mask form for the given value object.

Parameters:
valueObjectParam - value object to be displayed.
maskParam - mask containing all the fields definitions to be displayed.
baseClassParam - base class of all value objects to show in the list associated with this mask.
Method Detail

clear

protected void clear()
              throws javax.naming.OperationNotSupportedException

Clear all bean properties to their default state.The difference between this and reset is that all properties are changed, regardless of current request state.

Overrides:
clear in class MaskForm
Throws:
OperationNotSupported - if the value object does not have a default constructor.
javax.naming.OperationNotSupportedException
See Also:
MaskForm.clear()

getResourceFieldPath

public java.lang.String getResourceFieldPath()

The resource field path is the "stem" - the first string before the dot separator (.) - in the application resources for the fields in this form.

For example, in a form for editing group information this might be simply "group", and the message resource key for the group parent field would then be specified in the ApplicationResources.properties file as "group.field.parent" (without the quotes).

Returns:
Returns the path to application resources for this form.

getValueObject

public com.ivata.mask.valueobject.ValueObject getValueObject()
Value object whose values are to be displayed in the mask.

Returns:
Value object to be displayed.

isApplyButtonHidden

public boolean isApplyButtonHidden()
Should the 'apply' button be shown or hidden?

Returns:
true if the apply button should NOT be shown.

isClearButtonHidden

public boolean isClearButtonHidden()
Should the 'new' button be shown or hidden?

Returns:
true if the new button should NOT be shown.

isDeleteButtonHidden

public boolean isDeleteButtonHidden()
Should the 'delete' button be shown or hidden?

Returns:
true if the delete button should NOT be shown.

isDeleteWithoutWarn

public boolean isDeleteWithoutWarn()
Sets whether or not the dialog should warn before deleting a value object.

Returns:
true if a warning is displayed before deleting.

isDisplayOnly

public boolean isDisplayOnly()
If the mask is marked display only, only the text values of the fields are show (i.e. display mode), and there are no fields for user input.

Returns:
true if only text field values should be shown.

isRefreshOpener

public boolean isRefreshOpener()
For pop-up windows, it is often useful to refresh the page which opened the pop-up, after the pop-up has changed something.

Returns:
Returns true if the page which opened this one should be refreshed on delete or confirm.

reset

public void reset(org.apache.struts.action.ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request)
Refer to DialogForm.reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest).

Overrides:
reset in class DialogForm
Parameters:
mapping - Refer to DialogForm.reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest).
request - Refer to DialogForm.reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest).
See Also:
DialogForm.reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)

saveProperty

protected final void saveProperty(java.lang.String propertyNameParam)
Mark a property to be saved. By default, the clear method (and hence the reset method) will set all property values to null. By adding your property to the list of those saved here, it will be ignored in the clear method.

Parameters:
propertyNameParam - name of the property to save.

setApplyButtonHidden

public final void setApplyButtonHidden(boolean applyButtonHiddenParam)
Refer to isApplyButtonHidden().

Parameters:
applyButtonHiddenParam - Refer to isApplyButtonHidden().

setClearButtonHidden

public final void setClearButtonHidden(boolean clearButtonHiddenParam)
Refer to isClearButtonHidden().

Parameters:
clearButtonHiddenParam - Refer to isClearButtonHidden().

setDeleteButtonHidden

public final void setDeleteButtonHidden(boolean deleteButtonHiddenParam)
Refer to isDeleteButtonHidden().

Parameters:
deleteButtonHiddenParam - Refer to isDeleteButtonHidden().

setDeleteWithoutWarn

public final void setDeleteWithoutWarn(boolean deleteWithoutWarnParam)
Refer to isDeleteWithoutWarn().

Parameters:
deleteWithoutWarnParam - Refer to isDeleteWithoutWarn().

setDisplayOnly

public final void setDisplayOnly(boolean b)
Refer to isDisplayOnly().

Parameters:
b - Refer to isDisplayOnly().

setRefreshOpener

public final void setRefreshOpener(boolean refreshOpenerParam)
Refer to isRefreshOpener().

Parameters:
refreshOpenerParam - Refer to isRefreshOpener().

setResourceFieldPath

public void setResourceFieldPath(java.lang.String resourceFieldPathParam)
Refer to getResourceFieldPath().

Parameters:
resourceFieldPathParam - Refer to getResourceFieldPath().

validate

public com.ivata.mask.validation.ValidationErrors validate(javax.servlet.http.HttpServletRequest requestParam,
                                                           javax.servlet.http.HttpSession sessionParam)
Overridden to check mandatory fields.

Overrides:
validate in class MaskForm
Parameters:
requestParam - Refer to DialogForm.validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest).
sessionParam - Refer to DialogForm.validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest). Refer to DialogForm.validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest).
Returns:
errors from the super class, with any mandatory field errors added.


Copyright © 2001-2005 ivata limited. All Rights Reserved.