org.rcfaces.core.component
Class AcceleratorComponent

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UICommand
              extended by org.rcfaces.core.internal.component.CameliaCommandComponent
                  extended by org.rcfaces.core.component.AcceleratorComponent
All Implemented Interfaces:
ActionSource, ActionSource2, StateHolder, IForCapability, IImmediateCapability, IKeyPressEventCapability, IValidationEventCapability, org.rcfaces.core.internal.capability.IComponentLifeCycle, org.rcfaces.core.internal.capability.IRCFacesComponent, org.rcfaces.core.internal.manager.IContainerManager, org.rcfaces.core.internal.manager.ITransientAttributesManager

public class AcceleratorComponent
extends org.rcfaces.core.internal.component.CameliaCommandComponent
implements IKeyPressEventCapability, IImmediateCapability, IValidationEventCapability, IForCapability

The accelerator Component is a non-visual component.

It allows to associate an accelerator key to an action or another component.

The accelerator Component has the following capabilities :

The default accelerator renderer is linked to the f_accelerator javascript class. f_accelerator extends f_object, fa_immediate, fa_eventTarget


Field Summary
protected static Set CAMELIA_ATTRIBUTES
           
static String COMPONENT_TYPE
           
 
Fields inherited from class org.rcfaces.core.internal.component.CameliaCommandComponent
engine
 
Fields inherited from class javax.faces.component.UICommand
COMPONENT_FAMILY
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
AcceleratorComponent()
           
AcceleratorComponent(String componentId)
           
 
Method Summary
 void addKeyPressListener(IKeyPressListener listener)
          Adds a listener to the component for the keyPress event
 void addValidationListener(IValidationListener listener)
          Adds a listener to the component for the validation event
protected  Set getCameliaFields()
           
 String getFor()
          Returns a component's id that express the link between the two components.
 String getFor(FacesContext facesContext)
          See getFor() for more details
 String getForItemValue()
          Returns a string specifying a value to select in the component identified in the for property.
 String getForItemValue(FacesContext facesContext)
          Returns a string specifying a value to select in the component identified in the for property.
 String getKeyBinding()
          Returns a string value specifying the key associated to the component. for example "Alt+F1"
 String getKeyBinding(FacesContext facesContext)
          Returns a string value specifying the key associated to the component. for example "Alt+F1"
 boolean isForItemValueSetted()
          Returns true if the attribute "forItemValue" is set.
 boolean isForSetted()
          Returns true if the attribute "for" is set.
 boolean isIgnoreEditableComponent()
           
 boolean isIgnoreEditableComponent(FacesContext facesContext)
           
 boolean isIgnoreEditableComponentSetted()
          Returns true if the attribute "ignoreEditableComponent" is set.
 boolean isKeyBindingSetted()
          Returns true if the attribute "keyBinding" is set.
 FacesListener[] listKeyPressListeners()
          Returns a list of keyPress listener for the component
 FacesListener[] listValidationListeners()
          Returns a list of validation listener for the component
 void removeKeyPressListener(IKeyPressListener listener)
          Removes a listener from the component for the keyPress event
 void removeValidationListener(IValidationListener listener)
          Removes a listener from the component for the validation event
 void setFor(String forValue)
          Sets a component's id that express the link between the two components.
 void setForItemValue(String forItemValue)
          Sets a string specifying a value to select in the component identified in the for property.
 void setIgnoreEditableComponent(boolean ignoreEditableComponent)
           
 void setKeyBinding(String keyBinding)
          Sets a string value specifying the key associated to the component. for example "Alt+F1"
 
Methods inherited from class org.rcfaces.core.internal.component.CameliaCommandComponent
broadcast, clearListeners, confirmListenerAppend, constructPhase, constructTemplate, decodePhase, encodeBegin, encodeChildren, encodeEnd, getAsyncRenderer, getCameliaValueAlias, getChildren, getChildrenListState, getFamily, getRendererType, getTransientAttribute, getValueExpression, hasDefaultProperties, initializeComponent, initializePhase, isClientRendered, isRendered, isTemplateComponent, processDecodes, processEngineUpdates, processEngineValidators, processUpdates, processValidators, queueEvent, renderPhase, restoreState, saveState, setDefaultProperties, setRendered, setTransientAttribute, setValueExpression, toString, updatePhase, validationPhase, verifyAsyncDecode
 
Methods inherited from class javax.faces.component.UICommand
addActionListener, getAction, getActionExpression, getActionListener, getActionListeners, getValue, isImmediate, removeActionListener, setAction, setActionExpression, setActionListener, setImmediate, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, findComponent, getAttributes, getChildCount, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendersChildren, getValueBinding, invokeOnComponent, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.rcfaces.core.component.capability.IImmediateCapability
isImmediate, setImmediate
 
Methods inherited from interface org.rcfaces.core.internal.manager.IContainerManager
getChildCount
 

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values

CAMELIA_ATTRIBUTES

protected static final Set CAMELIA_ATTRIBUTES
Constructor Detail

AcceleratorComponent

public AcceleratorComponent()

AcceleratorComponent

public AcceleratorComponent(String componentId)
Method Detail

addKeyPressListener

public final void addKeyPressListener(IKeyPressListener listener)
Description copied from interface: IKeyPressEventCapability
Adds a listener to the component for the keyPress event

Specified by:
addKeyPressListener in interface IKeyPressEventCapability
Parameters:
listener - the keyPress listener to add

removeKeyPressListener

public final void removeKeyPressListener(IKeyPressListener listener)
Description copied from interface: IKeyPressEventCapability
Removes a listener from the component for the keyPress event

Specified by:
removeKeyPressListener in interface IKeyPressEventCapability
Parameters:
listener - the keyPress listener to remove

listKeyPressListeners

public final FacesListener[] listKeyPressListeners()
Description copied from interface: IKeyPressEventCapability
Returns a list of keyPress listener for the component

Specified by:
listKeyPressListeners in interface IKeyPressEventCapability
Returns:
keyPress listeners' list

addValidationListener

public final void addValidationListener(IValidationListener listener)
Description copied from interface: IValidationEventCapability
Adds a listener to the component for the validation event

Specified by:
addValidationListener in interface IValidationEventCapability
Parameters:
listener - the validation listener to add

removeValidationListener

public final void removeValidationListener(IValidationListener listener)
Description copied from interface: IValidationEventCapability
Removes a listener from the component for the validation event

Specified by:
removeValidationListener in interface IValidationEventCapability
Parameters:
listener - the validation listener to remove

listValidationListeners

public final FacesListener[] listValidationListeners()
Description copied from interface: IValidationEventCapability
Returns a list of validation listener for the component

Specified by:
listValidationListeners in interface IValidationEventCapability
Returns:
validation listeners' list

getFor

public String getFor()
Description copied from interface: IForCapability
Returns a component's id that express the link between the two components.

Specified by:
getFor in interface IForCapability
Returns:
id for a linked component

getFor

public String getFor(FacesContext facesContext)
See getFor() for more details


isForSetted

public final boolean isForSetted()
Returns true if the attribute "for" is set.

Returns:
true if the attribute is set.

setFor

public void setFor(String forValue)
Description copied from interface: IForCapability
Sets a component's id that express the link between the two components.

Specified by:
setFor in interface IForCapability
Parameters:
forValue - id for a linked component

getForItemValue

public String getForItemValue()
Returns a string specifying a value to select in the component identified in the for property.

Returns:
value to selected

getForItemValue

public String getForItemValue(FacesContext facesContext)
Returns a string specifying a value to select in the component identified in the for property.

Returns:
value to selected

setForItemValue

public void setForItemValue(String forItemValue)
Sets a string specifying a value to select in the component identified in the for property.

Parameters:
forItemValue - value to select

isForItemValueSetted

public boolean isForItemValueSetted()
Returns true if the attribute "forItemValue" is set.

Returns:
true if the attribute is set.

getKeyBinding

public String getKeyBinding()
Returns a string value specifying the key associated to the component. for example "Alt+F1"

Returns:
key

getKeyBinding

public String getKeyBinding(FacesContext facesContext)
Returns a string value specifying the key associated to the component. for example "Alt+F1"

Returns:
key

setKeyBinding

public void setKeyBinding(String keyBinding)
Sets a string value specifying the key associated to the component. for example "Alt+F1"

Parameters:
keyBinding - key

isKeyBindingSetted

public boolean isKeyBindingSetted()
Returns true if the attribute "keyBinding" is set.

Returns:
true if the attribute is set.

isIgnoreEditableComponent

public boolean isIgnoreEditableComponent()

isIgnoreEditableComponent

public boolean isIgnoreEditableComponent(FacesContext facesContext)

setIgnoreEditableComponent

public void setIgnoreEditableComponent(boolean ignoreEditableComponent)

isIgnoreEditableComponentSetted

public boolean isIgnoreEditableComponentSetted()
Returns true if the attribute "ignoreEditableComponent" is set.

Returns:
true if the attribute is set.

getCameliaFields

protected Set getCameliaFields()
Overrides:
getCameliaFields in class org.rcfaces.core.internal.component.CameliaCommandComponent


Copyright © 2006-2011 Vedana. All Rights Reserved.