|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cc.framework.ui.control.Control
Base class for controls
Field Summary | |
private java.util.Collection |
buttons
Collection of optional Buttons that should be displayed next to the Control Collection<Control> |
private static java.lang.String |
ERR_ACTION
Error message |
private static java.lang.String |
ERR_MISSING_CTX
Error Message |
protected org.apache.commons.logging.Log |
log
Commons Logging instance. |
private Principal |
principal
The principal object |
private static long |
serialVersionUID
Serial Version UID |
Constructor Summary | |
Control()
Constructor |
Method Summary | |
void |
addButton(Control button)
Adds a tool button to the Text Element |
boolean |
allowAjaxRendering()
This method decides whether this control instance has enough information to render the control as part of an AJAX response. |
void |
execute(ControlRequestContext ctx)
Delegates all incoming action to the action handler |
void |
execute(ControlRequestContext ctx,
java.util.Collection params)
Delegates all incoming action to the action handler |
void |
execute(ControlRequestContext ctx,
java.lang.Object p1)
Delegates all incoming action to the action handler |
void |
execute(ControlRequestContext ctx,
java.lang.Object[] params)
Delegates all incoming action to the action handler |
void |
execute(ControlRequestContext ctx,
java.lang.Object p1,
java.lang.Object p2)
Delegates all incoming action to the action handler |
void |
execute(ControlRequestContext ctx,
java.lang.Object p1,
java.lang.Object p2,
java.lang.Object p3)
Delegates all incoming action to the action handler |
void |
execute(java.lang.Object[] params)
Delegates all incoming action to the action handler. |
java.lang.String |
getAction()
Returns the action which is assigned to the control |
java.lang.String |
getAjaxId()
Returns the AJAX container id of the control or null when
the control is not AJAX relevant. |
java.util.Collection |
getButtons()
Retrieves a list of button that are assigned to this Filed |
java.lang.String |
getControlName()
Returns the name of the control |
abstract DataModel |
getDataModel()
Returns the data model of the Control |
abstract ControlDesignModel |
getDesignModel()
Returns the design model of the control |
DesignRule[] |
getDesignRules()
Returns the design rules for this control |
java.lang.String |
getFrameworkString(java.lang.String resourceId,
java.lang.Object[] arguments,
java.util.Locale locale)
This method gets called whenever a string resource identifier needs to be resolved. |
java.lang.String |
getHandler(ClientEvent event)
Returns the script handler which was associated for a client event |
ClientEvent[] |
getHandlers()
Returns the list of events for which client handler have been registered. |
java.lang.String |
getHeight()
Returns the height of the control |
java.lang.String |
getHelp()
Returns the Help id that is associated with this control element. |
java.lang.String |
getId()
Returns the Control Id |
java.lang.String |
getLocaleName()
Gets the Local Setting for this Control |
java.lang.String |
getName()
Returns the Control Name |
Permission |
getPermission()
Returns the authorizations required to access an object If the method returns null no access rights is required. |
Principal |
getPrincipal()
Returns the principal object |
java.lang.String |
getProperty()
Returns the property Attribute |
RunAt |
getRunAt()
Returns if the control works with or without server round trips. |
abstract StateModel |
getStateModel()
Returns the state model of the control |
java.lang.String |
getStyle()
Returns the Style |
java.lang.String |
getStyleClass()
Returns the StyleClass |
java.lang.String |
getStyleId()
returns the StyleId |
java.lang.String |
getSummary()
Retrieves the property that can be used for rendering to non-visual media such as speech or Braille |
int |
getTabIndex()
Retrieves the optional tooltip text |
java.lang.String |
getTooltip()
Retrieves the optional tooltip text |
boolean |
getTransaction()
Checks if the framework should include a transaction token (if any) in all generated hyperlinks for this action. |
java.lang.String |
getUniqueStyleId()
Returns a unique Style id for the given control |
java.lang.String |
getWidth()
Returns the width of the control |
boolean |
isAjaxEnabled()
This method checks if the element should send AJAX requests to the server |
boolean |
isDisabled()
Returns the disabled Flag |
boolean |
isFormElement()
Checks if the control should act like a form element. |
void |
markDirty(ControlRequestContext ctx)
This method marks the control as dirty when it has changed its state during an AJAX request. |
void |
onHelp(ControlRequestContext ctx,
java.lang.String helpId)
Default Handler for the Help Event |
private void |
readObject(java.io.ObjectInputStream in)
Read the non-static and non-transient fields of the current class from this stream. |
void |
setAjaxAttribute(ControlRequestContext ctx,
java.lang.String name,
java.lang.Object value)
|
void |
setHandler(ClientEvent event,
java.lang.String handler)
Registers a client handler for an client event |
void |
setPrincipal(Principal principal)
Sets the principal object |
void |
setValue(RequestContext ctx,
ControlValuePath path,
java.lang.String[] values)
This method is called to set the value of the data model |
boolean |
show(Principal principal)
Checks if the Object has a required permission. |
boolean |
showButton(ControlButton button)
This Method is called by the Painter before rendering a Button. |
void |
synchronizeState(PropertyMap properties)
This method applies the given state properties to the controls state model |
void |
synchronizeState(RequestContext ctx,
PropertyMap properties)
This method applies the given state properties to the controls state model |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
private static final java.lang.String ERR_ACTION
private static final java.lang.String ERR_MISSING_CTX
protected transient org.apache.commons.logging.Log log
private transient Principal principal
private java.util.Collection buttons
Collection<Control>
Constructor Detail |
public Control()
Method Detail |
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- the input stream
java.io.IOException
- if an I/O error occurs.
java.lang.ClassNotFoundException
- if the class of a serialized object could not be found.public java.lang.String getId()
public java.lang.String getName()
public boolean getTransaction()
ActionBehavior
getTransaction
in interface ActionBehavior
true
if the transaction token should be generatedActionBehavior.getTransaction()
public boolean isAjaxEnabled()
ActionBehavior
isAjaxEnabled
in interface ActionBehavior
true
when the control should send AJAX
requests.ActionBehavior.isAjaxEnabled()
public abstract ControlDesignModel getDesignModel()
public abstract DataModel getDataModel()
public abstract StateModel getStateModel()
public boolean isFormElement()
true
if the control acts like a form element.public java.lang.String getAction()
public java.lang.String getWidth()
public java.lang.String getHeight()
public java.lang.String getProperty()
public java.lang.String getControlName()
public RunAt getRunAt()
public boolean allowAjaxRendering()
Some controls can not be rendered without JSP processing.
true
when the control can be rendered in
an AJAX responsepublic java.lang.String getAjaxId()
null
when
the control is not AJAX relevant. A Control can be AJAX relevant although
it has been configured with ajax="false" because one of its child
components is AJAX relevant!
null
public java.lang.String getUniqueStyleId()
public java.lang.String getStyle()
public java.lang.String getHelp()
public java.lang.String getTooltip()
null
public java.lang.String getSummary()
null
public int getTabIndex()
null
public java.lang.String getStyleId()
public java.lang.String getStyleClass()
public boolean isDisabled()
public void setHandler(ClientEvent event, java.lang.String handler)
ClientHandler
setHandler
in interface ClientHandler
event
- The client event (like onClick, onMouseOver, ...)handler
- The script handler associated with the eventClientHandler.setHandler(com.cc.framework.ui.model.ClientEvent,
java.lang.String)
public java.lang.String getHandler(ClientEvent event)
getHandler
in interface ClientHandler
event
- The event (like onClick, onMouseOver, ...)
null
if no handler
was associated.public ClientEvent[] getHandlers()
getHandlers
in interface ClientHandler
public boolean showButton(ControlButton button)
button
- ControlButton
public java.lang.String getFrameworkString(java.lang.String resourceId, java.lang.Object[] arguments, java.util.Locale locale)
null
.
resourceId
- the resource identifierarguments
- array with arguments for text markupslocale
- the locale
null
to let the
framework resolve the resource identifierpublic Principal getPrincipal()
public void setPrincipal(Principal principal)
principal
- The principal objectpublic java.lang.String getLocaleName()
public DesignRule[] getDesignRules()
public Permission getPermission()
AccessControlled
null
no access rights is required.
getPermission
in interface AccessControlled
AccessControlled.getPermission()
public boolean show(Principal principal)
AccessControlled
show
in interface AccessControlled
principal
- the users principal object
true
if the permission existsAccessControlled.show(com.cc.framework.security.Principal)
public void addButton(Control button)
button
- The button to addpublic java.util.Collection getButtons()
null
public void synchronizeState(PropertyMap properties) throws java.lang.Exception
properties
- State properties
java.lang.Exception
- is thrown when an error occurs during executionpublic void synchronizeState(RequestContext ctx, PropertyMap properties) throws java.lang.Exception
ctx
- RequestContextproperties
- State properties
java.lang.Exception
- is thrown when an error occurs during executionpublic void setValue(RequestContext ctx, ControlValuePath path, java.lang.String[] values) throws java.lang.Exception
ctx
- The Action Contextpath
- Path Name of the input elementvalues
- the values to set
java.lang.Exception
- a derived class can throw an exception if the value could not
be setpublic void execute(ControlRequestContext ctx) throws java.lang.Exception
ctx
- ControlRequestContext
java.lang.Exception
- is thrown when an error occurs during executionpublic void execute(ControlRequestContext ctx, java.lang.Object p1) throws java.lang.Exception
ctx
- ControlRequestContextp1
- Optional parameter 1
java.lang.Exception
- is thrown when an error occurs during executionpublic void execute(ControlRequestContext ctx, java.lang.Object p1, java.lang.Object p2) throws java.lang.Exception
ctx
- ControlRequestContextp1
- Optional parameter 1p2
- Optional parameter 2
java.lang.Exception
- is thrown when an error occurs during executionpublic void execute(ControlRequestContext ctx, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3) throws java.lang.Exception
ctx
- ControlRequestContextp1
- Optional parameter 1p2
- Optional parameter 2p3
- Optional parameter 3
java.lang.Exception
- is thrown when an error occurs during executionpublic void execute(ControlRequestContext ctx, java.lang.Object[] params) throws java.lang.Exception
ctx
- ControlRequestContextparams
- Parameter
java.lang.Exception
- is thrown when an error occurs during executionpublic void execute(ControlRequestContext ctx, java.util.Collection params) throws java.lang.Exception
ctx
- ControlRequestContextparams
- Parameter
java.lang.Exception
- is thrown when an error occurs during executionpublic void execute(java.lang.Object[] params) throws java.lang.Exception
params
- Parameter
java.lang.Exception
- is thrown when an error occurs during executionpublic void markDirty(ControlRequestContext ctx)
This is also the last chance for a control to cancel the AJAX request.
For example the list control can not render itself when it contains a HTML column. For that column type the JSP page has to be processed again. and the AJAX request has to be canceled. But when the list control has no HTML column it has all information to render itself without JSP processing!
ctx
- the action contextpublic void setAjaxAttribute(ControlRequestContext ctx, java.lang.String name, java.lang.Object value)
ctx
- the action contextname
- the attribute namevalue
- the attribute valuepublic void onHelp(ControlRequestContext ctx, java.lang.String helpId) throws java.lang.Exception
ctx
- ControlRequestContexthelpId
- The Help Id of the Control
java.lang.Exception
- is thrown when an error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |