|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.webui.dhtml.IlxWContainer ilog.webui.dhtml.IlxWComponent ilog.rules.webui.IlrWSyntacticEditor
public class IlrWSyntacticEditor
IlrWSyntacticEditor
The Web Rule Editor can be integrated into your web application
to provide business rule editAllMode
capabilities.
The Web Rule Editor is associated with a token model that represents the business rules to be edited.
The following code example shows you how to create and initialize a syntactic editor:
private IlrWSyntacticEditor initializeSyntacticEditor(IlrSession rtsSession ,HttpSession session, IlrActionRule rule) throws IlrConnectException, IlrApplicationException, FileNotFoundException, IOException { IlxWManager manager = IlxWManager.getManager(session); IlrWSyntacticEditor syntacticEditor; synchronized (manager) { syntacticEditor = (IlrWSyntacticEditor) manager.getComponentNamed(EDITORNAME); if (syntacticEditor == null) { syntacticEditor = new IlrWSyntacticEditor(); syntacticEditor.setName(EDITORNAME); manager.add(syntacticEditor); } IlrWBRLSyntacticRuleElement ruleElement = getRuleElement(rtsSession, rule); syntacticEditor.setBRLRuleElement(ruleElement,rtsSession.getReferenceLocale()); syntacticEditor.setAttribute(ACTION_RULE_UUID_ATTRIBUTE_NAME, rule.getUuid()); syntacticEditor.setAuthorRules(new IlxWCSSRuleset(new InputStreamReader(RuleEditor.class.getClassLoader().getResourceAsStream("syntacticeditor.css") ))); //$NON-NLS-1$ } return syntacticEditor; }
IlrWBRLSyntacticRuleElement
,
IlrDTWTableComponent
,
Serialized Form
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ilog.webui.dhtml.IlxWComponent |
---|
IlxWComponent.DynamicStyleMap |
Field Summary | |
---|---|
static String |
CSS_RESOURCE_NAME
Resource path to the user-agent CSS. |
Fields inherited from class ilog.webui.dhtml.IlxWContainer |
---|
listenerList |
Constructor Summary | |
---|---|
IlrWSyntacticEditor()
Constructs a new Web Rule Editor. |
Method Summary | |
---|---|
void |
addTokenStyle(Vector tokens,
String styleName)
Adds a style to a set of edited tokens. |
boolean |
canRedo()
Specifies whether the redo action is possible. |
boolean |
canUndo()
Specifies whether the 'undo' action is possible. |
void |
clearTokenStyles(String styleName)
Removes a style from a set of edited tokens. |
void |
clearTokenStyles(Vector tokens,
String styleName)
Removes a style from a set of edited tokens. |
IlrWBRLSyntacticRuleElement |
getBRLRuleElement()
Gets the rule currently edited by this rule editor. |
Locale |
getLocale()
Gets the locale in which the current rule is edited. |
int |
getUndoLimit()
Gets the undo limit. |
protected IlxWCSSRuleset |
getUserAgentRules()
Gets the "user-agent" CSS rules. |
ilog.rules.brl.brldf.IlrBRLVariableProvider |
getVariableProvider()
Gets the variable provider used, if any. |
boolean |
isAutoEditMode()
Gets the automatic edit mode property. |
boolean |
isDHtml(IlxWPort port)
Gets the value of the DHTML property. |
boolean |
isEditable()
Returns the value of the Editable property. |
protected void |
make(IlxWPort port)
|
protected void |
printComponent(IlxWPort port)
Redefines the IlxWComponent.printComponent method. |
void |
redo()
Redo action. |
void |
setApplication(String application)
Deprecated. |
void |
setAutoEditMode(boolean auto)
Sets the automatic edit mode property. |
void |
setBRLRuleElement(ilog.rules.brl.IlrBRLRuleElement ruleElement,
ilog.rules.vocabulary.model.IlrVocabulary vocabulary)
Deprecated. Replaced by setBRLRuleElement(IlrWBRLSyntacticRuleElement, Locale) |
void |
setBRLRuleElement(IlrWBRLSyntacticRuleElement ruleElement,
Locale locale)
Sets the rule to be edited by this rule editor and the locale in which the element must be edited. |
void |
setDHtml(boolean dhtml)
Sets the value of the DHTML property. |
void |
setEditable(boolean editable)
Sets the Editable property. |
void |
setUndoLimit(int limit)
Sets the undo limit. |
void |
setVariableProvider(ilog.rules.brl.brldf.IlrBRLVariableProvider variableProvider)
Sets the variable provider to be used. |
void |
undo()
Undo action. |
Methods inherited from class ilog.webui.dhtml.IlxWComponent |
---|
addPropertyChangeListener, addPropertyChangeListener, detach, doPrint, firePropertyChange, firePropertyChange, getName, getRealHtmlTagName, getStyle, invalidate, isInvalidated, notifyDependencies, print, removePropertyChangeListener, removePropertyChangeListener, setName, validate |
Methods inherited from class ilog.webui.dhtml.IlxWContainer |
---|
add, add, getAttribute, getAttributeNames, getComponent, getComponentCount, getComponentNamed, getComponents, getManager, getParent, indexOf, isAncestorOf, remove, remove, removeAll, removeAttribute, setAttribute, setAuthorRules, setFinalizer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CSS_RESOURCE_NAME
Constructor Detail |
---|
public IlrWSyntacticEditor()
Constructs a new Web Rule Editor.
Method Detail |
---|
public void setDHtml(boolean dhtml)
DHTML
property.
When this property is true
and the browser has DHTML
capabilities, the editor is displayed with a smart user
interface, using some advanced features of the DHTML capabilities
provided by the Web browser. By default, this flag is true
with IE5.x, and false
with other Web browsers, like
Netscape 3 or Netscape 4.
If the browser does not support this mode, setting this flag has no effect.
dhtml
- The new value of the DHTML
property.isDHtml(ilog.webui.dhtml.IlxWPort)
public boolean isDHtml(IlxWPort port)
Gets the value of the DHTML
property.
true
if the Web Rule Editor is in DHTML mode
and the browser supports this mode; false
otherwise.setDHtml(boolean)
public boolean isEditable()
Returns the value of the Editable property.
public void setEditable(boolean editable)
Sets the Editable property.
This property manages the editAllMode mode. When true
,
the token model can be modified. When false
, the editor
is in read-only mode.
The default value for this property is true
.
protected void printComponent(IlxWPort port) throws IOException
Redefines the IlxWComponent.printComponent
method.
printComponent
in class IlxWComponent
IOException
port
- The port on which the component will be printed.IlxWComponent.print(ilog.webui.dhtml.IlxWPort)
public void addTokenStyle(Vector tokens, String styleName)
Adds a style to a set of edited tokens.
tokens
- A Vector
containing edited IlrToken
objects.styleName
- The name of a style defined in
the current graphic resources.clearTokenStyles(Vector, String)
public void clearTokenStyles(Vector tokens, String styleName)
Removes a style from a set of edited tokens.
tokens
- A Vector
containing edited IlrToken
objects.styleName
- The name of a style defined in
the current graphic resources.addTokenStyle(Vector, String)
public void clearTokenStyles(String styleName)
Removes a style from a set of edited tokens.
styleName
- The name of a style defined in
the current graphic resources.addTokenStyle(Vector, String)
public void setBRLRuleElement(IlrWBRLSyntacticRuleElement ruleElement, Locale locale)
ruleElement
- The rule to be edited.locale
- The locale in which the rule should be edited.public IlrWBRLSyntacticRuleElement getBRLRuleElement()
public Locale getLocale()
public void setBRLRuleElement(ilog.rules.brl.IlrBRLRuleElement ruleElement, ilog.rules.vocabulary.model.IlrVocabulary vocabulary)
setBRLRuleElement(IlrWBRLSyntacticRuleElement, Locale)
ruleElement
- The rule to be edited.public void setVariableProvider(ilog.rules.brl.brldf.IlrBRLVariableProvider variableProvider)
variableProvider
- The variable provider.public ilog.rules.brl.brldf.IlrBRLVariableProvider getVariableProvider()
public boolean isAutoEditMode()
Gets the automatic edit mode property.
If this property is true
and the dhtml
property is false, the editAllMode mode of a line of the Web Rule Editor
(editable or read-only) will be automatically computed. Otherwise it
will be read-only by default, and editable if the user clicks on the
"edit mode" icon at the end of the line.
public void setAutoEditMode(boolean auto)
Sets the automatic edit mode property.
isAutoEditMode()
protected void make(IlxWPort port) throws IOException
IOException
protected IlxWCSSRuleset getUserAgentRules()
IlxWContainer
setAuthorRules
method.
This method returns null
by default but is intended
to be redefined by subclasses.
getUserAgentRules
in class IlxWContainer
IlxWContainer.setAuthorRules(ilog.webui.dhtml.IlxWCSSRuleset)
public void setUndoLimit(int limit)
Sets the undo limit.
By default the undo limit is set to 100.
limit
- The new undo limit (an integer greater or equal to 0).getUndoLimit()
public int getUndoLimit()
Gets the undo limit.
setUndoLimit(int)
public void undo()
If the undo is not possible, this method has no effect.
public boolean canUndo()
Specifies whether the 'undo' action is possible.
public void redo()
If the redo is not possible, this method has no effect.
public boolean canRedo()
Specifies whether the redo action is possible.
public void setApplication(String application)
IlrWSyntacticEditor
. It needs to be done before any
call to the setTokenModel
method.
If you do not know your SAM application name, run your application without setting the application name and look at the console output. You should see a warning message indicating that you have not set the SAM application name along with the list of the possible SAM application names. If you do not see the message, you probably only have one application and in this case, you do not need to set the SAM application name and you can ignore this method. For any further question, please contact ILOG Customer Support.
Note that an alternative way to set
the SAM application name is to set the system property
ilog.sam.application
.
application
- SAM application name of the application.
|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |