org.drools.guvnor.client.asseteditor.drools.modeldriven.ui
Class DSLSentenceWidget

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.drools.guvnor.client.common.DirtyableComposite
                  extended by org.drools.guvnor.client.asseteditor.drools.modeldriven.ui.RuleModellerWidget
                      extended by org.drools.guvnor.client.asseteditor.drools.modeldriven.ui.DSLSentenceWidget
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget, DirtyableWidget, IDirtyable

public class DSLSentenceWidget
extends RuleModellerWidget

This displays a widget to edit a DSL sentence.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class org.drools.guvnor.client.common.DirtyableComposite
dirtyflag
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DSLSentenceWidget(RuleModeller modeller, com.google.gwt.event.shared.EventBus eventBus, DSLSentence sentence, Boolean readOnly)
           
 
Method Summary
 com.google.gwt.user.client.ui.Widget getBox(DSLVariableValue variableDef, String regex)
           
 com.google.gwt.user.client.ui.Widget getBox(DSLVariableValue variableDef, String regex, boolean readonly)
           
 com.google.gwt.user.client.ui.Widget getCheckbox(String variableDef, DSLVariableValue value)
           
 com.google.gwt.user.client.ui.Widget getCustomFormEditor(String variableDef, DSLVariableValue value)
          If there is an active working-set defining a custom form configuration for the factType and field defined by variableDef, then a button a custom form editor (aka Widget wrapping a button) is returned.
 com.google.gwt.user.client.ui.Widget getDateSelector(String variableDef, DSLVariableValue value)
           
 com.google.gwt.user.client.ui.Widget getEnumDropdown(String variableDef, DSLVariableValue value)
           
 com.google.gwt.user.client.ui.Widget getLabel(String labelDef)
           
 boolean isFactTypeKnown()
          Does the Fact Type the Widget represents known to the SuggestionCompletionEngine.
 boolean isReadOnly()
          Dictates if the widget's state is RO or not.
 void makeWidgets(DSLSentence sentence)
          This will take a DSL line item, and split it into widget thingamies for displaying.
 com.google.gwt.user.client.ui.Widget processVariable(String currVariable, DSLVariableValue value)
           
protected  void updateSentence()
          This will go through the widgets and extract the values
 
Methods inherited from class org.drools.guvnor.client.asseteditor.drools.modeldriven.ui.RuleModellerWidget
addOnModifiedCommand, getEventBus, getModeller, isModified, setModified
 
Methods inherited from class org.drools.guvnor.client.common.DirtyableComposite
getHeight, getWidth, isDirty, makeDirty, onBrowserEvent, resetDirty
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onDetach, performDetachedInitialization, render, render, resolvePotentialElement, setWidget, wrapElement
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DSLSentenceWidget

public DSLSentenceWidget(RuleModeller modeller,
                         com.google.gwt.event.shared.EventBus eventBus,
                         DSLSentence sentence,
                         Boolean readOnly)
Method Detail

makeWidgets

public void makeWidgets(DSLSentence sentence)
This will take a DSL line item, and split it into widget thingamies for displaying. One day, if this is too complex, this will have to be done on the server side.


processVariable

public com.google.gwt.user.client.ui.Widget processVariable(String currVariable,
                                                            DSLVariableValue value)

getEnumDropdown

public com.google.gwt.user.client.ui.Widget getEnumDropdown(String variableDef,
                                                            DSLVariableValue value)

getBox

public com.google.gwt.user.client.ui.Widget getBox(DSLVariableValue variableDef,
                                                   String regex)

getBox

public com.google.gwt.user.client.ui.Widget getBox(DSLVariableValue variableDef,
                                                   String regex,
                                                   boolean readonly)

getCheckbox

public com.google.gwt.user.client.ui.Widget getCheckbox(String variableDef,
                                                        DSLVariableValue value)

getCustomFormEditor

public com.google.gwt.user.client.ui.Widget getCustomFormEditor(String variableDef,
                                                                DSLVariableValue value)
If there is an active working-set defining a custom form configuration for the factType and field defined by variableDef, then a button a custom form editor (aka Widget wrapping a button) is returned. Otherwise, the result of getBox(org.drools.ide.common.client.modeldriven.brl.DSLVariableValue, java.lang.String) is returned.

Parameters:
variableDef -
value -
Returns:

getDateSelector

public com.google.gwt.user.client.ui.Widget getDateSelector(String variableDef,
                                                            DSLVariableValue value)

getLabel

public com.google.gwt.user.client.ui.Widget getLabel(String labelDef)

updateSentence

protected void updateSentence()
This will go through the widgets and extract the values


isReadOnly

public boolean isReadOnly()
Description copied from class: RuleModellerWidget
Dictates if the widget's state is RO or not. Sometimes RuleModeller will force this state (i.e. when lockLHS() or lockRHS()), but some other times, the widget itself is responsible to autodetect its state.

Specified by:
isReadOnly in class RuleModellerWidget
Returns:

isFactTypeKnown

public boolean isFactTypeKnown()
Description copied from class: RuleModellerWidget
Does the Fact Type the Widget represents known to the SuggestionCompletionEngine. If the Fact Type is known the Widget can be edited or deleted (unless read-only). If the Fact Type is not known the Widget can be deleted but cannot be edited (i.e. it is always read-only).

Specified by:
isFactTypeKnown in class RuleModellerWidget
Returns:


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.