Examples of DSLMappingEntry


Examples of org.drools.lang.dsl.DSLMappingEntry

    }
   
    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

Examples of org.drools.lang.dsl.DSLMappingEntry

    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

Examples of org.drools.lang.dsl.DSLMappingEntry

        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

Examples of org.drools.lang.dsl.DSLMappingEntry

    }

    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

Examples of org.drools.lang.dsl.DSLMappingEntry

    /* (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

Examples of org.drools.lang.dsl.DSLMappingEntry

    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

Examples of org.drools.lang.dsl.DSLMappingEntry

            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

Examples of org.drools.lang.dsl.DSLMappingEntry

        } );
    }

    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

Examples of org.drools.lang.dsl.DSLMappingEntry

        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

Examples of org.drools.lang.dsl.DSLMappingEntry

        copy.addSelectionListener( new SelectionAdapter() {

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

                DSLMappingEntry curr = getCurrentSelected();
                if (curr != null) {
                    DSLMappingEntry newItem = new AntlrDSLMappingEntry( curr.getSection(),
                                                                          curr.getMetaData(),
                                                                          curr.getMappingKey(),
                                                                          curr.getMappingValue(),
                                                                          null,
                                                                          null);
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.