Package org.drools.ide.common.server.rules

Examples of org.drools.ide.common.server.rules.SuggestionCompletionLoader$WildCardException


            if (packagePath != null) {
                packagePath = packagePath.append( "drools.package" );
                IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile( packagePath );
                IJavaProject javaProject = JavaCore.create( file.getProject() );
                ClassLoader classLoader = ProjectClassLoader.getProjectClassLoader( javaProject );
                loader = new SuggestionCompletionLoader( classLoader );
                if ( !file.exists() ) {
                    String defaultHeader = "//This is a package configuration file";
                    defaultHeader += "\n//Add imports, globals etc here which will be used by all the rule assets in this folder.";
                    InputStream is = new ByteArrayInputStream( defaultHeader.getBytes() );
                    try {
View Full Code Here


    }

    private void reloadCompletionEngine() {

        if (packageEditorInput == null) {
            completion = new SuggestionCompletionLoader( null ).getSuggestionEngine( "",
                new ArrayList(),
                new ArrayList() );
            return;
        }
View Full Code Here

            objectType.setName( name );
            objectType.setFullName( fullPath );
            data.add( objectType );
        }

        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        SuggestionCompletionEngine engine = loader.getSuggestionEngine( header.toString(),
                                                                        jars,
                                                                        Collections.EMPTY_LIST );
        for ( String factTypeName : engine.getFactTypes() ) {
            for ( String fieldName : engine.getFieldCompletions( factTypeName ) ) {
                ObjectType objectType = this.data.getObjectTypeByObjectTypeNameAndPackageName( factTypeName,
View Full Code Here

    }

    @Test
    public void testStripUnNeededFields() {
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();
        List<String> result = loader.removeIrrelevantFields( Arrays.asList( new String[]{"foo", "toString", "class", "hashCode"} ) );
        assertEquals( 1,
                      result.size());
        assertEquals( "foo",
                      result.get( 0 ) );
    }
View Full Code Here

                      result.get( 0 ) );
    }

    @Test
    public void testGetShortNameOfClass() {
        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();

        assertEquals( "Object",
                      loader.getShortNameOfClass( Object.class.getName() ) );

        assertEquals( "Foo",
                      loader.getShortNameOfClass( "Foo" ) );
    }
View Full Code Here

                     + "age: Integer\n"
                     + "dateOfBirth: Date\n"
                     + "approved: Boolean\n"
                     + "end\n";

        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();

        List<String> enums = new ArrayList<String>();

        enums.add( "'Driver.name' : ['f1a', 'f1b'], 'Driver.age' : ['f2a', 'f2b'], 'Driver.dateOfBirth' : ['f3a', 'f3b'], 'Driver.approved' : ['f4a', 'f4b']" );

        SuggestionCompletionEngine sce = loader.getSuggestionEngine( pkg,
                                                                     new ArrayList<JarInputStream>(),
                                                                     new ArrayList<DSLTokenizedMappingFile>(),
                                                                     enums );

        Pattern52 p1 = new Pattern52();
View Full Code Here

                     + "declare Fact\n"
                     + "field1 : String\n"
                     + "field2 : String\n"
                     + "end\n";

        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();

        List<String> enums = new ArrayList<String>();

        final String enumDefinitions = "'Fact.field1' : ['f1a', 'f1b', 'f1c'], "
                                       + "'Fact.field2[field1=f1a]' : ['f1af2a', 'f1af2b', 'f1af2c'], "
                                       + "'Fact.field2[field1=f1b]' : ['f1bf2a', 'f1bf2b', 'f1bf2c'], "
                                       + "'Fact.field2[field1=f1c]' : ['f1cf2a', 'f1cf2b', 'f1cf2c']";

        enums.add( enumDefinitions );

        SuggestionCompletionEngine sce = loader.getSuggestionEngine( pkg,
                                                                     new ArrayList<JarInputStream>(),
                                                                     new ArrayList<DSLTokenizedMappingFile>(),
                                                                     enums );

        Pattern52 p1 = new Pattern52();
View Full Code Here

                     + "declare Fact\n"
                     + "field1 : String\n"
                     + "field2 : String\n"
                     + "end\n";

        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();

        List<String> enums = new ArrayList<String>();

        final String enumDefinitions = "'Fact.field1' : ['f1a', 'f1b'], "
                                       + "'Fact.field2[field1=f1a]' : ['f1af2a', 'f1af2b'], "
                                       + "'Fact.field2[field1=f1b]' : ['f1bf2a', 'f1bf2b']";

        enums.add( enumDefinitions );

        SuggestionCompletionEngine sce = loader.getSuggestionEngine( pkg,
                                                                     new ArrayList<JarInputStream>(),
                                                                     new ArrayList<DSLTokenizedMappingFile>(),
                                                                     enums );

        Pattern52 p1 = new Pattern52();
View Full Code Here

                     + "declare Fact\n"
                     + "field1 : String\n"
                     + "field2 : String\n"
                     + "end\n";

        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();

        List<String> enums = new ArrayList<String>();

        final String enumDefinitions = "'Fact.field1' : ['f1a', 'f1b'], "
                                       + "'Fact.field2[field1=f1a]' : ['f1af2a', 'f1af2b'], "
                                       + "'Fact.field2[field1=f1b]' : ['f1bf2a', 'f1bf2b']";

        enums.add( enumDefinitions );

        SuggestionCompletionEngine sce = loader.getSuggestionEngine( pkg,
                                                                     new ArrayList<JarInputStream>(),
                                                                     new ArrayList<DSLTokenizedMappingFile>(),
                                                                     enums );

        Pattern52 p1 = new Pattern52();
View Full Code Here

                     + "declare Fact\n"
                     + "field1 : String\n"
                     + "field2 : String\n"
                     + "end\n";

        SuggestionCompletionLoader loader = new SuggestionCompletionLoader();

        List<String> enums = new ArrayList<String>();

        final String enumDefinitions = "'Fact.field1' : ['f1a', 'f1b'], "
                                       + "'Fact.field2[field1=f1a]' : ['f1af2a', 'f1af2b'], "
                                       + "'Fact.field2[field1=f1b]' : ['f1bf2a', 'f1bf2b']";

        enums.add( enumDefinitions );

        SuggestionCompletionEngine sce = loader.getSuggestionEngine( pkg,
                                                                     new ArrayList<JarInputStream>(),
                                                                     new ArrayList<DSLTokenizedMappingFile>(),
                                                                     enums );

        Pattern52 p1 = new Pattern52();
View Full Code Here

TOP

Related Classes of org.drools.ide.common.server.rules.SuggestionCompletionLoader$WildCardException

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.