Examples of ExpressionMethod


Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

        return lb;
    }

    private void onCollectionChange(String value) {
        if ( "size".contains( value ) ) {
            expression.appendPart( new ExpressionMethod( "size",
                                                         "int",
                                                         SuggestionCompletionEngine.TYPE_NUMERIC ) );
        } else if ( "isEmpty".equals( value ) ) {
            expression.appendPart( new ExpressionMethod( "isEmpty",
                                                         "boolean",
                                                         SuggestionCompletionEngine.TYPE_BOOLEAN ) );
        } else {
            ExpressionCollectionIndex collectionIndex;
            String factName = getCompletionEngine().getFactNameFromType( getCurrentParametricType() );
            if ( getCurrentParametricType() != null && factName != null ) {
                collectionIndex = new ExpressionCollectionIndex( "get",
                                                                 getCurrentParametricType(),
                                                                 factName );
            } else {
                collectionIndex = new ExpressionCollectionIndex( "get",
                                                                 "java.lang.Object",
                                                                 SuggestionCompletionEngine.TYPE_OBJECT );
            }
            if ( "first".equals( value ) ) {
                collectionIndex.putParam( "index",
                                          new ExpressionFormLine( new ExpressionText( "0" ) ) );
                expression.appendPart( collectionIndex );
            } else if ( "last".equals( value ) ) {
                ExpressionFormLine index = new ExpressionFormLine( expression );
                index.appendPart( new ExpressionMethod( "size",
                                                        "int",
                                                        SuggestionCompletionEngine.TYPE_NUMERIC ) );
                index.appendPart( new ExpressionText( "-1" ) );

                collectionIndex.putParam( "index",
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

            expression.removeLast();
        } else if ( SuggestionCompletionEngine.TYPE_COLLECTION.equals( getCurrentGenericType() ) ) {
            onCollectionChange( value );
        } else if ( SuggestionCompletionEngine.TYPE_STRING.equals( getCurrentGenericType() ) ) {
            if ( "size".equals( value ) ) {
                expression.appendPart( new ExpressionMethod( "size",
                                                             "int",
                                                             SuggestionCompletionEngine.TYPE_NUMERIC ) );
            } else if ( "isEmpty".equals( value ) ) {
                expression.appendPart( new ExpressionText( ".size() == 0",
                                                           "",
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

        return lb;
    }

    private void onCollectionChange(String value) {
        if ( "size".contains( value ) ) {
            expression.appendPart( new ExpressionMethod( "size",
                                                         "int",
                                                         SuggestionCompletionEngine.TYPE_NUMERIC ) );
        } else if ( "isEmpty".equals( value ) ) {
            expression.appendPart( new ExpressionMethod( "isEmpty",
                                                         "boolean",
                                                         SuggestionCompletionEngine.TYPE_BOOLEAN ) );
        } else {
            ExpressionCollectionIndex collectionIndex;
            String factName = getCompletionEngine().getFactNameFromType( getCurrentParametricType() );
            if ( getCurrentParametricType() != null && factName != null ) {
                collectionIndex = new ExpressionCollectionIndex( "get",
                                                                 getCurrentParametricType(),
                                                                 factName );
            } else {
                collectionIndex = new ExpressionCollectionIndex( "get",
                                                                 "java.lang.Object",
                                                                 SuggestionCompletionEngine.TYPE_OBJECT );
            }
            if ( "first".equals( value ) ) {
                collectionIndex.putParam( "index",
                                          new ExpressionFormLine( new ExpressionText( "0" ) ) );
                expression.appendPart( collectionIndex );
            } else if ( "last".equals( value ) ) {
                ExpressionFormLine index = new ExpressionFormLine( expression );
                index.appendPart( new ExpressionMethod( "size",
                                                        "int",
                                                        SuggestionCompletionEngine.TYPE_NUMERIC ) );
                index.appendPart( new ExpressionText( "-1" ) );

                collectionIndex.putParam( "index",
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

            expression.removeLast();
        } else if ( SuggestionCompletionEngine.TYPE_COLLECTION.equals( getCurrentGenericType() ) ) {
            onCollectionChange( value );
        } else if ( SuggestionCompletionEngine.TYPE_STRING.equals( getCurrentGenericType() ) ) {
            if ( "size".equals( value ) ) {
                expression.appendPart( new ExpressionMethod( "size",
                                                             "int",
                                                             SuggestionCompletionEngine.TYPE_NUMERIC ) );
            } else if ( "isEmpty".equals( value ) ) {
                expression.appendPart( new ExpressionText( ".size() == 0",
                                                           "",
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

//    return null;
    }

    private void onCollectionChange(String value) {
        if ("size".contains(value)) {
            expression.appendPart(new ExpressionMethod("size", "int", SuggestionCompletionEngine.TYPE_NUMERIC));
        } else if ("isEmpty".equals(value)) {
            expression.appendPart(new ExpressionMethod("isEmpty", "boolean", SuggestionCompletionEngine.TYPE_BOOLEAN));
        } else {
            ExpressionCollectionIndex collectionIndex;
            String factName = getCompletionEngine().getFactNameFromType(getCurrentParametricType());
            if (getCurrentParametricType() != null && factName != null) {
                collectionIndex = new ExpressionCollectionIndex("get", getCurrentParametricType(), factName);
            } else {
                collectionIndex = new ExpressionCollectionIndex("get", "java.lang.Object", SuggestionCompletionEngine.TYPE_OBJECT);
            }
            if ("first".equals(value)) {
                collectionIndex.putParam("index", new ExpressionFormLine(new ExpressionText("0")));
                expression.appendPart(collectionIndex);
            } else if ("last".equals(value)) {
                ExpressionFormLine index = new ExpressionFormLine(expression);
                index.appendPart(new ExpressionMethod("size", "int", SuggestionCompletionEngine.TYPE_NUMERIC));
                index.appendPart(new ExpressionText("-1"));

                collectionIndex.putParam("index", index);
                expression.appendPart(collectionIndex);
            }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

            expression.removeLast();
        } else if (SuggestionCompletionEngine.TYPE_COLLECTION.equals(getCurrentGenericType())) {
            onCollectionChange(value);
        } else if (SuggestionCompletionEngine.TYPE_STRING.equals(getCurrentGenericType())) {
            if ("size".equals(value)) {
                expression.appendPart(new ExpressionMethod("size", "int", SuggestionCompletionEngine.TYPE_NUMERIC));
            } else if ("isEmpty".equals(value)) {
                expression.appendPart(new ExpressionText(".size() == 0", "", SuggestionCompletionEngine.TYPE_NUMERIC));
            }
        } else {
            int dotPos = value.indexOf('.');
            String prefix = value.substring(0, dotPos);
            String attrib = value.substring(dotPos + 1);

            prevFactName = getCompletionEngine().getFactNameFromType(
                    getCurrentClassType());
//      String genericType = SuggestionCompletionEngine.TYPE_OBJECT;
            if (FIElD_VALUE_PREFIX.equals(prefix)) {
                String fieldClassName = getCompletionEngine().getFieldClassName(prevFactName, attrib);
                String fieldGenericType = getCompletionEngine().getFieldType(prevFactName, attrib);
                if (SuggestionCompletionEngine.TYPE_COLLECTION.equals(fieldGenericType)) {
                    String fieldParametricType = getCompletionEngine().getParametricFieldType(prevFactName, attrib);
                    expression.appendPart(new ExpressionCollection(attrib, fieldClassName, fieldGenericType, fieldParametricType));
                } else {
                    expression.appendPart(new ExpressionField(attrib, fieldClassName, fieldGenericType));
                }
            } else if (METHOD_VALUE_PREFIX.equals(prefix)) {
                MethodInfo mi = getCompletionEngine().getMethodinfo(prevFactName, attrib);
                if (SuggestionCompletionEngine.TYPE_COLLECTION.equals(mi.getGenericType())) {
                    expression.appendPart(new ExpressionCollection(attrib, mi.getReturnClassType(), mi.getGenericType(), mi.getParametricReturnType()));
                } else {
                    expression.appendPart(new ExpressionMethod(mi.getName(), mi.getReturnClassType(), mi.getGenericType()));
                }
            }
        }
        Widget w = getWidgetForCurrentType();
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

    return lb;
  }

  private void onCollectionChange(String value) {
    if ("size".contains(value)) {
      expression.appendPart(new ExpressionMethod("size", "int", SuggestionCompletionEngine.TYPE_NUMERIC));
    } else if ("isEmpty".equals(value)) {
      expression.appendPart(new ExpressionMethod("isEmpty", "boolean", SuggestionCompletionEngine.TYPE_BOOLEAN));
    } else {
      ExpressionCollectionIndex collectionIndex;
      String factName = getCompletionEngine().getFactNameFromType(getCurrentParametricType());
      if (getCurrentParametricType() != null && factName != null) {
        collectionIndex = new ExpressionCollectionIndex("get", getCurrentParametricType(), factName);
      } else {
        collectionIndex = new ExpressionCollectionIndex("get", "java.lang.Object",
            SuggestionCompletionEngine.TYPE_OBJECT);
      }
      if ("first".equals(value)) {
        collectionIndex.putParam("index", new ExpressionFormLine(new ExpressionText("0")));
        expression.appendPart(collectionIndex);
      } else if ("last".equals(value)) {
        ExpressionFormLine index = new ExpressionFormLine(expression);
        index.appendPart(new ExpressionMethod("size", "int", SuggestionCompletionEngine.TYPE_NUMERIC));
        index.appendPart(new ExpressionText("-1"));

        collectionIndex.putParam("index", index);
        expression.appendPart(collectionIndex);
      }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

      expression.removeLast();
    } else if (SuggestionCompletionEngine.TYPE_COLLECTION.equals(getCurrentGenericType())) {
      onCollectionChange(value);
    } else if (SuggestionCompletionEngine.TYPE_STRING.equals(getCurrentGenericType())) {
      if ("size".equals(value)) {
        expression.appendPart(new ExpressionMethod("size", "int", SuggestionCompletionEngine.TYPE_NUMERIC));
      } else if ("isEmpty".equals(value)) {
        expression.appendPart(new ExpressionText(".size() == 0", "", SuggestionCompletionEngine.TYPE_NUMERIC));
      }
    } else {
      int dotPos = value.indexOf('.');
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

        return lb;
    }

    private void onCollectionChange(String value) {
        if ( "size".contains( value ) ) {
            expression.appendPart( new ExpressionMethod( "size",
                                                         "int",
                                                         SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER ) );
        } else if ( "isEmpty".equals( value ) ) {
            expression.appendPart( new ExpressionMethod( "isEmpty",
                                                         "boolean",
                                                         SuggestionCompletionEngine.TYPE_BOOLEAN ) );
        } else {
            ExpressionCollectionIndex collectionIndex;
            String factName = getCompletionEngine().getFactNameFromType( getCurrentParametricType() );
            if ( getCurrentParametricType() != null && factName != null ) {
                collectionIndex = new ExpressionCollectionIndex( "get",
                                                                 getCurrentParametricType(),
                                                                 factName );
            } else {
                collectionIndex = new ExpressionCollectionIndex( "get",
                                                                 "java.lang.Object",
                                                                 SuggestionCompletionEngine.TYPE_OBJECT );
            }
            if ( "first".equals( value ) ) {
                collectionIndex.putParam( "index",
                                          new ExpressionFormLine( new ExpressionText( "0" ) ) );
                expression.appendPart( collectionIndex );
            } else if ( "last".equals( value ) ) {
                ExpressionFormLine index = new ExpressionFormLine( expression );
                index.appendPart( new ExpressionMethod( "size",
                                                        "int",
                                                        SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER ) );
                index.appendPart( new ExpressionText( "-1" ) );

                collectionIndex.putParam( "index",
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.ExpressionMethod

            expression.removeLast();
        } else if ( SuggestionCompletionEngine.TYPE_COLLECTION.equals( getCurrentGenericType() ) ) {
            onCollectionChange( value );
        } else if ( SuggestionCompletionEngine.TYPE_STRING.equals( getCurrentGenericType() ) ) {
            if ( "size".equals( value ) ) {
                expression.appendPart( new ExpressionMethod( "size",
                                                             "int",
                                                             SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER ) );
            } else if ( "isEmpty".equals( value ) ) {
                expression.appendPart( new ExpressionText( ".size() == 0",
                                                           "",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.