Package org.kie.uberfire.client.common

Examples of org.kie.uberfire.client.common.SmallLabel


        FormStyleLayout layout = new FormStyleLayout();
        //Adding metadata here, seems redundant to add a new widget for metadata. Model does handle meta data separate.
        RuleMetadata[] meta = model.metadataList;
        if ( meta.length > 0 ) {
            HorizontalPanel hp = new HorizontalPanel();
            hp.add( new SmallLabel( GuidedRuleEditorResources.CONSTANTS.Metadata2() ) );
            layout.addRow( hp );
        }
        for ( int i = 0; i < meta.length; i++ ) {
            RuleMetadata rmd = meta[ i ];
            layout.addAttribute( rmd.getAttributeName(),
                                 getEditorWidget( rmd,
                                                  i,
                                                  isReadOnly ) );
        }
        RuleAttribute[] attrs = model.attributes;
        if ( attrs.length > 0 ) {
            HorizontalPanel hp = new HorizontalPanel();
            hp.add( new SmallLabel( GuidedRuleEditorResources.CONSTANTS.Attributes1() ) );
            layout.addRow( hp );
        }
        for ( int i = 0; i < attrs.length; i++ ) {
            RuleAttribute at = attrs[ i ];
            layout.addAttribute( at.getAttributeName(),
View Full Code Here


                if (result) {
                    addBoundVariableButton(form);

                    form.addRow(new HTML("<hr/>"));
                    form.addRow(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.AdvancedSection()));
                }

                //Formulas
                Button formula = new Button(GuidedRuleEditorResources.CONSTANTS.NewFormula());
                formula.addClickHandler(new ClickHandler() {
View Full Code Here

    }

    private void addBoundVariableButton(
            final FormStylePopup form) {
        form.addRow(new HTML("<hr/>"));
        form.addRow(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.AdvancedSection()));
        Button variableButton = new Button(GuidedRuleEditorResources.CONSTANTS.BoundVariable());
        form.addAttribute(GuidedRuleEditorResources.CONSTANTS.BoundVariable() + ":",
                variableButton);
        variableButton.addClickHandler(new ClickHandler() {
View Full Code Here

    /**
     * An editor for Template Keys
     */
    private Widget templateKeyEditor() {
        if ( this.readOnly ) {
            return new SmallLabel( assertValue() );
        }

        TemplateKeyTextBox box = new TemplateKeyTextBox();
        box.addValueChangeHandler( new ValueChangeHandler<String>() {

View Full Code Here

     * An editor for formula
     * @return
     */
    private Widget formulaEditor() {
        if ( this.readOnly ) {
            return new SmallLabel( assertValue() );
        }

        final TextBox box = new TextBox();
        box.addValueChangeHandler( new ValueChangeHandler<String>() {

View Full Code Here

                                        new InfoPopup( GuidedRuleEditorResources.CONSTANTS.Literal(),
                                                GuidedRuleEditorResources.CONSTANTS.ALiteralValueMeansTheValueAsTypedInIeItsNotACalculation() ) ) );
        }

        form.addRow( new HTML( "<hr/>" ) );
        form.addRow( new SmallLabel( GuidedRuleEditorResources.CONSTANTS.AdvancedSection() ) );

        Button formula = new Button( GuidedRuleEditorResources.CONSTANTS.Formula() );
        formula.addClickHandler( new ClickHandler() {

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

            }
        }

        //Label if read-only
        if ( this.readOnly ) {
            return new SmallLabel( assertValue() );
        }

        //Enumeration (these support multi-select for "in" and "not in", so check before comma separated lists)
        if ( this.dropDownData != null ) {
            final String operator = constraint.getOperator();
            final boolean multipleSelect = OperatorsOracle.operatorRequiresList( operator );
            EnumDropDown enumDropDown = new EnumDropDown( constraint.getValue(),
                                                          new DropDownValueChanged() {

                                                              public void valueChanged( String newText,
                                                                                        String newValue ) {

                                                                  //Prevent recursion once value change has been applied
                                                                  if ( !newValue.equals( constraint.getValue() ) ) {
                                                                      constraint.setValue( newValue );
                                                                      executeOnValueChangeCommand();
                                                                      makeDirty();
                                                                  }
                                                              }
                                                          },
                                                          dropDownData,
                                                          multipleSelect );
            return enumDropDown;
        }

        //Comma separated value list (this will become a dedicated Widget but for now a TextBox suffices)
        String operator = null;
        if ( this.constraint instanceof SingleFieldConstraint ) {
            SingleFieldConstraint sfc = (SingleFieldConstraint) this.constraint;
            operator = sfc.getOperator();
        }
        if ( OperatorsOracle.operatorRequiresList( operator ) ) {
            final TextBox box = TextBoxFactory.getTextBox( DataType.TYPE_STRING );
            box.setStyleName( "constraint-value-Editor" );
            box.addValueChangeHandler( new ValueChangeHandler<String>() {

                public void onValueChange( final ValueChangeEvent<String> event ) {
                    constraint.setValue( event.getValue() );
                    executeOnValueChangeCommand();
                    makeDirty();
                }
            } );

            box.setText( assertValue() );
            attachDisplayLengthHandler( box );
            return box;
        }

        //Date picker
        boolean isCEPOperator = CEPOracle.isCEPOperator( ( this.constraint ).getOperator() );
        if ( DataType.TYPE_DATE.equals( this.fieldType ) || ( DataType.TYPE_THIS.equals( this.fieldName ) && isCEPOperator ) ) {
            if ( this.readOnly ) {
                return new SmallLabel( constraint.getValue() );
            }

            final PopupDatePicker dp = new PopupDatePicker( false );

            // Wire up update handler
View Full Code Here

    }

    private Widget variableEditor() {

        if ( this.readOnly ) {
            return new SmallLabel( this.constraint.getValue() );
        }

        final ListBox box = new ListBox();
        box.addItem( GuidedRuleEditorResources.CONSTANTS.Choose() );
View Full Code Here

     */
    private Widget returnValueEditor() {
        TextBox box = new BoundTextBox( constraint );

        if ( this.readOnly ) {
            return new SmallLabel( box.getText() );
        }

        String msg = GuidedRuleEditorResources.CONSTANTS.FormulaEvaluateToAValue();
        Image img = new Image( GuidedRuleEditorResources.INSTANCE.images().functionAssets() );
        img.setTitle( msg );
View Full Code Here

    /**
     * An editor for Template Keys
     */
    private Widget templateKeyEditor() {
        if ( this.readOnly ) {
            return new SmallLabel( assertValue() );
        }

        TemplateKeyTextBox box = new TemplateKeyTextBox();
        box.setStyleName( "constraint-value-Editor" );
        box.addValueChangeHandler( new ValueChangeHandler<String>() {
View Full Code Here

TOP

Related Classes of org.kie.uberfire.client.common.SmallLabel

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.