Java Code Examples for com.smartgwt.client.widgets.form.fields.TextItem#setTitle()
The following examples show how to use
com.smartgwt.client.widgets.form.fields.TextItem#setTitle() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
public static TextItem newEmailItem(String name, String title, boolean multiple) { TextItem item = new TextItem(); item.setName(filterItemName(name)); if (title != null) item.setTitle(I18N.message(title)); else item.setShowTitle(false); if (multiple) item.setValidators(new EmailsValidator()); else item.setValidators(new EmailValidator()); item.setWrapTitle(false); item.setWidth(200); return item; }
Example 2
Source File: DigitalObjectChildrenEditor.java From proarc with GNU General Public License v3.0 | 6 votes |
private DynamicForm createParamsForm() { ClientMessages i18n = GWT.create(ClientMessages.class); DynamicForm f = new DynamicForm(); f.setAutoHeight(); TextItem newPid = new TextItem(DigitalObjectDataSource.FIELD_PID); newPid.setTitle(i18n.NewDigObject_OptionPid_Title()); newPid.setTooltip(i18n.NewDigObject_OptionPid_Hint()); newPid.setRequired(true); newPid.setLength(36 + 5); newPid.setWidth((36 + 5) * 8); newPid.setValidators(new CustomUUIDValidator(i18n)); f.setFields(newPid); f.setAutoFocus(true); return f; }
Example 3
Source File: EventNameForm.java From SensorWebClient with GNU General Public License v2.0 | 6 votes |
private TextItem createAbonnementNameItem() { aboNameItem = new TextItem(); aboNameItem.setRequired(true); aboNameItem.setTextBoxStyle("n52_sensorweb_client_abo_name_textbox"); aboNameItem.setTitle(i18n.aboName()); aboNameItem.setWidth("*"); // fill form column aboNameItem.setKeyPressFilter("[0-9a-zA-Z_]"); aboNameItem.setValue(controller.createSuggestedAbonnementName()); aboNameItem.addKeyUpHandler(new KeyUpHandler() { public void onKeyUp(KeyUpEvent event) { TextItem nameItem = (TextItem) event.getSource(); String currentAbonnementName = (String) nameItem.getValue(); controller.setSelectedAbonnementName(currentAbonnementName); } }); return aboNameItem; }
Example 4
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
/** * Creates a new TextItem. * * @param name The item name (mandatory) * @param title The item title (mandatory) * @param value The item value (optional) * * @return the text item */ public static TextItem newTextItem(String name, String title, String value) { TextItem item = new TextItem(); item.setName(filterItemName(name)); item.setTitle(I18N.message(title)); if (value != null) item.setValue(value); else item.setValue(""); item.setWrapTitle(false); item.setRequiredMessage(I18N.message("fieldrequired")); return item; }
Example 5
Source File: NewDigObject.java From proarc with GNU General Public License v3.0 | 5 votes |
private DynamicForm createOptionsForm() { SelectItem selectModel = new SelectItem(DigitalObjectDataSource.FIELD_MODEL, i18n.NewDigObject_OptionModel_Title()); selectModel.setRequired(true); selectModel.setWidth(300); // issue 46: always start with empty model selectModel.setAllowEmptyValue(true); selectModel.setEmptyDisplayValue(ClientUtils.format("<i><%s></i>", i18n.NewDigObject_OptionModel_EmptyValue_Title())); selectModel.setOptionDataSource(MetaModelDataSource.getInstance()); // selectModel.setShowOptionsFromDataSource(true); selectModel.setValueField(MetaModelDataSource.FIELD_PID); selectModel.setDisplayField(MetaModelDataSource.FIELD_DISPLAY_NAME); selectModel.setAutoFetchData(true); selectModel.setValidators(new CustomValidator() { @Override protected boolean condition(Object value) { boolean valid = getFormItem().getSelectedRecord() != null; return valid; } }); TextItem newPid = new TextItem(DigitalObjectDataSource.FIELD_PID); newPid.setTitle(i18n.NewDigObject_OptionPid_Title()); newPid.setTooltip(i18n.NewDigObject_OptionPid_Hint()); newPid.setLength(36 + 5); newPid.setWidth((36 + 5) * 8); newPid.setValidators(new CustomUUIDValidator(i18n)); //newPid.setValidators(new RegExpValidator( // "uuid:[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}")); DynamicForm form = new DynamicForm(); form.setWrapItemTitles(false); form.setAutoFocus(true); form.setNumCols(4); form.setBrowserSpellCheck(false); form.setFields(selectModel, newPid); form.setAutoWidth(); form.setMargin(4); return form; }
Example 6
Source File: MonographUnitForm.java From proarc with GNU General Public License v3.0 | 5 votes |
public MonographUnitForm(final ClientMessages i18n) { setWidth100(); setHeight100(); setTitleOrientation(TitleOrientation.TOP); setNumCols(1); // identifiers final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS, i18n.MonographUnitForm_Identifiers_Title()); identifiers.setDataSource(IdentifierDataSource.getInstance()); identifiers.setValidators( new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID))); DynamicForm identifierForm = new DynamicForm(); identifierForm.setUseAllDataSourceFields(true); identifierForm.setNumCols(4); identifiers.setFormPrototype(identifierForm); identifiers.setEndRow(true); identifiers.setColSpan("2"); TextItem unitNumber = new TextItem(ModsCustomDataSource.FIELD_MONOGRAPHUNIT_NUMBER); unitNumber.setTitle(i18n.MonographUnitForm_UnitNumber_Title()); unitNumber.setRequired(true); unitNumber.setValidators(new IsIntegerValidator()); TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.MonographUnitForm_Note_Title()); note.setWidth("*"); note.setHeight("*"); note.setColSpan("*"); setFields(unitNumber, identifiers, note); }
Example 7
Source File: SubscriptionTemplate.java From SensorWebClient with GNU General Public License v2.0 | 5 votes |
protected TextItem createValueItem() { TextItem valueItem = new TextItem(); valueItem.setTitle(i18n.value()); valueItem.setTitleOrientation(TOP); valueItem.setKeyPressFilter("[0-9\\.\\-]"); return valueItem; }
Example 8
Source File: LoginLayout.java From SensorWebClient with GNU General Public License v2.0 | 5 votes |
private TextItem createUserNameItem() { TextItem userNameItem = new TextItem(USER_NAME_FIELD); userNameItem.setTitle(i18n.userName()); userNameItem.setRequired(true); userNameItem.setSelectOnFocus(true); userNameItem.setLength(100); userNameItem.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { if ( (event.getKeyName().equals("Enter")) && (LoginLayout.this.form.validate(false))) { login(); } } }); return userNameItem; }
Example 9
Source File: NdkAudioPageForm.java From proarc with GNU General Public License v3.0 | 4 votes |
/** * Create a new form. * @param i18n I18N * @param typeValueMapId {@link ValueMapDataSource#getOptionDataSource} * reference to bundle with page types. */ public NdkAudioPageForm(ClientMessages i18n, String typeValueMapId) { // save on Enter is supposed mainly for ImportBatchItemEditor // see submit handler in ModsMultiEditor setSaveOnEnter(true); setWidth100(); setHeight100(); setTitleOrientation(TitleOrientation.TOP); TextItem pageType = new TextItem(ModsCustomDataSource.FIELD_PAGE_TYPE); pageType.setTitle(i18n.PageForm_PageType_Title()); pageType.setEndRow(true); pageType.setRequired(true); pageType.setReadOnly(); pageType.disable(); IntegerItem pageIndex = new IntegerItem(ModsCustomDataSource.FIELD_PAGE_INDEX); pageIndex.setTitle(i18n.PageForm_PageIndex_Title()); pageIndex.setValidators(new IsIntegerValidator()); pageIndex.setRequired(true); pageIndex.setEndRow(true); TextItem pageNumber = new TextItem(ModsCustomDataSource.FIELD_PAGE_NUMBER); pageNumber.setTitle(i18n.PageForm_PageNumber_Title()); pageNumber.setEndRow(true); pageNumber.setRequired(true); pageNumber.setValidators(new StringTrimValidator()); // pageNumber.setLength(5); final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS, i18n.PageForm_Identifiers_Title()); identifiers.setDataSource(IdentifierDataSource.getInstance()); identifiers.setRequired(true); identifiers.setValidators( new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID))); DynamicForm identifierForm = new DynamicForm(); identifierForm.setUseAllDataSourceFields(true); identifierForm.setNumCols(4); identifiers.setFormPrototype(identifierForm); identifiers.setEndRow(true); identifiers.setColSpan("3"); // TextAreaItem note = new AutoFitTextAreaItem(ModsCustomDataSource.FIELD_NOTE, "Note"); TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.PageForm_Note_Title()); note.setWidth("*"); //https://github.com/proarc/proarc/issues/645 GWT v.6.0-p20161023 form draw issue note.setHeight("*"); note.setColSpan("*"); setFields(pageType, pageIndex, pageNumber, identifiers, note); IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator(); integerRangeValidator.setMin(0); integerRangeValidator.setMax(Integer.MAX_VALUE); pageIndex.setValidators(integerRangeValidator); }
Example 10
Source File: PageForm.java From proarc with GNU General Public License v3.0 | 4 votes |
/** * Create a new form. * @param i18n I18N * @param typeValueMapId {@link ValueMapDataSource#getOptionDataSource} * reference to bundle with page types. */ public PageForm(ClientMessages i18n, String typeValueMapId) { // save on Enter is supposed mainly for ImportBatchItemEditor // see submit handler in ModsMultiEditor setSaveOnEnter(true); setWidth100(); setHeight100(); setTitleOrientation(TitleOrientation.TOP); SelectItem pageType = new SelectItem(ModsCustomDataSource.FIELD_PAGE_TYPE, i18n.PageForm_PageType_Title()); pageType.setOptionDataSource(ValueMapDataSource.getInstance().getOptionDataSource(typeValueMapId)); pageType.setValueField(BundleValue.KEY); pageType.setDisplayField(BundleValue.VALUE); pageType.setDefaultValue(ModsCustomDataSource.getDefaultPageType()); pageType.setWidth(200); pageType.setEndRow(true); IntegerItem pageIndex = new IntegerItem(ModsCustomDataSource.FIELD_PAGE_INDEX); pageIndex.setTitle(i18n.PageForm_PageIndex_Title()); pageIndex.setValidators(new IsIntegerValidator()); pageIndex.setRequired(true); pageIndex.setEndRow(true); TextItem pageNumber = new TextItem(ModsCustomDataSource.FIELD_PAGE_NUMBER); pageNumber.setTitle(i18n.PageForm_PageNumber_Title()); pageNumber.setEndRow(true); pageNumber.setRequired(true); pageNumber.setValidators(new StringTrimValidator()); // pageNumber.setLength(5); final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS, i18n.PageForm_Identifiers_Title()); identifiers.setDataSource(IdentifierDataSource.getInstance()); identifiers.setRequired(true); identifiers.setValidators( new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID))); DynamicForm identifierForm = new DynamicForm(); identifierForm.setUseAllDataSourceFields(true); identifierForm.setNumCols(4); identifiers.setFormPrototype(identifierForm); identifiers.setEndRow(true); identifiers.setColSpan("3"); // TextAreaItem note = new AutoFitTextAreaItem(ModsCustomDataSource.FIELD_NOTE, "Note"); TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.PageForm_Note_Title()); note.setWidth("*"); //https://github.com/proarc/proarc/issues/645 GWT v.6.0-p20161023 form draw issue note.setHeight("*"); note.setColSpan("*"); setFields(pageType, pageIndex, pageNumber, identifiers, note); IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator(); integerRangeValidator.setMin(0); integerRangeValidator.setMax(Integer.MAX_VALUE); pageIndex.setValidators(integerRangeValidator); }