/** * Set the fields to adhere to the specifications * https://docs.google.com/a/eagle-i.org/spreadsheet/ccc?key=0AjY1rgYV3aq7dHNueDZDOXRHMUJ5eUplM1NYeVltSFE&usp=drive_web#gid=0 */ protected void setValidations() { fromNameText.setMaxLength( MAX_TEXT_FIELD ); fromEmailText.setMaxLength( MAX_TEXT_FIELD ); fromTitleText.setMaxLength( MAX_TEXT_FIELD ); fromLabName.setMaxLength( MAX_TEXT_FIELD ); descriptionText.getElement().setAttribute( "maxlength", MAX_TEXT_AREA ); additionalInfoText.getElement().setAttribute( "maxlength", MAX_TEXT_AREA ); }
/** * This method sets a maximum length of the text box.<p/> * It makes sence if you allow custom values entering.<p/> * See also {@link #isCustomTextAllowed()} and {@link #setCustomTextAllowed(boolean)}. * * @param length is a maximum length of the text box. */ public void setMaxLength(int length) { getSelectedValue().setMaxLength(length); }
public void setMaxLength(int length) { asTextBox().setMaxLength(length); }
public void setMaxLength(int length) { asTextBox().setMaxLength(length); }
public Widget getWidget() { TextBox tb = new TextBox(); tb.setMaxLength( 120 ); tb.setWidth( stdFieldWidth + "px" ); return tb; }
public Widget getWidget() { TextBox tb = new TextBox(); tb.setMaxLength( 120 ); tb.setWidth( stdFieldWidth + "px" ); return tb; }
/** * Takes the given text box and sets the style and * max length for the box. Limits how many characters can * be entered. * @param box * @return */ protected TextBox createTextBox(final TextBox box) { box.setStyleName( TEXT_BOX_STYLE ); box.setMaxLength( MAX_TEXT_AREA ); box.getElement().setAttribute( MAX_LENGTH_ATTRIBUTE, Integer.toString( MAX_TEXT_FIELD ) ); return box; }
public DateTimeBox() { super(new DateTimePicker(), null, DATE_FORMAT); ((DateTimePicker) getDatePicker()).setDateTimeBox(this); final TextBox textbox = getTextBox(); // Chrome 7.0.5xx versions, Safari 5.0.x and similar render a text box // that's too small for 19 characters (WTF?). So we ask for space for // an extra 2 characters. On Firefox the text box's width is computed // properly, so it simply appears slightly wider than necessary. textbox.setVisibleLength(19 + 2); textbox.setMaxLength(19); }
textbox.setMaxLength( 1 ); textBox.setMaxLength( Integer.parseInt( maximumLength ) ); textbox.setMaxLength( 1 );
private void initializeTextFields() { emailText = new TextBox(); emailText.setStyleName( ELEMENT_STYLE ); emailText.setVisibleLength(50); emailText.setMaxLength(70); messageText = new TextArea(); messageText.setStyleName( ELEMENT_STYLE ); messageText.setVisibleLines(4); clearTextFields(); }
ylabel.setMaxLength(50); // Arbitrary limit. y2label.setVisibleLength(10); y2label.setMaxLength(50); // Arbitrary limit. y2label.setEnabled(false);