Package org.drools.guvnor.client.common

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


          r.set(dta, newValue);
        }
      });

      p.add(datePicker);
      p.add(new InfoPopup(constants.CategoryParentRules(), Format.format(
          constants.FillInColumnWithValue(), typeDescription)));

      w.add(p);
      w.setBorder(false);

      Button ok = new Button(constants.OK());
      ok.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent arg0) {
          r.set(dta, datePicker.getDateString());
          w.destroy();
        }
      });

      p.add(ok);
     
    } else {
      final TextBox box = new TextBox();
      box.setText(val);
      box.addKeyboardListener(new KeyboardListenerAdapter() {
        public void onKeyUp(Widget sender, char keyCode, int modifiers) {
          if (keyCode == KeyboardListener.KEY_ENTER) {
            r.set(dta, box.getText());
            w.destroy();
          }
        }
      });

      if (dt.isNumeric(colConf, getSCE())) {
        box.addKeyboardListener(ActionValueEditor
                .getNumericFilter(box));
      }

      p.add(box);
      if (typeDescription != null) {
        p.add(new InfoPopup(constants.CategoryParentRules(), Format
            .format(constants.FillInColumnWithValue(),
                typeDescription)));
      }
      w.add(p);
      w.setBorder(false);
View Full Code Here


    private Widget h(Widget w,
                     String string) {
        HorizontalPanel hp = new HorizontalPanel();
        hp.add( w );
        hp.add( new InfoPopup( constants.Tip(),
                               string ) );
        return hp;
    }
View Full Code Here

            }
        } );

        HorizontalPanel hp = new HorizontalPanel();
        hp.add( add );
        hp.add( new InfoPopup( constants.CategoryParentRules(),
                               constants.CatRulesInfo() ) );
        return hp;
    }
View Full Code Here

          }
        }
      }
    });

    InfoPopup info = new InfoPopup(constants.TypesInThePackage(), constants.IfNoTypesTip());
    HorizontalPanel h = new HorizontalPanel();
    h.add(factList);
    h.add(info);
    pop.addAttribute(constants.ChooseClassType(), h);
    final TextBox globalName = new TextBox();
    if (global) {
      pop.addAttribute(constants.GlobalName(), globalName);
    }
    final TextBox className = new TextBox();
    InfoPopup infoClass = new InfoPopup(constants.EnteringATypeClassName(), constants.EnterTypeNameTip());
    h = new HorizontalPanel();
    h.add(className);
    h.add(infoClass);
    pop.addAttribute(constants.advancedClassName(), h);
View Full Code Here

    private SmallLabel                 operatorLabel               = new SmallLabel();
    private Constants                  constants                   = ((Constants) GWT.create( Constants.class ));
    private InfoPopup                  fieldLabelInterpolationInfo = getPredicateHint();

    private InfoPopup getPredicateHint() {
        return new InfoPopup( constants.Predicates(),
                              constants.PredicatesInfo() );
    }
View Full Code Here

                editingCol.valueList = valueList.getText();
            }
        } );
        HorizontalPanel vl = new HorizontalPanel();
        vl.add( valueList );
        vl.add( new InfoPopup( constants.ValueList(),
                               constants.ValueListsExplanation() ) );
        addAttribute( constants.optionalValueList(),
                      vl );

        final TextBox header = new TextBox();
View Full Code Here

                doTypeChosen(form);
            }
        });
        form.addAttribute(constants.LiteralValue() + ":",
                widgets(lit,
                new InfoPopup(constants.LiteralValue(),
                constants.LiteralValTip())));

        if (modeller.isTemplate()) {
            String templateKeyLabel = 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,
                    constants.LiteralValTip())));
        }

        form.addRow(new HTML("<hr/>"));
        form.addRow(new SmallLabel(constants.AdvancedOptions()));

        //only want to show variables if we have some !
        if (this.model.getBoundVariablesInScope(this.constraint).size() > 0 || SuggestionCompletionEngine.TYPE_COLLECTION.equals(this.fieldType)) {
            List<String> vars = this.model.getBoundFacts();
            boolean foundABouncVariableThatMatches = false;
            for (String var : vars) {
                FactPattern f = model.getBoundFact(var);
                String fieldConstraint = model.getBindingType(var);

                if ((f != null && f.factType != null && this.fieldType != null)
                        && (f.factType.equals(this.fieldType)
                        || this.fieldType.equals(fieldConstraint))) {
                    foundABouncVariableThatMatches = true;
                    break;
                } else {
                    // for collection, present the list of possible bound variable
                    String factCollectionType = sce.getParametricFieldType(pattern.factType,
                            this.fieldName);
                    if ((f != null && factCollectionType != null && f.factType.equals(factCollectionType)) || (factCollectionType != null && factCollectionType.equals(fieldConstraint))) {
                        foundABouncVariableThatMatches = true;
                        break;
                    }
                }
            }
            if (foundABouncVariableThatMatches) {
                Button variable = new Button(constants.BoundVariable());
                variable.addClickHandler(new ClickHandler() {

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

        Button formula = new Button(constants.NewFormula());
        formula.addClickHandler(new ClickHandler() {

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

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

        Button expression = new Button(constants.ExpressionEditor());
        expression.addClickHandler(new ClickHandler() {

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

        form.addAttribute(constants.ExpressionEditor() + ":",
                widgets(expression,
                new InfoPopup(constants.ExpressionEditor(),
                constants.ExpressionEditor())));

        form.show();
    }
View Full Code Here

            }

        });
        form.addAttribute(constants.LiteralValue() + ":",
                widgets(lit,
                        new InfoPopup(constants.LiteralValue(),
                                constants.LiteralValTip())));

        form.addRow(new HTML("<hr/>"));
        form.addRow(new SmallLabel(constants.AdvancedOptions()));

        // If we are here, then there must be a bound variable compatible with
        // me
        if (isThereABoundVariableToSet() == true) {
            Button variable = new Button(constants.BoundVariable());
            variable.addClickListener(new ClickListener() {
                public void onClick(Widget w) {
                    con.nature = FieldData.TYPE_VARIABLE;
                    doTypeChosen(form);
                }
            });
            form.addAttribute(constants.AVariable(),
                    widgets(variable,
                            new InfoPopup(constants.ABoundVariable(),
                                    constants.BoundVariableTip())));
        }
        if (isItAList() == true) {
            Button variable = new Button(constants.GuidedList());
            variable.addClickListener(new ClickListener() {
                public void onClick(Widget w) {
                    String factCollectionType = sce.getParametricFieldType(factType, field.name);
                    con.setNature(FieldData.TYPE_COLLECTION, factCollectionType);
                    doTypeChosen(form);
                }
            });
            form.addAttribute(constants.AVariable(),
                    widgets(variable,
                            new InfoPopup(constants.AGuidedList(),
                                    constants.AGuidedListTip())));
        }
        form.show();
    }
View Full Code Here

            }
        } );

        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.nature = FieldNature.TYPE_TEMPLATE;
                    value.value = "";
                    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.nature = FieldNature.TYPE_FORMULA;
                value.value = "=";
                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.nature = FieldNature.TYPE_VARIABLE;
                    value.value = "=";
                    doTypeChosen( form );
                }
            } );
        }

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

        form.show();
    }
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
                 || SuggestionCompletionEngine.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

TOP

Related Classes of org.drools.guvnor.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.