Package org.uberfire.client.common

Examples of org.uberfire.client.common.InfoPopup


            }
        } );

        form.addAttribute( Constants.INSTANCE.LiteralValue() + ":",
                           widgets( lit,
                                    new InfoPopup( Constants.INSTANCE.Literal(),
                                                   Constants.INSTANCE.ALiteralValueMeansTheValueAsTypedInIeItsNotACalculation() ) ) );

        if ( modeller.isTemplate() ) {
            Button templateButton = new Button( Constants.INSTANCE.TemplateKey() );
            templateButton.addClickHandler( new ClickHandler() {
                public void onClick( ClickEvent event ) {
                    value.setNature( FieldNatureType.TYPE_TEMPLATE );
                    value.setValue( "" );
                    doTypeChosen( form );
                }
            } );
            form.addAttribute( Constants.INSTANCE.TemplateKey() + ":",
                               widgets( templateButton,
                                        new InfoPopup( Constants.INSTANCE.Literal(),
                                                       Constants.INSTANCE.ALiteralValueMeansTheValueAsTypedInIeItsNotACalculation() ) ) );
        }

        form.addRow( new HTML( "<hr/>" ) );
        form.addRow( new SmallLabel( Constants.INSTANCE.AdvancedSection() ) );

        Button formula = new Button( Constants.INSTANCE.Formula() );
        formula.addClickHandler( new ClickHandler() {

            public void onClick( ClickEvent event ) {
                value.setNature( FieldNatureType.TYPE_FORMULA );
                value.setValue( "=" );
                doTypeChosen( form );
            }
        } );

        // If there is a bound Facts or Fields that are of the same type as the current variable type, then show a button
        List<String> bindings = getApplicableBindings();
        if ( bindings.size() > 0 ) {
            Button variable = new Button( Constants.INSTANCE.BoundVariable() );
            form.addAttribute( Constants.INSTANCE.BoundVariable() + ":",
                               variable );
            variable.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    value.setNature( FieldNatureType.TYPE_VARIABLE );
                    value.setValue( "=" );
                    doTypeChosen( form );
                }
            } );
        }

        form.addAttribute( Constants.INSTANCE.Formula() + ":",
                           widgets( formula,
                                    new InfoPopup( Constants.INSTANCE.Formula(),
                                                   Constants.INSTANCE.FormulaTip() ) ) );

        form.show();
    }
View Full Code Here


                                    final int idx,
                                    final boolean isReadOnly ) {
        Widget editor;

        if ( rm.getAttributeName().equals( LOCK_LHS ) || rm.getAttributeName().equals( LOCK_RHS ) ) {
            editor = new InfoPopup( Constants.INSTANCE.FrozenAreas(),
                                    Constants.INSTANCE.FrozenExplanation() );
        } else {
            editor = textBoxEditor( rm,
                                    isReadOnly );
        }
View Full Code Here

        //only show the drop down if we are not using fixed position.
        if ( position == null ) {
            HorizontalPanel hp0 = new HorizontalPanel();
            hp0.add( new HTML( Constants.INSTANCE.PositionColon() ) );
            hp0.add( positionCbo );
            hp0.add( new InfoPopup( Constants.INSTANCE.PositionColon(),
                                    Constants.INSTANCE.ActionPositionExplanation() ) );
            layoutPanel.addRow( hp0 );
        }

        choices = makeChoicesListBox();
View Full Code Here

                modeller.refreshWidget();
                popup.hide();
            }
        } );

        InfoPopup infoComp = new InfoPopup( Constants.INSTANCE.MultipleFieldConstraints(),
                                            Constants.INSTANCE.MultipleConstraintsTip() );

        HorizontalPanel horiz = new HorizontalPanel();
        horiz.add( composites );
        horiz.add( infoComp );
View Full Code Here

                modeller.refreshWidget();
                popup.hide();
            }
        } );

        InfoPopup infoComp = new InfoPopup( Constants.INSTANCE.MultipleFieldConstraints(),
                                            Constants.INSTANCE.MultipleConstraintsTip1() );

        HorizontalPanel horiz = new HorizontalPanel();

        horiz.add( composites );
View Full Code Here

        } );

        form.addAttribute( Constants.INSTANCE.LiteralValue() + ":",
                           widgets( lit,
                                    new InfoPopup( Constants.INSTANCE.Literal(),
                                                   Constants.INSTANCE.LiteralValTip() ) ) );
        form.addRow( new HTML( "<hr/>" ) );
        form.addRow( new SmallLabel( Constants.INSTANCE.AdvancedSection() ) );

        /*
 
View Full Code Here

        //Literal value selector
        if ( showLiteralSelector ) {
            form.addAttribute( Constants.INSTANCE.LiteralValue() + ":",
                               widgets( lit,
                                        new InfoPopup( Constants.INSTANCE.LiteralValue(),
                                                       Constants.INSTANCE.LiteralValTip() ) ) );
        }

        //Template key selector
        if ( modeller.isTemplate() ) {
            String templateKeyLabel = Constants.INSTANCE.TemplateKey();
            Button templateKeyButton = new Button( templateKeyLabel );
            templateKeyButton.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_TEMPLATE );
                    doTypeChosen( form );
                }
            } );

            form.addAttribute( templateKeyLabel + ":",
                               widgets( templateKeyButton,
                                        new InfoPopup( templateKeyLabel,
                                                       Constants.INSTANCE.LiteralValTip() ) ) );
        }

        //Divider, if we have any advanced options
        if ( showVariableSelector || showFormulaSelector || showExpressionSelector ) {
            form.addRow( new HTML( "<hr/>" ) );
            form.addRow( new SmallLabel( Constants.INSTANCE.AdvancedOptions() ) );
        }

        //Show variables selector, if there are any variables in scope
        if ( showVariableSelector ) {
            List<String> bindingsInScope = this.model.getBoundVariablesInScope( this.constraint );
            if ( bindingsInScope.size() > 0
                    || DataType.TYPE_COLLECTION.equals( this.fieldType ) ) {

                List<String> applicableBindingsInScope = getApplicableBindingsInScope( bindingsInScope );
                if ( applicableBindingsInScope.size() > 0 ) {

                    Button variable = new Button( Constants.INSTANCE.BoundVariable() );
                    variable.addClickHandler( new ClickHandler() {

                        public void onClick( ClickEvent event ) {
                            con.setConstraintValueType( SingleFieldConstraint.TYPE_VARIABLE );
                            doTypeChosen( form );
                        }
                    } );
                    form.addAttribute( Constants.INSTANCE.AVariable(),
                                       widgets( variable,
                                                new InfoPopup( Constants.INSTANCE.ABoundVariable(),
                                                               Constants.INSTANCE.BoundVariableTip() ) ) );
                }
            }
        }

        //Formula selector
        if ( showFormulaSelector ) {
            Button formula = new Button( Constants.INSTANCE.NewFormula() );
            formula.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    con.setConstraintValueType( SingleFieldConstraint.TYPE_RET_VALUE );
                    doTypeChosen( form );
                }
            } );

            form.addAttribute( Constants.INSTANCE.AFormula() + ":",
                               widgets( formula,
                                        new InfoPopup( Constants.INSTANCE.AFormula(),
                                                       Constants.INSTANCE.FormulaExpressionTip() ) ) );
        }

        //Expression selector
        if ( showExpressionSelector ) {
            Button expression = new Button( Constants.INSTANCE.ExpressionEditor() );
            expression.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    con.setConstraintValueType( SingleFieldConstraint.TYPE_EXPR_BUILDER_VALUE );
                    doTypeChosen( form );
                }
            } );

            form.addAttribute( Constants.INSTANCE.ExpressionEditor() + ":",
                               widgets( expression,
                                        new InfoPopup( Constants.INSTANCE.ExpressionEditor(),
                                                       Constants.INSTANCE.ExpressionEditor() ) ) );
        }

        form.show();
    }
View Full Code Here

        //Literal value selector
        if ( showLiteralSelector ) {
            form.addAttribute( GuidedRuleEditorResources.CONSTANTS.LiteralValue() + ":",
                               widgets( lit,
                                        new InfoPopup( GuidedRuleEditorResources.CONSTANTS.LiteralValue(),
                                                       GuidedRuleEditorResources.CONSTANTS.LiteralValTip() ) ) );
        }

        //Template key selector
        if ( modeller.isTemplate() ) {
            String templateKeyLabel = GuidedRuleEditorResources.CONSTANTS.TemplateKey();
            Button templateKeyButton = new Button( templateKeyLabel );
            templateKeyButton.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_TEMPLATE );
                    doTypeChosen( form );
                }
            } );

            form.addAttribute( templateKeyLabel + ":",
                               widgets( templateKeyButton,
                                        new InfoPopup( templateKeyLabel,
                                                       GuidedRuleEditorResources.CONSTANTS.LiteralValTip() ) ) );
        }

        //Divider, if we have any advanced options
        if ( showVariableSelector || showFormulaSelector || showExpressionSelector ) {
            form.addRow( new HTML( "<hr/>" ) );
            form.addRow( new SmallLabel( GuidedRuleEditorResources.CONSTANTS.AdvancedOptions() ) );
        }

        //Show variables selector, if there are any variables in scope
        if ( showVariableSelector ) {
            List<String> bindingsInScope = this.model.getBoundVariablesInScope( this.constraint );
            if ( bindingsInScope.size() > 0 || DataType.TYPE_COLLECTION.equals( this.fieldType ) ) {

                final Button bindingButton = new Button( GuidedRuleEditorResources.CONSTANTS.BoundVariable() );

                //This Set is used as a flag to know whether the button has been added; due to use of callbacks
                final Set<Button> bindingButtonContainer = new HashSet<Button>();

                for ( String var : bindingsInScope ) {
                    isApplicableBindingsInScope( var,
                                                 new Callback<Boolean>() {
                                                     @Override
                                                     public void callback( final Boolean result ) {
                                                         if ( Boolean.TRUE.equals( result ) ) {
                                                             if ( !bindingButtonContainer.contains( bindingButton ) ) {
                                                                 bindingButtonContainer.add( bindingButton );
                                                                 bindingButton.addClickHandler( new ClickHandler() {

                                                                     public void onClick( ClickEvent event ) {
                                                                         con.setConstraintValueType( SingleFieldConstraint.TYPE_VARIABLE );
                                                                         doTypeChosen( form );
                                                                     }
                                                                 } );
                                                                 form.addAttribute( GuidedRuleEditorResources.CONSTANTS.AVariable(),
                                                                                    widgets( bindingButton,
                                                                                             new InfoPopup( GuidedRuleEditorResources.CONSTANTS.ABoundVariable(),
                                                                                                            GuidedRuleEditorResources.CONSTANTS.BoundVariableTip() ) ) );
                                                             }
                                                         }
                                                     }
                                                 } );

                }
            }
        }

        //Formula selector
        if ( showFormulaSelector ) {
            Button formula = new Button( GuidedRuleEditorResources.CONSTANTS.NewFormula() );
            formula.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    con.setConstraintValueType( SingleFieldConstraint.TYPE_RET_VALUE );
                    doTypeChosen( form );
                }
            } );

            form.addAttribute( GuidedRuleEditorResources.CONSTANTS.AFormula() + ":",
                               widgets( formula,
                                        new InfoPopup( GuidedRuleEditorResources.CONSTANTS.AFormula(),
                                                       GuidedRuleEditorResources.CONSTANTS.FormulaExpressionTip() ) ) );
        }

        //Expression selector
        if ( showExpressionSelector ) {
            Button expression = new Button( GuidedRuleEditorResources.CONSTANTS.ExpressionEditor() );
            expression.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    con.setConstraintValueType( SingleFieldConstraint.TYPE_EXPR_BUILDER_VALUE );
                    doTypeChosen( form );
                }
            } );

            form.addAttribute( GuidedRuleEditorResources.CONSTANTS.ExpressionEditor() + ":",
                               widgets( expression,
                                        new InfoPopup( GuidedRuleEditorResources.CONSTANTS.ExpressionEditor(),
                                                       GuidedRuleEditorResources.CONSTANTS.ExpressionEditor() ) ) );
        }

        form.show();
    }
View Full Code Here

        //only show the drop down if we are not using fixed position.
        if ( position == null ) {
            HorizontalPanel hp0 = new HorizontalPanel();
            hp0.add( new HTML( GuidedRuleEditorResources.CONSTANTS.PositionColon() ) );
            hp0.add( positionCbo );
            hp0.add( new InfoPopup( GuidedRuleEditorResources.CONSTANTS.PositionColon(),
                    GuidedRuleEditorResources.CONSTANTS.ActionPositionExplanation() ) );
            layoutPanel.addRow( hp0 );
        }

        choices = makeChoicesListBox();
View Full Code Here

        //only show the drop down if we are not using fixed position.
        if ( position == null ) {
            HorizontalPanel hp0 = new HorizontalPanel();
            hp0.add( new HTML( GuidedRuleEditorResources.CONSTANTS.PositionColon() ) );
            hp0.add( positionCbo );
            hp0.add( new InfoPopup( GuidedRuleEditorResources.CONSTANTS.PositionColon(),
                    GuidedRuleEditorResources.CONSTANTS.ConditionPositionExplanation() ) );
            layoutPanel.addRow( hp0 );
        }

        choices = makeChoicesListBox();
View Full Code Here

TOP

Related Classes of org.uberfire.client.common.InfoPopup

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.