public class Simple extends Base { private Simple(TextBox t) { super(t); // continue doing stuff with t here } public Simple() { this(new TextBox()); } }
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(); } } });
@Override public void setVersionText(final String text) { versionText.setText(text); } }
public void onKeyUp(KeyUpEvent event) { int length = box.getText().length(); ((InputElement) box.getElement().cast()).setSize(length > 0 ? length : 1); } });
protected void initTextBoxByRuleAttribute(final TextBox textBox, final RuleAttribute ruleAttribute) { textBox.setEnabled(!isReadOnly); if (!isReadOnly) { textBox.addValueChangeHandler(event -> ruleAttribute.setValue(textBox.getValue())); } textBox.setValue(ruleAttribute.getValue()); }
private TextBox getHiddenField(String name, String value) { TextBox t = new TextBox(); t.setName(name); t.setText(value); t.setVisible(false); return t; } }
private void attachDisplayLengthHandler(final TextBox box) { int length = box.getText().length(); ((InputElement) box.getElement().cast()).setSize(length > 0 ? length : 1); box.addKeyUpHandler(new KeyUpHandler() { public void onKeyUp(KeyUpEvent event) { int length = box.getText().length(); ((InputElement) box.getElement().cast()).setSize(length > 0 ? length : 1); } }); }
@Override public void onKeyUp(KeyUpEvent event) { setMethodParameterValue(box.getValue()); } });
/** {@inheritDoc} */ @Override public void setValue(final Date value, final boolean fireEvents) { errorHandlerMixin.clearErrors(); textBox.setValue(value != null ? dateTimeFormat.format(value) : null); update(textBox.getElement()); if (fireEvents) { ValueChangeEvent.fire(DatePickerBase.this, value); } }
@Override public void setFolder(String folder) { documentFolderText.setText(folder); documentFolderText.setEnabled(false); hiddenDocumentFolderText.setValue(folder); } // @Override
@Override public void onNodeMouseDoubleClick(final NodeMouseDoubleClickEvent nodeMouseDoubleClickEvent) { editTextBox.setText(text.getText()); editTextBox.getElement().getStyle().setPosition(Style.Position.FIXED); editTextBox.getElement().getStyle().setLeft(getX() + getLayer().getCanvasElement().getAbsoluteLeft(), Style.Unit.PX); editTextBox.getElement().getStyle().setTop(getY() + getLayer().getCanvasElement().getAbsoluteTop(), Style.Unit.PX); RootPanel.get().add(editTextBox); editTextBox.setFocus(true); } });
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); }
@Override public void disableGroupID(final String reason) { groupIdTextBox.setEnabled(false); groupIdTextBox.setTitle(reason); }
Label l = new Label("$"); TextBox b = new TextBox(); l.getElement().addClassName("dollarlabel"); b.getElement().addClassName("dollarinput"); RootPanel.get().add(b); RootPanel.get().add(l);
@UiHandler("newAttributeSaveButton") public void onNewAttributeSaveButtonClick(final ClickEvent event) { final boolean isValid = newAttributeNameBox.validate() && newAttributeValueBox.validate(); if (isValid) { newAttributeNameFormGroup.setValidationState(ValidationState.NONE); newAttributeValueFormGroup.setValidationState(ValidationState.NONE); final String name = newAttributeNameBox.getText(); final String value = newAttributeValueBox.getText(); presenter.addNewAttribute(name, value); } }
// Global variable to save previous String data String stringEntered = ""; // Our TextBox TextBox textBox = new TextBox(); @Override public void onKeyPress(KeyPressEvent event) { if(stringEntered.length() > textBox.getValue().length()) { // At this point we know that a character has been deleted, so we can clear a list or reset something accordingly ... }