Examples of DirtyableVerticalPane


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

     */
    private void renderLhs(final RuleModel model) {


        for (int i = 0; i < model.lhs.length; i++) {
            DirtyableVerticalPane vert = new DirtyableVerticalPane();
            vert.setWidth("100%");

            //if lockLHS() set the widget RO, otherwise let them decide.
            Boolean readOnly = this.lockLHS()?true:null;

            IPattern pattern = model.lhs[i];
           
            RuleModellerWidget w = getWidgetFactory().getWidget(this, pattern, readOnly);
            w.addOnModifiedCommand(this.onWidgetModifiedCommand);

            vert.add(wrapLHSWidget(model, i, w));
            vert.add(spacerWidget());


            layout.setWidget(currentLayoutRow, 0, this.wrapLineNumber(i+1, true));
            layout.getFlexCellFormatter().setHorizontalAlignment(currentLayoutRow, 0, HasHorizontalAlignment.ALIGN_CENTER);
            layout.getFlexCellFormatter().setVerticalAlignment(currentLayoutRow, 0, HasVerticalAlignment.ALIGN_MIDDLE);
View Full Code Here

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

        this.layout.setWidget( 1,
                               0,
                               new HTML( "&nbsp;&nbsp;&nbsp;&nbsp;" ) );

        if ( this.pattern.getPatterns() != null ) {
            DirtyableVerticalPane vert = new DirtyableVerticalPane();
            IFactPattern[] facts = pattern.getPatterns();
            for ( int i = 0; i < facts.length; i++ ) {
                RuleModellerWidget widget = this.getModeller().getWidgetFactory().getWidget( this.getModeller(),
                                                                                             this.getEventBus(),
                                                                                             facts[i],
                                                                                             this.readOnly );
                widget.addOnModifiedCommand( new Command() {
                    public void execute() {
                        setModified( true );
                    }
                } );

                //Wrap widget so the Fact pattern can be deleted
                vert.add( wrapLHSWidget( pattern,
                                         i,
                                         widget ) );
                vert.add( spacerWidget() );
            }
            this.layout.setWidget( 1,
                                   1,
                                   vert );
        }
View Full Code Here

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

     * Do all the widgets for the RHS.
     */
    private void renderRhs(final RuleModel model) {

        for ( int i = 0; i < model.rhs.length; i++ ) {
            DirtyableVerticalPane widget = new DirtyableVerticalPane();
            widget.setWidth( "100%" );
            IAction action = model.rhs[i];

            //if lockRHS() set the widget RO, otherwise let them decide.
            Boolean readOnly = this.lockRHS() ? true : null;

            RuleModellerWidget w = getWidgetFactory().getWidget( this,
                                                                 eventBus,
                                                                 action,
                                                                 readOnly );
            w.addOnModifiedCommand( this.onWidgetModifiedCommand );

            w.setWidth( "100%" );
            widget.add( spacerWidget() );

            DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
            horiz.setWidth( "100%" );
            //horiz.setBorderWidth(2);

            Image remove = DroolsGuvnorImages.INSTANCE.DeleteItemSmall();
            remove.setTitle( Constants.INSTANCE.RemoveThisAction() );
            final int idx = i;
            remove.addClickHandler( new ClickHandler() {

                public void onClick(ClickEvent event) {
                    if ( Window.confirm( Constants.INSTANCE.RemoveThisItem() ) ) {
                        model.removeRhsItem( idx );
                        refreshWidget();

                        //Signal possible change in Template variables
                        TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent( model );
                        eventBus.fireEventFromSource( tvce,
                                                      model );
                    }
                }
            } );
            horiz.add( w );
            if ( !(w instanceof ActionRetractFactWidget) ) {
                w.setWidth( "100%" ); //NON-NLS
                horiz.setWidth( "100%" );
            }

            if ( !(this.lockRHS() || w.isReadOnly()) ) {
                horiz.add( remove );
            }

            widget.add( horiz );

            layout.setHTML( currentLayoutRow,
                            0,
                            "<div class='form-field'>" + (i + 1) + ".</div>" );
            layout.getFlexCellFormatter().setHorizontalAlignment( currentLayoutRow,
View Full Code Here

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

     * Builds all the condition widgets.
     */
    private void renderLhs(final RuleModel model) {

        for ( int i = 0; i < model.lhs.length; i++ ) {
            DirtyableVerticalPane vert = new DirtyableVerticalPane();
            vert.setWidth( "100%" );

            //if lockLHS() set the widget RO, otherwise let them decide.
            Boolean readOnly = this.lockLHS() ? true : null;

            IPattern pattern = model.lhs[i];

            RuleModellerWidget w = getWidgetFactory().getWidget( this,
                                                                 eventBus,
                                                                 pattern,
                                                                 readOnly );
            w.addOnModifiedCommand( this.onWidgetModifiedCommand );

            vert.add( wrapLHSWidget( model,
                                     i,
                                     w ) );
            vert.add( spacerWidget() );

            layout.setWidget( currentLayoutRow,
                              0,
                              this.wrapLineNumber( i + 1,
                                                   true ) );
View Full Code Here

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

     * Do all the widgets for the RHS.
     */
    private void renderRhs(final RuleModel model) {

        for ( int i = 0; i < model.rhs.length; i++ ) {
            DirtyableVerticalPane widget = new DirtyableVerticalPane();
            widget.setWidth( "100%" );
            IAction action = model.rhs[i];

            //if lockRHS() set the widget RO, otherwise let them decide.
            Boolean readOnly = this.lockRHS() ? true : null;

            RuleModellerWidget w = getWidgetFactory().getWidget( this,
                                                                 eventBus,
                                                                 action,
                                                                 readOnly );
            w.addOnModifiedCommand( this.onWidgetModifiedCommand );

            w.setWidth( "100%" );
            widget.add( spacerWidget() );

            DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
            horiz.setWidth( "100%" );
            //horiz.setBorderWidth(2);

            Image remove = new ImageButton( DroolsGuvnorImages.INSTANCE.deleteItemSmall() );
            remove.setTitle( Constants.INSTANCE.RemoveThisAction() );
            final int idx = i;
            remove.addClickHandler( new ClickHandler() {

                public void onClick(ClickEvent event) {
                    if ( Window.confirm( Constants.INSTANCE.RemoveThisItem() ) ) {
                        model.removeRhsItem( idx );
                        refreshWidget();

                        //Signal possible change in Template variables
                        TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent( model );
                        eventBus.fireEventFromSource( tvce,
                                                      model );
                    }
                }
            } );
            horiz.add( w );
            if ( !(w instanceof ActionRetractFactWidget) ) {
                w.setWidth( "100%" ); //NON-NLS
                horiz.setWidth( "100%" );
            }

            if ( !(this.lockRHS() || w.isReadOnly()) || !w.isFactTypeKnown() ) {
                horiz.add( remove );
            }

            widget.add( horiz );

            layout.setHTML( currentLayoutRow,
                            0,
                            "<div class='form-field'>" + (i + 1) + ".</div>" );
            layout.getFlexCellFormatter().setHorizontalAlignment( currentLayoutRow,
View Full Code Here

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

     * Builds all the condition widgets.
     */
    private void renderLhs(final RuleModel model) {

        for ( int i = 0; i < model.lhs.length; i++ ) {
            DirtyableVerticalPane vert = new DirtyableVerticalPane();
            vert.setWidth( "100%" );

            //if lockLHS() set the widget RO, otherwise let them decide.
            Boolean readOnly = this.lockLHS() ? true : null;

            IPattern pattern = model.lhs[i];

            RuleModellerWidget w = getWidgetFactory().getWidget( this,
                                                                 eventBus,
                                                                 pattern,
                                                                 readOnly );
            w.addOnModifiedCommand( this.onWidgetModifiedCommand );

            vert.add( wrapLHSWidget( model,
                                     i,
                                     w ) );
            vert.add( spacerWidget() );

            layout.setWidget( currentLayoutRow,
                              0,
                              this.wrapLineNumber( i + 1,
                                                   true ) );
View Full Code Here

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

        this.layout.setWidget( 1,
                               0,
                               new HTML( "&nbsp;&nbsp;&nbsp;&nbsp;" ) );

        if ( this.pattern.getPatterns() != null ) {
            DirtyableVerticalPane vert = new DirtyableVerticalPane();
            IFactPattern[] facts = pattern.getPatterns();
            for ( int i = 0; i < facts.length; i++ ) {
                RuleModellerWidget widget = this.getModeller().getWidgetFactory().getWidget( this.getModeller(),
                                                                                             this.getEventBus(),
                                                                                             facts[i],
                                                                                             this.readOnly );
                widget.addOnModifiedCommand( new Command() {
                    public void execute() {
                        setModified( true );
                    }
                } );

                //Wrap widget so the Fact pattern can be deleted
                vert.add( wrapLHSWidget( pattern,
                                         i,
                                         widget ) );
                vert.add( spacerWidget() );
            }
            this.layout.setWidget( 1,
                                   1,
                                   vert );
        }
View Full Code Here

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

        this.layout.setWidget( 1,
                               0,
                               new HTML( "&nbsp;&nbsp;&nbsp;&nbsp;" ) );

        if ( this.pattern.getPatterns() != null ) {
            DirtyableVerticalPane vert = new DirtyableVerticalPane();
            IFactPattern[] facts = pattern.getPatterns();
            for ( int i = 0; i < facts.length; i++ ) {
                RuleModellerWidget widget = this.getModeller().getWidgetFactory().getWidget( this.getModeller(),
                                                                                             this.getEventBus(),
                                                                                             facts[i],
                                                                                             this.readOnly );
                widget.addOnModifiedCommand( new Command() {
                    public void execute() {
                        setModified( true );
                    }
                } );

                //Wrap widget so the Fact pattern can be deleted
                vert.add( wrapLHSWidget( pattern,
                                         i,
                                         widget ) );
                vert.add( spacerWidget() );
            }
            this.layout.setWidget( 1,
                                   1,
                                   vert );
        }
View Full Code Here

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

     * Do all the widgets for the RHS.
     */
    private void renderRhs(final RuleModel model) {

        for ( int i = 0; i < model.rhs.length; i++ ) {
            DirtyableVerticalPane widget = new DirtyableVerticalPane();
            widget.setWidth( "100%" );
            IAction action = model.rhs[i];

            //if lockRHS() set the widget RO, otherwise let them decide.
            Boolean readOnly = this.lockRHS() ? true : null;

            RuleModellerWidget w = getWidgetFactory().getWidget( this,
                                                                 eventBus,
                                                                 action,
                                                                 readOnly );
            w.addOnModifiedCommand( this.onWidgetModifiedCommand );

            widget.add( wrapRHSWidget( model,
                                       i,
                                       w ) );
            widget.add( spacerWidget() );

            layout.setWidget( currentLayoutRow,
                              0,
                              new DirtyableHorizontalPane() );
            layout.setWidget( currentLayoutRow,
View Full Code Here

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

     * Builds all the condition widgets.
     */
    private void renderLhs(final RuleModel model) {

        for ( int i = 0; i < model.lhs.length; i++ ) {
            DirtyableVerticalPane vert = new DirtyableVerticalPane();
            vert.setWidth( "100%" );

            //if lockLHS() set the widget RO, otherwise let them decide.
            Boolean readOnly = this.lockLHS() ? true : null;

            IPattern pattern = model.lhs[i];

            RuleModellerWidget w = getWidgetFactory().getWidget( this,
                                                                 eventBus,
                                                                 pattern,
                                                                 readOnly );
            w.addOnModifiedCommand( this.onWidgetModifiedCommand );

            vert.add( wrapLHSWidget( model,
                                     i,
                                     w ) );
            vert.add( spacerWidget() );

            layout.setWidget( currentLayoutRow,
                              0,
                              new DirtyableHorizontalPane() );
            layout.setWidget( currentLayoutRow,
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.