wheel.components
Class StandaloneComponentConfiguration

java.lang.Object
  extended by wheel.components.RenderableComponentConfiguration
      extended by wheel.components.StandaloneComponentConfiguration

public class StandaloneComponentConfiguration
extends RenderableComponentConfiguration


Constructor Summary
StandaloneComponentConfiguration(StandaloneComponent forComponent)
           
 
Method Summary
 boolean _isRenderDoctype()
          Intended for internal use.
 boolean _isRenderGeneratedComponentIds()
          Intended for internal use.
 StandaloneComponentConfiguration _setRenderDoctype(boolean renderDoctype)
          When set to false, the page will not render doctype declaration.
 StandaloneComponentConfiguration exposeField(java.lang.String fieldName)
          Any field in a StandaloneComponent (provided it has getter and setter) can be "exposed".
 java.lang.String getContentType()
          Returns the MIME content type for this complex component.
 InitialFieldValue getInitialFieldValue(java.lang.String fieldName)
          Intended for internal use.
 java.util.Map<java.lang.String,java.lang.Object> getValidationVariables()
           
 StandaloneComponentConfiguration initialFieldValue(java.lang.String fieldName, java.lang.String stringReplacement)
          Adds a String literal that will be rendered to html output if the indicated field is null.
 StandaloneComponentConfiguration initialFieldValue(java.lang.String fieldName, java.lang.String stringReplacement, java.lang.Object emptyValue)
          Adds a String literal that will be rendered to html output if the indicated field is null.
 boolean isAjaxComponent()
           
 boolean isFieldExposed(java.lang.String fieldName)
          Returns true if a field by the given name is exposed in this component.
 boolean isReusable()
          Intended for internal use.
 StandaloneComponentConfiguration linkToDomain(ElExpression fieldName, ElExpression elExpression)
          Links a field in aIComplexComponent object and a field in a domain object.
 StandaloneComponentConfiguration setAjaxComponent(boolean ajaxComponent)
           
 StandaloneComponentConfiguration setContentType(java.lang.String contentType)
          Sets the content type for this complex component.
 StandaloneComponentConfiguration setRenderGeneratedComponentIds(boolean renderGeneratedComponentIds)
          When set to true, genereated componentId's will be rendered as id-attributes to html-tags.
 StandaloneComponentConfiguration setReusable(boolean reusable)
          Sets this component as reusable.
 StandaloneComponentConfiguration useAsset(java.lang.String fileUri)
          Adds a css/js asset to the surrounding page.
 StandaloneComponentConfiguration useAsset(java.lang.String fileUri, int expires)
          Adds a css/js asset to the surrounding page.
 StandaloneComponentConfiguration useAsset(java.lang.String fileUri, java.lang.String media)
          Adds a css/js asset to the surrounding page.
 StandaloneComponentConfiguration useAsset(java.lang.String fileUri, java.lang.String media, int expires)
          Adds a css/js asset to the surrounding page.
 StandaloneComponentConfiguration useValidationVariable(java.lang.String key, java.lang.Object var)
          With this method you can make any object available during form element validation.
 
Methods inherited from class wheel.components.RenderableComponentConfiguration
isRenderId, isRenderSelf, isUseXhtml, isVisible, setRenderId, setRenderSelf, setUseXhtml, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandaloneComponentConfiguration

public StandaloneComponentConfiguration(StandaloneComponent forComponent)
Method Detail

useValidationVariable

public StandaloneComponentConfiguration useValidationVariable(java.lang.String key,
                                                              java.lang.Object var)
With this method you can make any object available during form element validation. The added Object should have methods that take a String[] as input and return boolean (true if valid, else false). You can access these variables in the validation rule el-expression with the key given here.

Parameters:
key - The name that will be used in the validation rule el-expressions
var - The validation object.
Returns:

getValidationVariables

public java.util.Map<java.lang.String,java.lang.Object> getValidationVariables()

getContentType

public java.lang.String getContentType()
Returns the MIME content type for this complex component. Default is "text/html".

Returns:

setContentType

public StandaloneComponentConfiguration setContentType(java.lang.String contentType)
Sets the content type for this complex component. For Pages this is simple enough, but in ajax-situations you might want to change the content type of a single component.

Parameters:
contentType - The new content type as a MIME type.

initialFieldValue

public StandaloneComponentConfiguration initialFieldValue(java.lang.String fieldName,
                                                          java.lang.String stringReplacement)
Adds a String literal that will be rendered to html output if the indicated field is null. Useful when you want to display for example a short help text for form fields.

Parameters:
fieldName - An el-expression pointing to the field member.
stringReplacement - The String literal to render when the field is null.
Returns:

initialFieldValue

public StandaloneComponentConfiguration initialFieldValue(java.lang.String fieldName,
                                                          java.lang.String stringReplacement,
                                                          java.lang.Object emptyValue)
Adds a String literal that will be rendered to html output if the indicated field is null. Useful when you want to display for example a short help text for form fields.

Parameters:
fieldName - An el-expression pointing to the field member.
stringReplacement - The String literal to render when the field is null.
Returns:

getInitialFieldValue

public InitialFieldValue getInitialFieldValue(java.lang.String fieldName)
Intended for internal use. Returns the empty string value for the given field.

Parameters:
fieldName -
Returns:

linkToDomain

public StandaloneComponentConfiguration linkToDomain(ElExpression fieldName,
                                                     ElExpression elExpression)
Links a field in aIComplexComponent object and a field in a domain object. This link is in effect two MVEL-expressions that give access to the field in the component and to the domain object. With this mechanism, its easy to make forms that edit domain-object fields in "conversations" that can be rolled back. Committing the changes is done with StandaloneComponent#commitToDomain() methods.

Parameters:
fieldName - An el-expression that point to the field in the component-class
elExpression - An el-expression that is evaluated on the domain object. Access to the domain object must be
Returns:

isAjaxComponent

public boolean isAjaxComponent()

setAjaxComponent

public StandaloneComponentConfiguration setAjaxComponent(boolean ajaxComponent)

setReusable

public StandaloneComponentConfiguration setReusable(boolean reusable)
Sets this component as reusable.

Parameters:
reusable -

isReusable

public boolean isReusable()
Intended for internal use. Returns true if this component is a reusable component. Reusable components have different rules for processing assets.

Returns:

useAsset

public StandaloneComponentConfiguration useAsset(java.lang.String fileUri)
Adds a css/js asset to the surrounding page.

Parameters:
fileUri - If the asset is available inside the application, only the filename without path is given. Can also be a http-url.

useAsset

public StandaloneComponentConfiguration useAsset(java.lang.String fileUri,
                                                 java.lang.String media)
Adds a css/js asset to the surrounding page.

Parameters:
fileUri - If the asset is available inside the application, only the filename without path is given. Can also be a http-url.
media - When using css-assets, this parameter sets the media which this asset supports.

useAsset

public StandaloneComponentConfiguration useAsset(java.lang.String fileUri,
                                                 int expires)
Adds a css/js asset to the surrounding page.

Parameters:
fileUri - If the asset is available inside the application, only the filename without path is given. Can also be a http-url.
expires - In how many hours the asset will expire from user agent caches. Default is 48.

useAsset

public StandaloneComponentConfiguration useAsset(java.lang.String fileUri,
                                                 java.lang.String media,
                                                 int expires)
Adds a css/js asset to the surrounding page.

Parameters:
fileUri - If the asset is available inside the application, only the filename without path is given. Can also be a http-url.
media - When using css-assets, this parameter sets the media which this asset supports.
expires - In how many hours the asset will expire from user agent caches. Default is 48.

exposeField

public StandaloneComponentConfiguration exposeField(java.lang.String fieldName)
Any field in a StandaloneComponent (provided it has getter and setter) can be "exposed". Exposing fields means that they can be manipulated via url parameters. Exposing fields can be very convinient when you have a page that needs an id of some kind to initialize itself. Example: you have a field private int counter; in your component and you want to expose it.
 public MyPage() {
  config().exposeField("counter");
 }
 
Now you can access the counter field in an URL: MyPage?counter=100
Note: you can use config().exposeField() anywhere, but using it in a constructor is most convinient.

Parameters:
fieldName -
Returns:

isFieldExposed

public boolean isFieldExposed(java.lang.String fieldName)
Returns true if a field by the given name is exposed in this component. Intended for internal use.

Parameters:
fieldName -
Returns:

_isRenderDoctype

public boolean _isRenderDoctype()
Intended for internal use.

Returns:
True if this page will render doctype declaration.

_setRenderDoctype

public StandaloneComponentConfiguration _setRenderDoctype(boolean renderDoctype)
When set to false, the page will not render doctype declaration. This is useful if you wish to project xpath-expressions to the page when the page is an XML-tree.

Parameters:
renderDoctype -

_isRenderGeneratedComponentIds

public boolean _isRenderGeneratedComponentIds()
Intended for internal use.

Returns:
Returns true if generated componentId's should be rendered.

setRenderGeneratedComponentIds

public StandaloneComponentConfiguration setRenderGeneratedComponentIds(boolean renderGeneratedComponentIds)
When set to true, genereated componentId's will be rendered as id-attributes to html-tags.

Parameters:
renderGeneratedComponentIds -


Copyright © 2007-2008. All Rights Reserved.