com.cc.framework.ui.model.imp
Class DesignRuleImp

java.lang.Object
  extended bycom.cc.framework.ui.model.imp.ClientHandlerImp
      extended bycom.cc.framework.ui.model.imp.DesignRuleImp
All Implemented Interfaces:
ClientHandler, DesignRule, java.io.Serializable

public class DesignRuleImp
extends ClientHandlerImp
implements DesignRule

A design rule is used to modify the properties of a design model at runtime based on a rule

Version:
$Revision: 1.11 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  DeferredEnvironment env
          Expression Language Environment.
private  java.lang.String rule
          The rule.
private static long serialVersionUID
          Serial Version UID
private  DeferredValue style
          Html-Style
private  DeferredValue styleClass
          Style Class -> HTML class Attribut
private  DeferredValue styleId
          Style ID
 
Fields inherited from class com.cc.framework.ui.model.imp.ClientHandlerImp
 
Constructor Summary
DesignRuleImp()
          Constructor
 
Method Summary
 void applyDesign(javax.servlet.jsp.PageContext ctx, org.apache.ecs.ConcreteElement element, java.lang.Object bean)
          This method searches for all matching rules and applies the design to the given HTML element
 DeferredEnvironment getEnvironment()
          retrieves the current EL Environment for the current row
 java.lang.String getRule()
          Returns the rule
 java.lang.String getStyle()
          Returns the Style
 java.lang.String getStyleClass()
          Returns the StyleClass
 java.lang.String getStyleId()
          returns the StyleId
 boolean match()
          Matches the rule against the beans properties.
 void setEnvironment(DeferredEnvironment env)
          Sets the EL Environment to evaluate EL Expressions in the context of the current row bean
 DesignRule setRule(java.lang.String rule)
          Sets the rule.
 DesignRule setStyle(java.lang.String style)
          Sets the Style
 DesignRule setStyleClass(java.lang.String styleClass)
          Sets the StyleClass
 DesignRule setStyleId(java.lang.String styleId)
          Sets the StyleId
 
Methods inherited from class com.cc.framework.ui.model.imp.ClientHandlerImp
evaluate, getHandler, getHandlers, setHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cc.framework.ui.model.ClientHandler
getHandler, getHandlers, setHandler
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

env

private transient DeferredEnvironment env
Expression Language Environment. This object is needed when the property values of the column are retrieved in the context of a row bean. Properties might change from row to row because they can contain dynamic expressions


rule

private java.lang.String rule
The rule. The design rule will be selected based on this expression language (EL) expression.


styleId

private DeferredValue styleId
Style ID


styleClass

private DeferredValue styleClass
Style Class -> HTML class Attribut


style

private DeferredValue style
Html-Style

Constructor Detail

DesignRuleImp

public DesignRuleImp()
Constructor

Method Detail

setEnvironment

public void setEnvironment(DeferredEnvironment env)
Sets the EL Environment to evaluate EL Expressions in the context of the current row bean

Specified by:
setEnvironment in interface DesignRule
Parameters:
env - Environment

getEnvironment

public DeferredEnvironment getEnvironment()
retrieves the current EL Environment for the current row

Specified by:
getEnvironment in interface DesignRule
Returns:
Environment oder null

getRule

public java.lang.String getRule()
Description copied from interface: DesignRule
Returns the rule

Specified by:
getRule in interface DesignRule
Returns:
rule
See Also:
DesignRule.getRule()

setRule

public DesignRule setRule(java.lang.String rule)
Description copied from interface: DesignRule
Sets the rule. The design rule will be selected based on this expression language (EL) expression.

Specified by:
setRule in interface DesignRule
Parameters:
rule - The rule to set
Returns:
the rule itself
See Also:
DesignRule.setRule(java.lang.String)

match

public boolean match()
              throws java.lang.Exception
Description copied from interface: DesignRule
Matches the rule against the beans properties.

Specified by:
match in interface DesignRule
Returns:
returns true if the bean matches the rule
Throws:
java.lang.Exception - is thrown in case of an error
See Also:
DesignRule.match()

applyDesign

public void applyDesign(javax.servlet.jsp.PageContext ctx,
                        org.apache.ecs.ConcreteElement element,
                        java.lang.Object bean)
                 throws java.lang.Exception
Description copied from interface: DesignRule
This method searches for all matching rules and applies the design to the given HTML element

Specified by:
applyDesign in interface DesignRule
Parameters:
ctx - JSP Page context
element - the HTML element to modify
bean - the bean that holds the values to check
Throws:
java.lang.Exception - is thrown in case of an error
See Also:
DesignRule.applyDesign(javax.servlet.jsp.PageContext, org.apache.ecs.ConcreteElement, java.lang.Object)

getStyle

public java.lang.String getStyle()
Description copied from interface: DesignRule
Returns the Style

Specified by:
getStyle in interface DesignRule
Returns:
String
See Also:
DesignRule.getStyle()

getStyleClass

public java.lang.String getStyleClass()
Description copied from interface: DesignRule
Returns the StyleClass

Specified by:
getStyleClass in interface DesignRule
Returns:
String
See Also:
DesignRule.getStyleClass()

getStyleId

public java.lang.String getStyleId()
Description copied from interface: DesignRule
returns the StyleId

Specified by:
getStyleId in interface DesignRule
Returns:
string
See Also:
DesignRule.getStyleId()

setStyle

public DesignRule setStyle(java.lang.String style)
Description copied from interface: DesignRule
Sets the Style

Specified by:
setStyle in interface DesignRule
Parameters:
style - style constant
Returns:
the rule itself
See Also:
DesignRule.setStyle(java.lang.String)

setStyleClass

public DesignRule setStyleClass(java.lang.String styleClass)
Description copied from interface: DesignRule
Sets the StyleClass

Specified by:
setStyleClass in interface DesignRule
Parameters:
styleClass - StyleClass
Returns:
the rule itself
See Also:
DesignRule.setStyleClass(java.lang.String)

setStyleId

public DesignRule setStyleId(java.lang.String styleId)
Description copied from interface: DesignRule
Sets the StyleId

Specified by:
setStyleId in interface DesignRule
Parameters:
styleId - HTML-Id of the element
Returns:
the rule itself
See Also:
DesignRule.setStyleId(java.lang.String)


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.