Package org.drools.guvnor.client.common

Examples of org.drools.guvnor.client.common.DirtyableFlexTable


    public ActionCallMethodWidget(RuleModeller mod,
                                  ActionCallMethod set,
                                  Boolean readOnly) {
        super( mod );
        this.model = set;
        this.layout = new DirtyableFlexTable();

        layout.setStyleName( "model-builderInner-Background" ); // NON-NLS

        SuggestionCompletionEngine completions = this.getModeller().getSuggestionCompletions();
        if ( completions.isGlobalVariable( set.variable ) ) {
View Full Code Here


    private void doLayout() {
        layout.clear();
        layout.setWidget( 0,
                          0,
                          getSetterLabel() );
        DirtyableFlexTable inner = new DirtyableFlexTable();
        for ( int i = 0; i < model.fieldValues.length; i++ ) {
            ActionFieldFunction val = model.getFieldValue( i );

            inner.setWidget( i,
                             0,
                             fieldSelector( val ) );
            inner.setWidget( i,
                             1,
                             valueEditor( val ) );

        }
        layout.setWidget( 0,
View Full Code Here

        this.scenario = scenario;
        this.mCall = mCall;
        this.executionTrace = executionTrace;
        this.suggestionCompletionEngine = parent.suggestionCompletionEngine;

        this.layout = new DirtyableFlexTable();

        layout.setStyleName( "model-builderInner-Background" ); // NON-NLS

        if ( suggestionCompletionEngine.isGlobalVariable( mCall.getVariable() ) ) {
View Full Code Here

    private void doLayout() {
        layout.clear();
        layout.setWidget( 0,
                          0,
                          getSetterLabel() );
        DirtyableFlexTable inner = new DirtyableFlexTable();
        for ( int i = 0; i < mCall.getCallFieldValues().length; i++ ) {
            CallFieldValue val = mCall.getCallFieldValues()[i];

            inner.setWidget( i,
                             0,
                             fieldSelector( val ) );
            inner.setWidget( i,
                             1,
                             valueEditor( val ) );

        }
        layout.setWidget( 0,
View Full Code Here

    public ActionSetFieldWidget(RuleModeller mod,
                                ActionSetField set,
                                Boolean readOnly) {
        super( mod );
        this.model = set;
        this.layout = new DirtyableFlexTable();

        layout.setStyleName( "model-builderInner-Background" );

        SuggestionCompletionEngine completions = this.getModeller().getSuggestionCompletions();
View Full Code Here

        if ( this.layout.getWidgetCount() == 2 ) {
            this.layout.remove( 1 );
        }

        DirtyableFlexTable editorLayout = scenarioWidgetComponentCreator.createDirtyableFlexTable();
        this.layout.add( editorLayout );
        ScenarioHelper scenarioHelper = new ScenarioHelper();

        List<Fixture> fixtures = scenarioHelper.lumpyMap( getScenario().getFixtures() );
        List<ExecutionTrace> listExecutionTrace = scenarioHelper.getExecutionTraceFor( fixtures );

        int layoutRow = 1;
        int executionTraceLine = 0;
        ExecutionTrace previousExecutionTrace = null;
        for ( final Fixture fixture : fixtures ) {
            if ( fixture instanceof ExecutionTrace ) {
                ExecutionTrace currentExecutionTrace = (ExecutionTrace) fixture;
                createWidgetForEditorLayout( editorLayout,
                                             layoutRow,
                                             0,
                                             scenarioWidgetComponentCreator.createExpectPanel( currentExecutionTrace ) );

                executionTraceLine++;
                if ( executionTraceLine >= listExecutionTrace.size() ) {
                    executionTraceLine = listExecutionTrace.size() - 1;
                }
                createWidgetForEditorLayout( editorLayout,
                                             layoutRow,
                                             1,
                                             scenarioWidgetComponentCreator.createExecutionWidget( currentExecutionTrace ) );
                editorLayout.setHorizontalAlignmentForFlexCellFormatter( layoutRow,
                                                                         2,
                                                                         HasHorizontalAlignment.ALIGN_LEFT );

                previousExecutionTrace = currentExecutionTrace;
View Full Code Here

     * @param sortedConst
     *            a sorted list of constraints to display.
     */
    private void drawConstraints(List<FieldConstraint> sortedConst,
                                 HasConstraints hasConstraints) {
        final DirtyableFlexTable table = new DirtyableFlexTable();
        layout.setWidget( 1,
                          0,
                          table );
        List<FieldConstraint> parents = new ArrayList<FieldConstraint>();

        for ( int i = 0; i < sortedConst.size(); i++ ) {
            traverseSingleFieldConstraints( sortedConst,
                                            table,
                                            parents,
                                            hasConstraints,
                                            i );

            //now the clear icon
            final int currentRow = i;
            Image clear = new ImageButton( images.deleteItemSmall() );
            clear.setTitle( constants.RemoveThisWholeRestriction() );
            clear.addClickHandler( createClickHandlerForClearImageButton( currentRow ) );

            if ( !this.readOnly ) {
                //This used to be 5 and Connectives were not rendered
                table.setWidget( currentRow,
                                 6,
                                 clear );
            }

        }
View Full Code Here

        t.getFlexCellFormatter().setColSpan( 0,
                                             0,
                                             2 );

        FieldConstraint[] nested = constraint.constraints;
        DirtyableFlexTable inner = new DirtyableFlexTable();
        inner.setStyleName( "modeller-inner-nested-Constraints" ); //NON-NLS
        if ( nested != null ) {
            for ( int i = 0; i < nested.length; i++ ) {
                this.renderFieldConstraint( inner,
                                            i,
                                            nested[i],
                                            constraint,
                                            true,
                                            0 );
                //add in remove icon here...
                final int currentRow = i;
                Image clear = new ImageButton( images.deleteItemSmall() );
                clear.setTitle( constants.RemoveThisNestedRestriction() );
                clear.addClickHandler( new ClickHandler() {

                    public void onClick(ClickEvent event) {
                        if ( Window.confirm( constants.RemoveThisItemFromNestedConstraint() ) ) {
                            setModified( true );
                            constraint.removeConstraint( currentRow );
                            getModeller().refreshWidget();
                        }
                    }
                } );
                if ( !this.readOnly ) {
                    //This used to be 5 and Connectives were not rendered
                    inner.setWidget( i,
                                     6,
                                     clear );
                }
            }
        }
View Full Code Here

     *     $result = RoutingResult( NerOption.types contains "arzt" )
     *
     * @param sortedConst a sorted list of constraints to display.
     * */
    private void drawConstraints(List<FieldConstraint> sortedConst) {
        final DirtyableFlexTable table = new DirtyableFlexTable();
        layout.setWidget(1, 0, table);
        List<FieldConstraint> parents = new ArrayList<FieldConstraint>();

        for (int i = 0; i < sortedConst.size(); i++) {
            int tabs = -1;
            FieldConstraint current = sortedConst.get(i);
            if (current instanceof SingleFieldConstraint) {
                SingleFieldConstraint single = (SingleFieldConstraint) current;
                FieldConstraint parent = single.parent;

                for (int j = 0; j < parents.size(); j++) {
                    FieldConstraint storedParent = parents.get(j);
                    if (storedParent != null && storedParent.equals(parent)) {
                        tabs = j + 1;
                        for (int k = j + 1; k < parents.size(); k++) {
                            parents.remove(j + 1);
                        }
                        parents.add(current);
                        break;
                    }
                }

                if (tabs < 0) {
                    tabs = 0;
                    parents.add(current);
                }
            }
            renderFieldConstraint(table, i, current, true, tabs);

            //now the clear icon
            final int currentRow = i;
            Image clear = new ImageButton("images/delete_faded.gif");//NON-NLS
            clear.setTitle(constants.RemoveThisWholeRestriction());
            clear.addClickListener(new ClickListener() {

                public void onClick(Widget w) {
                    if (Window.confirm(constants.RemoveThisItem())) {
                        setModified(true);
                        pattern.removeConstraint(currentRow);
                        getModeller().refreshWidget();
                    }
                }
            });

            if (!this.readOnly) {
                table.setWidget(currentRow, 5, clear);
            }

        }
    }
View Full Code Here

        t.setWidget(0, 0, new ClickableLabel(desc, click, !this.readOnly));
        t.getFlexCellFormatter().setColSpan(0, 0, 2);
        //t.getFlexCellFormatter().setWidth(0, 0, "15%");

        FieldConstraint[] nested = constraint.constraints;
        DirtyableFlexTable inner = new DirtyableFlexTable();
        inner.setStyleName("modeller-inner-nested-Constraints"); //NON-NLS
        if (nested != null) {
            for (int i = 0; i < nested.length; i++) {
                this.renderFieldConstraint(inner, i, nested[i], false, 0);
                //add in remove icon here...
                final int currentRow = i;
                Image clear = new ImageButton("images/delete_faded.gif"); //NON-NLS
                clear.setTitle(constants.RemoveThisNestedRestriction());

                clear.addClickListener(new ClickListener() {

                    public void onClick(Widget w) {
                        if (Window.confirm(constants.RemoveThisItemFromNestedConstraint())) {
                            setModified(true);
                            constraint.removeConstraint(currentRow);
                            getModeller().refreshWidget();
                        }
                    }
                });
                if (!this.readOnly) {
                    inner.setWidget(i, 5, clear);
                }
            }
        }

        t.setWidget(1, 1, inner);
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.common.DirtyableFlexTable

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.