Examples of DirtyableFlexTable


Examples of org.uberfire.client.common.DirtyableFlexTable

     * NerOption.types contains "arzt" )
     * @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 = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
            clear.setTitle( Constants.INSTANCE.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

Examples of org.uberfire.client.common.DirtyableFlexTable

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

        FieldConstraint[] nested = constraint.getConstraints();
        DirtyableFlexTable inner = new DirtyableFlexTable();
        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 = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
                clear.setTitle( Constants.INSTANCE.RemoveThisNestedRestriction() );
                clear.addClickHandler( new ClickHandler() {

                    public void onClick( ClickEvent event ) {
                        if ( Window.confirm( Constants.INSTANCE.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

Examples of org.uberfire.client.common.DirtyableFlexTable

            }
        };
        String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName( "from entry-point" ) + "</div>";

        DirtyableFlexTable panel = new DirtyableFlexTable();

        int r = 0;

        if ( pattern.getFactPattern() == null ) {
            panel.setWidget( r,
                             0,
                             new ClickableLabel( "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>",
                                                 click,
                                                 !this.readOnly ) );
            r++;
        }

        panel.setWidget( r,
                         0,
                         new HTML( lbl ) );

        this.txtEntryPoint = new TextBox();
        this.txtEntryPoint.setText( getFromEntryPointPattern().getEntryPointName() );
        this.txtEntryPoint.addChangeHandler( new ChangeHandler() {

            public void onChange( ChangeEvent event ) {
                getFromEntryPointPattern().setEntryPointName( txtEntryPoint.getText() );
                setModified( true );
            }

        } );
        panel.setWidget( r,
                         1,
                         this.txtEntryPoint );

        return panel;
    }
View Full Code Here

Examples of org.uberfire.client.common.DirtyableFlexTable

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

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

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

Examples of org.uberfire.client.common.DirtyableFlexTable

    private void doLayout() {
        layout.clear();
        layout.setWidget( 0,
                          0,
                          getSetterLabel() );
        DirtyableFlexTable inner = new DirtyableFlexTable();
        for ( int i = 0; i < model.getFieldValues().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

Examples of org.uberfire.client.common.DirtyableFlexTable

            }
        };

        String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName( "from collect" ) + "</div>";

        DirtyableFlexTable panel = new DirtyableFlexTable();

        int r = 0;

        if ( pattern.getFactPattern() == null ) {
            panel.setWidget( r++,
                             0,
                             new ClickableLabel( "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>",
                                                 leftPatternclick,
                                                 !this.readOnly ) );
        }

        panel.setWidget( r++,
                         0,
                         new HTML( lbl ) );

        if ( this.getFromCollectPattern().getRightPattern() == null ) {
            panel.setWidget( r++,
                             0,
                             new ClickableLabel( "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>",
                                                 rightPatternclick,
                                                 !this.readOnly ) );
        } else {
            IPattern rPattern = this.getFromCollectPattern().getRightPattern();

            RuleModellerWidget patternWidget = null;
            if ( rPattern instanceof FactPattern) {
                patternWidget = new FactPatternWidget( this.getModeller(),
                                                       this.getEventBus(),
                                                       rPattern,
                                                       true,
                                                       true,
                                                       this.readOnly );

            } else if ( rPattern instanceof FromAccumulateCompositeFactPattern) {
                patternWidget = new FromAccumulateCompositeFactPatternWidget( this.getModeller(),
                                                                              this.getEventBus(),
                                                                              (FromAccumulateCompositeFactPattern) rPattern,
                                                                              this.readOnly );

            } else if ( rPattern instanceof FromCollectCompositeFactPattern ) {
                patternWidget = new FromCollectCompositeFactPatternWidget( this.getModeller(),
                                                                           this.getEventBus(),
                                                                           (FromCollectCompositeFactPattern) rPattern,
                                                                           this.readOnly );

            } else if ( rPattern instanceof FromEntryPointFactPattern ) {
                patternWidget = new FromEntryPointFactPatternWidget( this.getModeller(),
                                                                     this.getEventBus(),
                                                                     (FromEntryPointFactPattern) rPattern,
                                                                     this.readOnly );

            } else if ( rPattern instanceof FromCompositeFactPattern ) {
                patternWidget = new FromCompositeFactPatternWidget( this.getModeller(),
                                                                    this.getEventBus(),
                                                                    (FromCompositeFactPattern) rPattern,
                                                                    this.readOnly );

            } else if ( rPattern instanceof FreeFormLine) {
                patternWidget = new FreeFormLineWidget( this.getModeller(),
                                                        this.getEventBus(),
                                                        (FreeFormLine) rPattern,
                                                        this.readOnly );
            } else {
                throw new IllegalArgumentException( "Unsuported pattern " + rPattern + " for right side of FROM COLLECT" );
            }

            patternWidget.addOnModifiedCommand( new Command() {
                public void execute() {
                    setModified( true );
                }
            } );

            panel.setWidget( r++,
                             0,
                             addRemoveButton( patternWidget,
                                              new ClickHandler() {

                                                  public void onClick( ClickEvent event ) {
View Full Code Here

Examples of org.uberfire.client.common.DirtyableFlexTable

        } else {
            this.readOnly = readOnly;
            this.isFactTypeKnown = true;
        }

        this.layout = new DirtyableFlexTable();
        if ( this.readOnly ) {
            this.layout.addStyleName( "editor-disabled-widget" );
        }
        this.layout.addStyleName( "model-builderInner-Background" );
View Full Code Here

Examples of org.uberfire.client.common.DirtyableFlexTable

            }
        };
        String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName("from") + "</div>";

        DirtyableFlexTable panel = new DirtyableFlexTable();

        int r = 0;

        if ( pattern.getFactPattern() == null ) {
            panel.setWidget( r,
                             0,
                             new ClickableLabel( "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPatterns() + "</font>",
                                                 click,
                                                 !this.readOnly ) );
            r++;
        }

        panel.setWidget( r,
                         0,
                         new HTML( lbl ) );
        ExpressionBuilder expressionBuilder = new ExpressionBuilder( this.getModeller(),
                                                                     this.getEventBus(),
                                                                     this.pattern.getExpression(),
                                                                     this.readOnly );
        expressionBuilder.addOnModifiedCommand( new Command() {
            public void execute() {
                setModified( true );
            }
        } );
        panel.setWidget( r,
                         1,
                         expressionBuilder );

        return panel;
    }
View Full Code Here

Examples of org.uberfire.client.common.DirtyableFlexTable

                                   ActionInsertFact set,
                                   Boolean readOnly ) {
        super( mod,
               eventBus );
        this.model = set;
        this.layout = new DirtyableFlexTable();
        this.factType = set.getFactType();

        PackageDataModelOracle completions = this.getModeller().getSuggestionCompletions();
        this.fieldCompletions = completions.getFieldCompletions( FieldAccessorsAndMutators.MUTATOR,
                                                                 set.getFactType() );
View Full Code Here

Examples of org.uberfire.client.common.DirtyableFlexTable

                          new HTML( "&nbsp;&nbsp;&nbsp;&nbsp;" ) );
        layout.getFlexCellFormatter().setColSpan( 0,
                                                  0,
                                                  2 );

        DirtyableFlexTable inner = new DirtyableFlexTable();
        int col = 0;

        for ( int i = 0; i < model.getFieldValues().length; i++ ) {
            ActionFieldValue val = model.getFieldValues()[ i ];

            inner.setWidget( i,
                             0 + col,
                             fieldSelector( val ) );
            inner.setWidget( i,
                             1 + col,
                             valueEditor( val ) );
            final int idx = i;
            Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
            remove.addClickHandler( new ClickHandler() {
                public void onClick( ClickEvent event ) {
                    if ( Window.confirm( Constants.INSTANCE.RemoveThisItem() ) ) {
                        model.removeField( idx );
                        setModified( true );
                        getModeller().refreshWidget();

                        //Signal possible change in Template variables
                        TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent( getModeller().getModel() );
                        getEventBus().fireEventFromSource( tvce,
                                                           getModeller().getModel() );
                    }
                }
            } );
            if ( !this.readOnly ) {
                inner.setWidget( i,
                                 2 + col,
                                 remove );
            }

        }
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.