Package org.drools.guvnor.client.modeldriven

Examples of org.drools.guvnor.client.modeldriven.SuggestionCompletionEngine


    public void testAddDSLSentence() {
        final String input = "{This} is a {pattern} considered pretty \\{{easy}\\} by most \\{people\\}. What do you {say}?";
        this.builder.addDSLActionSentence( input );
        this.builder.addDSLConditionSentence( "foo bar" );
        final SuggestionCompletionEngine engine = this.builder.getInstance();

        assertEquals( 1, engine.actionDSLSentences.length );
        assertEquals( 1, engine.conditionDSLSentences.length );

    }
View Full Code Here


      this.builder.addDSLMapping(new DSLMap(DSLMappingEntry.CONDITION, "cond"));
      this.builder.addDSLMapping(new DSLMap(DSLMappingEntry.CONSEQUENCE, "cons"));
      this.builder.addDSLMapping(new DSLMap(DSLMappingEntry.ANY, "any"));
      this.builder.addDSLMapping(new DSLMap(DSLMappingEntry.KEYWORD, "key"));

        final SuggestionCompletionEngine engine = this.builder.getInstance();

        assertEquals( 1, engine.actionDSLSentences.length );
        assertEquals( 1, engine.conditionDSLSentences.length );
        assertEquals( 1, engine.keywordDSLItems.length );
        assertEquals( 1, engine.anyScopeDSLItems.length );
View Full Code Here

    /**
     * @param con The constraint being edited.
     */
    public ConstraintValueEditor(FactPattern pattern, String fieldName, ISingleFieldConstraint con, RuleModeller modeller, String valueType /* eg is numeric */) {
        this.constraint = con;
        SuggestionCompletionEngine sce = modeller.getSuggestionCompletions();
        if ( SuggestionCompletionEngine.TYPE_NUMERIC.equals(valueType)) {
            this.numericValue = true;
        } else {
            this.numericValue = false;
        }
        if (SuggestionCompletionEngine.TYPE_BOOLEAN.equals(valueType)) {
            this.dropDownData = DropDownData.create(new String[] {"true", "false" }); //NON-NLS
        } else {
          this.dropDownData = sce.getEnums(pattern, fieldName);
        }
        this.model = modeller.getModel();



View Full Code Here


    }

    public SuggestionCompletionEngine getEngineFromCache(String packageName) {
        SuggestionCompletionEngine eng = (SuggestionCompletionEngine) cache.get( packageName );
        if (eng == null) {
            ErrorPopup.showMessage(constants.UnableToGetContentAssistanceForThisRule());
            return null;
        }
        return eng;
View Full Code Here

//        text.setHeight( "100%" );
        text.setVisibleLines( 16 );
        text.setText( data.content );
        text.setTitle(constants.DSLPopupHint());

        SuggestionCompletionEngine eng = SuggestionCompletionCache.getInstance().getEngineFromCache( asset.metaData.packageName );
        this.actions = eng.actionDSLSentences;
        this.conditions = eng.conditionDSLSentences;

        text.setStyleName( "dsl-text-Editor" ); //NON-NLS
View Full Code Here

        // populating DSL sentences
        this.populateDSLSentences( dsls );



        SuggestionCompletionEngine sce = this.builder.getInstance();

        populateDateEnums( dataEnums, sce );

        Arrays.sort(sce.factTypes);
View Full Code Here

    /**
     * Start the creation of a new SuggestionCompletionEngine
     */
    public void newCompletionEngine() {
        this.instance = new SuggestionCompletionEngine();
        this.factTypes = new ArrayList();
        this.fieldsForType = new HashMap();
        this.modifiersForType = new HashMap();
        this.fieldTypes = new HashMap();
        this.globalTypes = new HashMap();
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.modeldriven.SuggestionCompletionEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.