Package org.drools.lang.dsl

Examples of org.drools.lang.dsl.DSLMappingEntry$ConsequenceSection


        SuggestionCompletionLoader suggestionCompletionLoader = new SuggestionCompletionLoader();
        ArrayList<DSLTokenizedMappingFile> dsls = new ArrayList<DSLTokenizedMappingFile>();

        DSLTokenizedMappingFile dslTokenizedMappingFile = new DSLTokenizedMappingFile();

        DSLMappingEntry dslMappingEntry = mock( DSLMappingEntry.class );
        when( dslMappingEntry.getSection() ).thenReturn( DSLMappingEntry.ANY );

        dslTokenizedMappingFile.getMapping().addEntry( dslMappingEntry );
        dsls.add( dslTokenizedMappingFile );

        SuggestionCompletionEngine suggestionEngine = suggestionCompletionLoader.getSuggestionEngine( "",
View Full Code Here


    }
   
    public void buildTree(DSLMapping mapping) {
        List entries = mapping.getEntries();
        for (Iterator iterator = entries.iterator(); iterator.hasNext(); ) {
            DSLMappingEntry entry = (DSLMappingEntry) iterator.next();
            Section section = entry.getSection();
            String nl = entry.getMappingKey();
            String objname = entry.getMetaData().getMetaData();
            addEntry(section, nl, objname);
        }
    }
View Full Code Here

    private List buildProposals(List suggestions) {
        List result = new ArrayList(suggestions.size());
        Iterator iterator = suggestions.iterator();
        while (iterator.hasNext()) {
            DSLMappingEntry text = (DSLMappingEntry) iterator.next();
            result.add(text.getMappingKey());
        }
        return result;
    }
View Full Code Here

        SuggestionCompletionLoader suggestionCompletionLoader = new SuggestionCompletionLoader();
        ArrayList<DSLTokenizedMappingFile> dsls = new ArrayList<DSLTokenizedMappingFile>();

        DSLTokenizedMappingFile dslTokenizedMappingFile = new DSLTokenizedMappingFile();

        DSLMappingEntry dslMappingEntry = mock( DSLMappingEntry.class );
        when( dslMappingEntry.getSection() ).thenReturn( DSLMappingEntry.ANY );

        dslTokenizedMappingFile.getMapping().addEntry( dslMappingEntry );
        dsls.add( dslTokenizedMappingFile );

        SuggestionCompletionEngine suggestionEngine = suggestionCompletionLoader.getSuggestionEngine( "",
View Full Code Here

    }

    public String getColumnText(Object element,
                                int columnIndex) {
        String result = "";
        DSLMappingEntry item = (DSLMappingEntry) element;
        switch (columnIndex) {
            case 0
                result = item.getMappingKey();
                break;
            case 1 :
                result = item.getMappingValue();
                break;
            case 2 :
                result = item.getMetaData().getMetaData();
                break;
            case 3 :
                result = item.getSection().getSymbol();
                break;
            default :
                break;
        }
        return result;
View Full Code Here

    /* (non-Javadoc)
     * Method declared on ViewerSorter.
     */
    public int compare(Viewer viewer, Object o1, Object o2) {

        DSLMappingEntry item1 = (DSLMappingEntry) o1;
        DSLMappingEntry item2 = (DSLMappingEntry) o2;

        switch (criteria) {
            case OBJECT:
                return compareObject(item1, item2);
            case EXPRESSION :
View Full Code Here

    private void validate(FileEditorInput input) {
        removeProblemsFor( input.getFile() );
        List errs = new ArrayList();
        for ( Iterator iter = model.getEntries().iterator(); iter.hasNext(); ) {
            DSLMappingEntry item = (DSLMappingEntry) iter.next();
            errs.addAll( item.getErrors() );
        }
        if ( errs.size() > 0 ) {
            for ( Iterator iter = errs.iterator(); iter.hasNext(); ) {
                MappingError mapEr = (MappingError) iter.next();
                createMarker( input.getFile(),
View Full Code Here

            public void widgetDefaultSelected(SelectionEvent e) {
                populate();
            }

            private void populate() {
                DSLMappingEntry selected = getCurrentSelected();
                exprText.setText( selected.getMappingKey() );
                mappingText.setText( selected.getMappingValue() );
                objText.setText( selected.getMetaData().getMetaData() == null ? "" : selected.getMetaData().getMetaData() );
            }

        } );

        //double click support
View Full Code Here

        } );
    }

    private void showEditPopup() {
        DSLMappingEntry selected = getCurrentSelected();
        if (selected != null) {
            MappingEditor editor = new MappingEditor( getSite().getShell() );
            editor.create();
            editor.getShell().setText( "Edit language mapping" );
            editor.setTitle( "Edit an existing language mapping item." );
            editor.setTitleImage( getTitleImage() );

            editor.setNLMappingItem( selected );

            editor.open();
            if ( !editor.isCancelled() ) {
                refreshModel();
                makeDirty();
                exprText.setText(selected.getMappingKey());
                mappingText.setText(selected.getMappingValue());
                objText.setText(selected.getMetaData().getMetaData() == null ? "" : selected.getMetaData().getMetaData());
            }
        }
    }
View Full Code Here

        add.addSelectionListener( new SelectionAdapter() {

            // Add an item, should pop up the editor
            public void widgetSelected(SelectionEvent e) {

                DSLMappingEntry newItem = new AntlrDSLMappingEntry();

                MappingEditor editor = new MappingEditor( getSite().getShell() );//shell);
                editor.create();
                editor.getShell().setText( "New language mapping" );
                editor.setTitle( "Create a new language element mapping." );
View Full Code Here

TOP

Related Classes of org.drools.lang.dsl.DSLMappingEntry$ConsequenceSection

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.