Search in sources :

Example 21 with TextBox

use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.

the class GuidedScoreCardEditor method removeCharacteristic.

private void removeCharacteristic(final FlexTable selectedTable) {
    if (selectedTable != null) {
        final TextBox tbName = (TextBox) selectedTable.getWidget(0, 1);
        String name = tbName.getValue();
        if (name == null || name.trim().length() == 0) {
            name = "Untitled";
        }
        final String msg = GuidedScoreCardConstants.INSTANCE.promptDeleteCharacteristic0(name);
        if (Window.confirm(msg)) {
            characteristicsTables.remove(selectedTable);
            characteristicsAttrMap.remove(selectedTable);
            final Widget parent = selectedTable.getParent().getParent();
            final int i = characteristicsPanel.getWidgetIndex(parent);
            characteristicsPanel.remove(parent);
            characteristicsPanel.remove(i);
        }
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) TextBox(org.gwtbootstrap3.client.ui.TextBox)

Example 22 with TextBox

use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.

the class FactPatternWidget method predicateEditor.

/**
 * This provides an inline formula editor, not unlike a spreadsheet does.
 */
private Widget predicateEditor(final SingleFieldConstraint c) {
    HorizontalPanel pred = new HorizontalPanel();
    pred.setWidth("100%");
    Image img = new Image(GuidedRuleEditorResources.INSTANCE.images().functionAssets());
    img.setTitle(GuidedRuleEditorResources.CONSTANTS.FormulaBooleanTip());
    pred.add(img);
    if (c.getValue() == null) {
        c.setValue("");
    }
    final TextBox box = new TextBox();
    box.setText(c.getValue());
    if (!this.readOnly) {
        box.addChangeHandler(new ChangeHandler() {

            public void onChange(ChangeEvent event) {
                setModified(true);
                c.setValue(box.getText());
            }
        });
        box.setWidth("100%");
        pred.add(box);
    } else {
        pred.add(new SmallLabel(c.getValue()));
    }
    return pred;
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) ExpressionTypeChangeEvent(org.drools.workbench.screens.guided.rule.client.editor.ExpressionTypeChangeEvent) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) ExpressionTypeChangeHandler(org.drools.workbench.screens.guided.rule.client.editor.ExpressionTypeChangeHandler) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) TextBox(org.gwtbootstrap3.client.ui.TextBox) Image(com.google.gwt.user.client.ui.Image)

Example 23 with TextBox

use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.

the class ActionValueEditor method formulaEditor.

/**
 * 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>() {

        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
            value.setValue(event.getValue());
            executeOnChangeCommand();
        }
    });
    // FireEvents as the box could assume a default value
    box.setValue(assertValue(), true);
    attachDisplayLengthHandler(box);
    return box;
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) TextBox(org.gwtbootstrap3.client.ui.TextBox)

Example 24 with TextBox

use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.

the class ConstraintValueEditor method getNewTextBox.

TextBox getNewTextBox(final String fieldType) {
    final TextBox box = getDefaultTextBox(fieldType);
    setUpTextBoxStyleAndHandlers(box, onValueChangeCommand);
    box.setText(getSanitizedValue());
    attachDisplayLengthHandler(box);
    return box;
}
Also used : TextBox(org.gwtbootstrap3.client.ui.TextBox)

Example 25 with TextBox

use of org.gwtbootstrap3.client.ui.TextBox in project drools-wb by kiegroup.

the class ConstraintValueEditor method returnValueEditor.

/**
 * An editor for the retval "formula" (expression).
 */
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);
    box.setTitle(msg);
    box.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(final ValueChangeEvent event) {
            executeOnValueChangeCommand();
        }
    });
    Widget ed = widgets(img, box);
    return ed;
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) IsWidget(com.google.gwt.user.client.ui.IsWidget) Widget(com.google.gwt.user.client.ui.Widget) TextBox(org.gwtbootstrap3.client.ui.TextBox) Image(com.google.gwt.user.client.ui.Image)

Aggregations

TextBox (org.gwtbootstrap3.client.ui.TextBox)31 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)11 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)11 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)10 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)10 ListBox (org.gwtbootstrap3.client.ui.ListBox)9 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)7 Button (org.gwtbootstrap3.client.ui.Button)7 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)7 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)6 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)6 FlexTable (com.google.gwt.user.client.ui.FlexTable)5 Widget (com.google.gwt.user.client.ui.Widget)5 Date (java.util.Date)5 DatePicker (org.uberfire.ext.widgets.common.client.common.DatePicker)5 InputElement (com.google.gwt.dom.client.InputElement)4 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)4 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)4 HTML (com.google.gwt.user.client.ui.HTML)4 Image (com.google.gwt.user.client.ui.Image)3