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


Java TextBox.setValue方法代码示例

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


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

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

示例2: boundFormulaTextBox

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
private TextBox boundFormulaTextBox() {
    final TextBox box = new TextBox();
    box.setStyleName("constraint-value-Editor");
    if (this.methodParameter.getValue() == null) {
        box.setValue("");
    } else {
        box.setValue(this.methodParameter.getValue());
    }

    box.addKeyUpHandler(new KeyUpHandler() {
        @Override
        public void onKeyUp(KeyUpEvent event) {
            setMethodParameterValue(box.getValue());
        }
    });

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

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

示例4: ConstraintMatchInputWidget

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
public ConstraintMatchInputWidget(final AbstractActionConstraintMatch actionConstraintMatch) {
    constraintMatchTextBox = new TextBox();
    helpBlock = new HelpBlock();
    add(constraintMatchTextBox);
    add(helpBlock);

    constraintMatchTextBox.setValue(actionConstraintMatch.getConstraintMatch() == null ? "" : actionConstraintMatch.getConstraintMatch());
    constraintMatchTextBox.setEnabled(false);
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:10,代码来源:ConstraintMatchInputWidget.java

示例5: testFieldMatchValidator

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
/**
 * Test the {@link FieldMatchValidator} class.
 */
public void testFieldMatchValidator() {
    TextBox field1 = new TextBox();
    TextBox field2 = new TextBox();

    field1.setValue("1234");
    field2.setValue(field1.getValue());
    field2.addValidator(new FieldMatchValidator<String>(field1));
    assertTrue(field2.validate());

    field2.setValue("12345");
    assertFalse(field2.validate());
}
 
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3,代码行数:16,代码来源:ValidatorsGwt.java

示例6: createBendableConstraintMatchRow

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
private HorizontalPanel createBendableConstraintMatchRow(final String labelText,
                                                         final int index,
                                                         final List<HelpIcon> hardConstraintMatchHelpIcons,
                                                         final List<ConstraintMatchInputWidget> constraintMatchInputWidgets,
                                                         final AbstractActionBendableConstraintMatch constraintMatch) {
    HorizontalPanel horizontalPanel = new HorizontalPanel();

    HorizontalPanel labelPanel = new HorizontalPanel();
    labelPanel.add(new Label(labelText));
    horizontalPanel.add(labelPanel);

    HorizontalPanel selectPanel = new HorizontalPanel();

    TextBox constraintLevelTextBox = new TextBox();
    constraintLevelTextBox.setEnabled(false);
    constraintLevelTextBox.getElement().getStyle().setWidth(40,
                                                            Style.Unit.PX);
    constraintLevelTextBox.setValue(String.valueOf(index));
    selectPanel.add(constraintLevelTextBox);

    HelpIcon constraintLevelSelectHelpIcon = new HelpIcon();
    hardConstraintMatchHelpIcons.add(constraintLevelSelectHelpIcon);
    constraintLevelSelectHelpIcon.setVisible(false);
    constraintLevelSelectHelpIcon.setHelpContent(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_ScoreLevelExceeded));
    constraintLevelSelectHelpIcon.getElement().getStyle().setPaddingLeft(5,
                                                                         Style.Unit.PX);
    selectPanel.add(constraintLevelSelectHelpIcon);

    horizontalPanel.add(selectPanel);

    ConstraintMatchInputWidget constraintMatchInputWidget = new ConstraintMatchInputWidget(constraintMatch);
    constraintMatchInputWidget
            .addConstraintMatchValueChangeHandler(new ConstraintMatchValueChangeHandler(constraintMatch));
    constraintMatchInputWidgets.add(constraintMatchInputWidget);

    horizontalPanel.add(constraintMatchInputWidget);
    horizontalPanel.setCellWidth(labelPanel,
                                 "150px");
    horizontalPanel.setCellWidth(selectPanel,
                                 "70px");

    horizontalPanel.setStyleName(GuidedRuleEditorResources.INSTANCE.css().multiConstraintMatch());
    horizontalPanel.getElement().getStyle().setWidth(100,
                                                     Style.Unit.PCT);

    return horizontalPanel;
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:48,代码来源:MultiConstraintBendableMatchRuleModellerWidget.java

示例7: testGroupValidators

import org.gwtbootstrap3.client.ui.TextBox; //导入方法依赖的package包/类
public void testGroupValidators() {

        final TextBox box1 = new TextBox();
        box1.setAllowBlank(false);
        final TextBox box2 = new TextBox();
        box2.setAllowBlank(false);
        final TextBox box3 = new TextBox();
        box3.setAllowBlank(false);

        assertFalse(box1.validate(false));
        assertFalse(box2.validate(false));
        assertFalse(box3.validate(false));

        GroupValidator validatorGroup = new GroupValidator();
        validatorGroup.add(box1);
        validatorGroup.add(box2);
        validatorGroup.add(box3);

        box1.setValue("box1");
        assertFalse(validatorGroup.validate(false));
        box2.setValue("box2");
        assertFalse(validatorGroup.validate(false));
        box3.setValue("box3");
        assertTrue(validatorGroup.validate(false));

        validatorGroup.addValidationChangedHandler(new ValidationChangedHandler() {
            @Override
            public void onValidationChanged(ValidationChangedEvent event) {
                assertFalse(event.isValid());
                finishTest();
            }
        });

        delayTestFinish(500);
        Scheduler.get().scheduleDeferred(new Command() {
            @Override
            public void execute() {
                box1.setValue("", true);
            }
        });

    }
 
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3,代码行数:43,代码来源:ValidatorsGwt.java


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