congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
RuleModeller
Code IndexAdd Tabnine to your IDE (free)

How to use
RuleModeller
in
org.kie.guvnor.guided.rule.client.editor

Best Java code snippets using org.kie.guvnor.guided.rule.client.editor.RuleModeller (Showing top 20 results out of 315)

origin: org.kie.guvnor/guvnor-guided-rule-editor-client

@Override
public void setContent( final Path path,
            final RuleModel model,
            final DataModelOracle dataModel,
            final boolean isReadOnly,
            final boolean isDSLEnabled ) {
  modeller = new RuleModeller( path,
                 model,
                 dataModel,
                 new RuleModellerWidgetFactory(),
                 localBus,
                 isReadOnly,
                 isDSLEnabled );
  panel.add( this.modeller );
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

private void clearLinesIcons( int col ) {
  for ( int i = 0; i < layout.getRowCount(); i++ ) {
    this.clearLineIcons( i,
               col );
  }
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

public RuleModeller( final Path path,
           final RuleModel model,
           final DataModelOracle dataModel,
           final ModellerWidgetFactory widgetFactory,
           final RuleModellerConfiguration configuration,
           final EventBus eventBus,
           final boolean isReadOnly ) {
  this.path = path;
  this.model = model;
  this.dataModel = dataModel;
  this.widgetFactory = widgetFactory;
  this.configuration = configuration;
  this.eventBus = eventBus;
  this.isReadOnly = isReadOnly;
  doLayout();
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

@Override
public boolean isDirty() {
  //The Modeller widget isn't set until after the content has been loaded from an asynchronous call to
  //the server. It is therefore possible that the User attempts to close the tab before Modeller is set
  return ( modeller == null ) ? false : modeller.getRuleModeller().isDirty();
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

private boolean isLHSFieldTypeEquivalent( String boundVariable ) {
  String boundFieldType = modeller.getModel().getLHSBindingType( boundVariable );
  //If the fieldTypes are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent
  if ( boundFieldType.equals( DataType.TYPE_COMPARABLE ) ) {
    if ( !this.variableType.equals( DataType.TYPE_COMPARABLE ) ) {
      return false;
    }
    FieldConstraint fc = this.modeller.getModel().getLHSBoundField( boundVariable );
    if ( fc instanceof SingleFieldConstraint ) {
      String fieldName = ( (SingleFieldConstraint) fc ).getFieldName();
      String parentFactTypeForBinding = this.modeller.getModel().getLHSParentFactPatternForBinding( boundVariable ).getFactType();
      String[] dd = this.modeller.getSuggestionCompletions().getEnumValues( parentFactTypeForBinding,
                                         fieldName );
      return isEnumEquivalent( dd );
    }
    return false;
  }
  //If the fieldTypes are identical (and not SuggestionCompletionEngine.TYPE_COMPARABLE) then return true
  if ( boundFieldType.equals( this.variableType ) ) {
    return true;
  }
  return false;
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

  public void onClick( ClickEvent event ) {
    if ( Window.confirm( Constants.INSTANCE.RemoveThisItem() ) ) {
      model.removeField( idx );
      setModified( true );
      getModeller().refreshWidget();
      //Signal possible change in Template variables
      TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent( getModeller().getModel() );
      getEventBus().fireEventFromSource( tvce,
                        getModeller().getModel() );
    }
  }
} );
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

Boolean readOnly = this.lockRHS() ? true : null;
RuleModellerWidget w = getWidgetFactory().getWidget( this,
                           eventBus,
                           action,
w.addOnModifiedCommand( this.onWidgetModifiedCommand );
widget.add( wrapRHSWidget( model,
              i,
              w ) );
widget.add( spacerWidget() );
         this.wrapLineNumber( i + 1,
                    false ) );
layout.getFlexCellFormatter().setHorizontalAlignment( currentLayoutRow,
  final Image image = GuidedRuleEditorImages508.INSTANCE.Error();
  image.setTitle( Constants.INSTANCE.InvalidPatternSectionDisabled() );
  this.addLineIcon( currentLayoutRow,
           0,
           image );
if ( !( this.lockRHS() || w.isReadOnly() ) ) {
  this.addActionsButtonsToLayout( Constants.INSTANCE.AddAnActionBelow(),
                  new ClickHandler() {
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

Boolean readOnly = this.lockLHS() ? true : null;
RuleModellerWidget w = getWidgetFactory().getWidget( this,
                           eventBus,
                           pattern,
w.addOnModifiedCommand( this.onWidgetModifiedCommand );
vert.add( wrapLHSWidget( model,
             i,
             w ) );
vert.add( spacerWidget() );
         this.wrapLineNumber( i + 1,
                    true ) );
layout.getFlexCellFormatter().setHorizontalAlignment( currentLayoutRow,
  final Image image = GuidedRuleEditorImages508.INSTANCE.Error();
  image.setTitle( Constants.INSTANCE.InvalidPatternSectionDisabled() );
  this.addLineIcon( currentLayoutRow,
           0,
           image );
if ( !( this.lockLHS() || w.isReadOnly() ) ) {
  this.addActionsButtonsToLayout( Constants.INSTANCE.AddAConditionBelow(),
                  new ClickHandler() {
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

/**
 * Returns the completions.
 */
public DataModelOracle getCompletions() {
  return this.modeller.getSuggestionCompletions();
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

@Override
public RuleModel getContent() {
  return modeller.getModel();
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

final CustomFormConfiguration customFormConfiguration = getWorkingSetManager().getCustomFormConfiguration( this.getModeller().getPath(),
                                                      factType,
                                                      field );
  editorReadOnly = !this.getModeller().getSuggestionCompletions().isFactTypeRecognized( factType );
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

             final BaseSingleFieldConstraint con ) {
CustomFormConfiguration customFormConfiguration = getWorkingSetManager().getCustomFormConfiguration( modeller.getPath(),
                                                   factType,
                                                   fieldName );
if ( modeller.isTemplate() ) {
  String templateKeyLabel = Constants.INSTANCE.TemplateKey();
  Button templateKeyButton = new Button( templateKeyLabel );
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

private void renderOptions( final int optionsRowIndex ) {
  layout.setWidget( optionsRowIndex,
           2,
           new SmallLabel( Constants.INSTANCE.optionsRuleModeller() ) );
  if ( !isReadOnly ) {
    layout.setWidget( optionsRowIndex,
             4,
             getAddAttribute() );
  }
  layout.setWidget( optionsRowIndex + 1,
           3,
           new RuleAttributeWidget( this,
                        this.model,
                        isReadOnly ) );
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

CustomFormConfiguration customFormConfiguration = getWorkingSetManager().getCustomFormConfiguration( modeller.getPath(),
                                                   factType,
                                                   fieldName );
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

private boolean isLHSFactTypeEquivalent( String boundVariable ) {
  String boundFactType = modeller.getModel().getLHSBoundFact( boundVariable ).getFactType();
  //If the types are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent
  if ( boundFactType.equals( DataType.TYPE_COMPARABLE ) ) {
    if ( !this.variableType.equals( DataType.TYPE_COMPARABLE ) ) {
      return false;
    }
    String[] dd = this.modeller.getSuggestionCompletions().getEnumValues( boundFactType,
                                       this.value.getField() );
    return isEnumEquivalent( dd );
  }
  //If the types are identical (and not SuggestionCompletionEngine.TYPE_COMPARABLE) then return true
  if ( boundFactType.equals( this.variableType ) ) {
    return true;
  }
  return false;
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

private DataModelOracle getCompletionEngine() {
  return this.getModeller().getSuggestionCompletions();
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

  public void onClick( ClickEvent event ) {
    if ( Window.confirm( Constants.INSTANCE.RemoveThisItem() ) ) {
      model.removeField( idx );
      setModified( true );
      getModeller().refreshWidget();
      //Signal possible change in Template variables
      TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent( getModeller().getModel() );
      getEventBus().fireEventFromSource( tvce,
                        getModeller().getModel() );
    }
  }
} );
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

private RuleModel getRuleModel() {
  return this.getModeller().getModel();
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

private boolean isRHSFieldTypeEquivalent( String boundVariable ) {
  String boundFactType = modeller.getModel().getRHSBoundFact( boundVariable ).getFactType();
  if ( boundFactType == null ) {
    return false;
  }
  if ( this.variableType == null ) {
    return false;
  }
  //If the types are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent
  if ( boundFactType.equals( DataType.TYPE_COMPARABLE ) ) {
    if ( !this.variableType.equals( DataType.TYPE_COMPARABLE ) ) {
      return false;
    }
    String[] dd = this.modeller.getSuggestionCompletions().getEnumValues( boundFactType,
                                       this.value.getField() );
    return isEnumEquivalent( dd );
  }
  //If the types are identical (and not SuggestionCompletionEngine.TYPE_COMPARABLE) then return true
  if ( boundFactType.equals( this.variableType ) ) {
    return true;
  }
  return false;
}
origin: org.kie.guvnor/guvnor-guided-rule-editor-client

/**
 * Pops up the fact selector.
 */
protected void showConditionSelector( Integer position ) {
  RuleModellerConditionSelectorPopup popup = new RuleModellerConditionSelectorPopup( model,
                                            this,
                                            position,
                                            getSuggestionCompletions() );
  popup.show();
}
org.kie.guvnor.guided.rule.client.editorRuleModeller

Javadoc

This is the parent widget that contains the model based rule builder.

Most used methods

  • <init>
  • addActionsButtonsToLayout
  • addLineIcon
  • clearLineIcons
  • doLayout
  • getAddAttribute
  • getModel
  • getPath
  • getRuleModeller
  • getSuggestionCompletions
  • getWidgetFactory
  • initWidget
  • getWidgetFactory,
  • initWidget,
  • isDSLEnabled,
  • isDirty,
  • isLock,
  • isReadOnly,
  • isTemplate,
  • isVariableNameUsed,
  • lockLHS,
  • lockRHS

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Reference (javax.naming)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now