public class IlrPropertyEditor
extends javax.faces.component.UICommand
implements ilog.rules.teamserver.web.components.property.PropertyEditor, java.io.Serializable
IlrPropertyEditor is the base class for property editing in
the Decision Center web client.
IlrPropertyEditor:
public void encodeValueField(FacesContext context, UIComponent component,
boolean checkPermission) throws IOException,
IlrApplicationException {
log.log(Level.WARNING, "Start encodeValueField");
IlrPropertyEditor editor = (IlrPropertyEditor) component;
if (checkPermission && !editor.isPermissionGranted())
super.encodeValueField(context, component, checkPermission);
else {
ResponseWriter writer = context.getResponseWriter();
EStructuralFeature p = editor.getProperty();
// Get the correct key of the property to set
String key = component.getParent().getClientId(context) + "_" + //work around a jsf bug : sometimes 2 different components get the same generated id.
component.getClientId(context) + "_" + p.getName();
// Get the current string value of the property to be used in JavaScript
// Be aware that editor.getValueString() returns the value ready to be shown in HTML
String value = "";
if (editor.getValue() != null)
value = (editor.getValue()).toString();
// Write HTML code with a JavaScript function to set the property value
writer.write(...);
...
}
}
| Type | Property and Description |
|---|---|
boolean |
isAggregated
Checks if the property of this editor is aggregated.
|
| Modifier and Type | Method and Description |
|---|---|
IlrCommitableObject |
getCommitableObject() |
IlxWComponent |
getComponent() |
IlrCommitableObject |
getComposedElement()
Gets the commitable object currently being edited.
|
org.eclipse.emf.ecore.EClass |
getEClass() |
org.eclipse.emf.ecore.EStructuralFeature |
getProperty()
Returns the EMF property rendered by this editor.
|
java.lang.String |
getPropertyName()
Returns the name of the property.
|
java.lang.Object |
getValue()
Returns the value rendered by this editor.
|
java.lang.String |
getValueString()
Retrieves an HTML ready
String for the value displayed by
this editor. |
boolean |
isAggregatedProperty()
Checks if the property of this editor is aggregated.
|
boolean |
isPermissionGranted()
Checks if the current user has the rights to edit an element.
|
boolean |
isValueChanged() |
void |
setCommitableObject(IlrCommitableObject commitableObject) |
void |
setComponent(IlxWComponent component) |
void |
setValue(java.lang.Object value)
Sets the value to be rendered by this editor.
|
void |
setValueChanged(boolean valueChanged) |
addActionListener, broadcast, getAction, getActionListener, getActionListeners, getFamily, isImmediate, queueEvent, removeActionListener, restoreState, saveState, setAction, setActionListener, setImmediateaddFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBindingfalse.public boolean isAggregatedProperty()
false.public org.eclipse.emf.ecore.EClass getEClass()
public IlrCommitableObject getCommitableObject()
public void setCommitableObject(IlrCommitableObject commitableObject)
public boolean isValueChanged()
public void setValueChanged(boolean valueChanged)
public IlrCommitableObject getComposedElement()
ilog.rules.teamserver.web.components.property.PropertyEditorThis method will be used only when this component is in "editor" mode, meaning that it is embedded in an IlrUIElementDetailsEditor component.
getComposedElement in interface ilog.rules.teamserver.web.components.property.PropertyEditorpublic java.lang.String getValueString()
throws IlrApplicationException
String for the value displayed by
this editor.IlrApplicationException - if there is a problem on the server.String representing the value.public boolean isPermissionGranted()
isPermissionGranted in interface ilog.rules.teamserver.web.components.property.PropertyEditortrue is returned.public void setValue(java.lang.Object value)
setValue in interface ilog.rules.teamserver.web.components.property.PropertyEditorsetValue in class javax.faces.component.UICommandvalue - The value to render.public org.eclipse.emf.ecore.EStructuralFeature getProperty()
getProperty in interface ilog.rules.teamserver.web.components.property.PropertyEditorpublic java.lang.String getPropertyName()
getPropertyName in interface ilog.rules.teamserver.web.components.property.PropertyEditorpublic java.lang.Object getValue()
getValue in interface ilog.rules.teamserver.web.components.property.PropertyEditorgetValue in class javax.faces.component.UICommandpublic IlxWComponent getComponent()
public void setComponent(IlxWComponent component)
© Copyright IBM Corp. 1987, 2017