当前位置: 首页>>代码示例>>Java>>正文


Java TextBox.addValueChangeHandler方法代码示例

本文整理汇总了Java中org.gwtbootstrap3.client.ui.TextBox.addValueChangeHandler方法的典型用法代码示例。如果您正苦于以下问题:Java TextBox.addValueChangeHandler方法的具体用法?Java TextBox.addValueChangeHandler怎么用?Java TextBox.addValueChangeHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gwtbootstrap3.client.ui.TextBox的用法示例。


在下文中一共展示了TextBox.addValueChangeHandler方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: editableTextBox

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
private static TextBox editableTextBox(final ValueChanged changed,
                                       final String dataType,
                                       final String fieldName,
                                       final String initialValue) {
    final TextBox tb = TextBoxFactory.getTextBox(dataType);
    tb.setText(initialValue);
    String m = TestScenarioConstants.INSTANCE.ValueFor0(fieldName);
    tb.setTitle(m);
    tb.addValueChangeHandler(new ValueChangeHandler<String>() {

        public void onValueChange(final ValueChangeEvent<String> event) {
            changed.valueChanged(event.getValue());
        }
    });

    return tb;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:18,代码来源:VerifyFieldConstraintEditor.java

示例2: returnValueEditor

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:26,代码来源:ConstraintValueEditor.java

示例3: formulaEditor

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:25,代码来源:ActionValueEditor.java

示例4: addNumericTextBoxChangeHandler

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
private void addNumericTextBoxChangeHandler(final TextBox textBox,
                                            final DTCellValue52 value,
                                            final Function<String, ? extends Number> valueOf,
                                            final Number emptyValue,
                                            final Number zeroValue) {
    if (!isReadOnly) {
        textBox.addValueChangeHandler(new ValueChangeHandler<String>() {

            public void onValueChange(ValueChangeEvent<String> event) {
                try {
                    value.setNumericValue(valueOf.apply(event.getValue()));
                } catch (NumberFormatException nfe) {
                    if (allowEmptyValues) {
                        value.setNumericValue(emptyValue);
                        textBox.setValue("");
                    } else {
                        value.setNumericValue(zeroValue);
                        textBox.setValue("0");
                    }
                }
            }
        });
    }
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:25,代码来源:DTCellValueWidgetFactory.java

示例5: makeTextBox

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
private TextBox makeTextBox(final DTCellValue52 value) {
    TextBox tb = new TextBox();
    tb.setValue(value.getStringValue());

    // Wire up update handler
    tb.setEnabled(!isReadOnly);
    if (!isReadOnly) {
        tb.addValueChangeHandler(new ValueChangeHandler<String>() {

            public void onValueChange(ValueChangeEvent<String> event) {
                value.setStringValue(event.getValue());
            }
        });
    }
    return tb;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:17,代码来源:DTCellValueWidgetFactory.java

示例6: setUpTextBoxStyleAndHandlers

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
void setUpTextBoxStyleAndHandlers(final TextBox box,
                                  final Command onChangeCommand) {
    box.setStyleName("constraint-value-Editor");
    box.addValueChangeHandler((e) -> {
        constraint.setValue(e.getValue());
        if (onChangeCommand != null) {
            onChangeCommand.execute();
        }
    });
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:11,代码来源:ConstraintValueEditor.java

示例7: createWidgetForExpression

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
private Widget createWidgetForExpression() {
    final HorizontalPanel container = new HorizontalPanel();
    container.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    container.setStylePrimaryName(GuidedRuleEditorResources.INSTANCE.css().container());
    for (ExpressionPart expressionPart : expression.getParts()) {
        if (expressionPart instanceof ExpressionUnboundFact) {
            continue;
        } else if (this.readOnly) {
            container.add(new Label(expressionPart.getName()));
        } else if (expressionPart instanceof ExpressionMethod) {
            container.add(new Label(expressionPart.getName()));
            container.add(new Label("("));
            final ExpressionMethod em = (ExpressionMethod) expressionPart;
            final List<ExpressionFormLine> emParams = em.getOrderedParams();
            for (int index = 0; index < emParams.size(); index++) {
                final ExpressionFormLine paramValueHolder = emParams.get(index);
                final String paramDataType = em.getParameterDataType(paramValueHolder);
                final ExpressionMethodParameter paramValue = ((ExpressionMethodParameter) paramValueHolder.getRootExpression());
                final TextBox paramValueEditor = TextBoxFactory.getTextBox(paramDataType);
                paramValueEditor.addValueChangeHandler(new ValueChangeHandler<String>() {
                    @Override
                    public void onValueChange(ValueChangeEvent<String> event) {
                        paramValue.setText(event.getValue());
                    }
                });
                paramValueEditor.setText(paramValue.getName());
                container.add(paramValueEditor);
                if (index < emParams.size() - 1) {
                    container.add(new Label(", "));
                }
            }
            container.add(new Label(")"));
        } else if (!(expressionPart instanceof ExpressionText)) {
            container.add(new Label(expressionPart.getName()));
        } else {
            final TextBox tb = new TextBox();
            final ExpressionText expressionTextPart = (ExpressionText) expressionPart;
            tb.setText(expressionTextPart.getName());
            tb.addChangeHandler(new ChangeHandler() {
                @Override
                public void onChange(final ChangeEvent changeEvent) {
                    expressionTextPart.setText(tb.getText());
                }
            });
            container.add(tb);
        }
        container.add(new Label("."));
    }
    return container;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:51,代码来源:ExpressionBuilder.java


注:本文中的org.gwtbootstrap3.client.ui.TextBox.addValueChangeHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。