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


Java TextBox.setText方法代码示例

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


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

示例1: addTextBoxToFilter

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
public void addTextBoxToFilter(String label,
                               String fieldName,
                               String defaultValue) {
    FormGroup controlGroup = new FormGroup();

    FormLabel controlLabel = new FormLabel();
    controlLabel.setTitle(label);
    HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>");
    controlLabel.setHTML(lab.getHTML());

    TextBox textBox = new TextBox();
    textBox.setName(fieldName);
    if (defaultValue != null && defaultValue.trim().length() > 0) {
        textBox.setText(defaultValue);
    }

    controlGroup.add(controlLabel);
    controlGroup.add(textBox);

    filterControlGroups.add(controlGroup);
    horizontalForm.add(controlGroup);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:NewFilterPopup.java

示例2: addTextBoxToFilter

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
public void addTextBoxToFilter(String label,
                               String fieldName,
                               String defaultValue) {
    FormGroup controlGroup = new FormGroup();

    FormLabel controlLabel = new FormLabel();
    controlLabel.setTitle(label);
    HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>");
    controlLabel.setHTML(lab.getHTML());

    TextBox textBox = new TextBox();
    textBox.setName(fieldName);
    if (defaultValue != null && defaultValue.trim().length() > 0) {
        textBox.setText(defaultValue);
    }

    controlGroup.add(controlLabel);
    controlGroup.add(textBox);

    filterControlGroups.add(controlGroup);
    filterForm.add(controlGroup);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:NewTabFilterPopup.java

示例3: 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

示例4: getHiddenField

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
private TextBox getHiddenField(String name,
                               String value) {
    TextBox t = new TextBox();
    t.setName(name);
    t.setText(value);
    t.setVisible(false);
    return t;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:9,代码来源:GAVEditor.java

示例5: getNewTextBox

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
TextBox getNewTextBox(final String fieldType) {
    final TextBox box = getDefaultTextBox(fieldType);
    setUpTextBoxStyleAndHandlers(box,
                                 onValueChangeCommand);
    box.setText(getSanitizedValue());
    attachDisplayLengthHandler(box);
    return box;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:9,代码来源:ConstraintValueEditor.java

示例6: doBindingEditor

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
/**
 * This adds in (optionally) the editor for changing the bound variable
 * name. If its a bindable pattern, it will show the editor, if it is
 * already bound, and the name is used, it should not be editable.
 */
private void doBindingEditor(final FormStylePopup popup) {
    if (bindable || !(modeller.getModel().isBoundFactUsed(pattern.getBoundName()))) {
        HorizontalPanel varName = new HorizontalPanel();
        final TextBox varTxt = new BindingTextBox();
        if (pattern.getBoundName() == null) {
            varTxt.setText("");
        } else {
            varTxt.setText(pattern.getBoundName());
        }

        ((InputElement) varTxt.getElement().cast()).setSize(6);
        varName.add(varTxt);

        Button bindVar = new Button(HumanReadableConstants.INSTANCE.Set());
        bindVar.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                String var = varTxt.getText();
                if (modeller.isVariableNameUsed(var)) {
                    Window.alert(GuidedRuleEditorResources.CONSTANTS.TheVariableName0IsAlreadyTaken(var));
                    return;
                }
                pattern.setBoundName(varTxt.getText());
                modeller.refreshWidget();
                popup.hide();
            }
        });

        varName.add(bindVar);
        popup.addAttribute(GuidedRuleEditorResources.CONSTANTS.VariableName(),
                           varName);
    }
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:38,代码来源:PopupCreator.java

示例7: showBindingPopUp

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
private void showBindingPopUp() {
    final FormStylePopup popup = new FormStylePopup(GuidedRuleEditorResources.CONSTANTS.ExpressionEditor());
    final TextBox varName = new TextBox();
    if (expression.isBound()) {
        varName.setText(expression.getBinding());
    }
    popup.addAttribute(GuidedRuleEditorResources.CONSTANTS.BindTheExpressionToAVariable(), new InputGroup() {{
        add(varName);
        add(new InputGroupButton() {{
            add(new Button(HumanReadableConstants.INSTANCE.Set()) {{
                addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        String var = varName.getText();
                        if (getModeller().isVariableNameUsed(var)) {
                            Window.alert(GuidedRuleEditorResources.CONSTANTS.TheVariableName0IsAlreadyTaken(var));
                            return;
                        }
                        expression.setBinding(var);
                        getModeller().refreshWidget();
                        popup.hide();
                    }
                });
            }});
        }});
    }});
    popup.show();
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:28,代码来源:ExpressionBuilder.java

示例8: predicateEditor

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

示例9: hideTextBox

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
private void hideTextBox(final TextBox textBox) {
    textBox.setText(null);
    textBox.setVisible(false);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:5,代码来源:UploadFormViewImpl.java

示例10: 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.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。