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


Java TextBox类代码示例

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


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

示例1: setup

import org.gwtbootstrap3.client.ui.TextBox; //导入依赖的package包/类
@PostConstruct
public void setup() {
    l = new Label( "Click to close" );
    t = new TextBox();
    b = new Button( "Close" );
    b.addClickHandler( new ClickHandler() {

        @Override
        public void onClick( final ClickEvent event ) {
            placeManager.closePlace( place );
        }
    } );
    view.add( l );
    view.add( t );
    view.add( b );
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:17,代码来源:SimplePopup.java

示例2: getFormValues

import org.gwtbootstrap3.client.ui.TextBox; //导入依赖的package包/类
public void getFormValues(List<FormGroup> controlGroups) {
    formValues = new HashMap();

    for (FormGroup groupControl : controlGroups) {
        if (groupControl.getWidget(1) instanceof TextBox) {
            formValues.put(((TextBox) groupControl.getWidget(1)).getName(),
                           ((TextBox) groupControl.getWidget(1)).getValue());
        } else if (groupControl.getWidget(1) instanceof ListBox) {
            ListBox listBox = (ListBox) groupControl.getWidget(1);

            List<String> selectedValues = new ArrayList<String>();
            for (int i = 0; i < listBox.getItemCount(); i++) {
                if (listBox.isItemSelected(i)) {
                    selectedValues.add(listBox.getValue(i));
                }
            }

            formValues.put(listBox.getName(),
                           selectedValues);
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:NewFilterPopup.java

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

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

示例5: createDomElement

import org.gwtbootstrap3.client.ui.TextBox; //导入依赖的package包/类
@Override
public TextBoxDOMElement createDomElement(final GridLayer gridLayer,
                                          final GridWidget gridWidget,
                                          final GridBodyCellRenderContext context) {
    final TextBox widget = createWidget();
    final TextBoxDOMElement e = new TextBoxDOMElement(widget,
                                                      gridLayer,
                                                      gridWidget);
    widget.addBlurHandler(new BlurHandler() {
        @Override
        public void onBlur(final BlurEvent event) {
            e.flush(widget.getValue());
            gridLayer.batch();
        }
    });
    return e;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:TextBoxDOMElementFactory.java

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

示例7: removeCharacteristic

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

示例8: booleanEditor

import org.gwtbootstrap3.client.ui.TextBox; //导入依赖的package包/类
private ListBox booleanEditor(final String currentValue) {
    final ListBox listBox = listBoxEditor(booleanOperators,
                                          currentValue,
                                          false);
    listBox.addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(final ChangeEvent event) {
            final int selectedIndex = listBox.getSelectedIndex();
            final String selectedValue = listBox.getItemText(selectedIndex);
            final boolean enabled = "true".equalsIgnoreCase(selectedValue);
            ddReasonCodeAlgorithm.setEnabled(enabled);
            tbBaselineScore.setEnabled(enabled);
            ddReasonCodeField.setEnabled(enabled);
            for (final FlexTable cGrid : characteristicsTables) {
                //baseline score for each characteristic
                ((TextBox) cGrid.getWidget(2, 2)).setEnabled(enabled);
                //reason code for each characteristic
                ((TextBox) cGrid.getWidget(2, 3)).setEnabled(enabled);
            }
        }
    });
    return listBox;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:24,代码来源:GuidedScoreCardEditor.java

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

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

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

示例12: FieldEditor

import org.gwtbootstrap3.client.ui.TextBox; //导入依赖的package包/类
public FieldEditor() {
    box = new TextBox();
    box.addChangeHandler(new ChangeHandler() {

        public void onChange(ChangeEvent event) {
            TextBox otherBox = (TextBox) event.getSource();

            if (!regex.equals("") && !otherBox.getText().matches(regex)) {
                Window.alert(GuidedRuleEditorResources.CONSTANTS.TheValue0IsNotValidForThisField(otherBox.getText()));
                box.setText(oldValue);
            } else {
                oldValue = otherBox.getText();
                updateSentence();
            }
        }
    });

    //Wrap widget within a HorizontalPanel to add a space before and after the Widget
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(new HTML("&nbsp;"));
    hp.add(box);
    hp.add(new HTML("&nbsp;"));

    initWidget(hp);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:26,代码来源:DSLSentenceWidget.java

示例13: defaultTextBoxHasHandlersAttachedInCorrectOrder

import org.gwtbootstrap3.client.ui.TextBox; //导入依赖的package包/类
@Test
public void defaultTextBoxHasHandlersAttachedInCorrectOrder() {
    final TextBox defaultTextBox = mock(TextBox.class);
    final ConstraintValueEditor editor = spy(createEditor(constraint));
    final InOrder inOrder = inOrder(editor);

    doReturn(defaultTextBox).when(editor).getDefaultTextBox(any(String.class));

    editor.getNewTextBox(DataType.TYPE_STRING);

    inOrder.verify(editor).setUpTextBoxStyleAndHandlers(eq(defaultTextBox),
                                                        any(Command.class));
    verify(defaultTextBox,
           times(1)).setText(any(String.class));
    inOrder.verify(editor).attachDisplayLengthHandler(eq(defaultTextBox));
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:17,代码来源:ConstraintValueEditorTest.java

示例14: ValueOptionsPageView

import org.gwtbootstrap3.client.ui.TextBox; //导入依赖的package包/类
@Inject
public ValueOptionsPageView(final Div valueListGroupContainer,
                            final Div cepWindowOperatorsGroupContainer,
                            final Div defaultValueGroupContainer,
                            final Div limitedValueGroupContainer,
                            final TextBox valueList,
                            final Div cepWindowOperatorsContainer,
                            final Div defaultValueContainer,
                            final Div limitedValueContainer,
                            final TranslationService translationService,
                            final DecisionTablePopoverUtils popoverUtils) {
    this.valueListGroupContainer = valueListGroupContainer;
    this.cepWindowOperatorsGroupContainer = cepWindowOperatorsGroupContainer;
    this.defaultValueGroupContainer = defaultValueGroupContainer;
    this.limitedValueGroupContainer = limitedValueGroupContainer;
    this.valueList = valueList;
    this.cepWindowOperatorsContainer = cepWindowOperatorsContainer;
    this.defaultValueContainer = defaultValueContainer;
    this.limitedValueContainer = limitedValueContainer;
    this.translationService = translationService;
    this.popoverUtils = popoverUtils;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:23,代码来源:ValueOptionsPageView.java

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


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