Java Code Examples for com.smartgwt.client.widgets.form.fields.TextItem#setEndRow()
The following examples show how to use
com.smartgwt.client.widgets.form.fields.TextItem#setEndRow() .
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: PeriodicalVolumeForm.java From proarc with GNU General Public License v3.0 | 5 votes |
public PeriodicalVolumeForm(ClientMessages i18n) { setWidth100(); setHeight100(); setTitleOrientation(TitleOrientation.TOP); setNumCols(1); TextItem volumeNumber = new TextItem(ModsCustomDataSource.FIELD_PER_VOLUME_NUMBER, i18n.PeriodicalVolumeForm_Number_Title()); volumeNumber.setRequired(true); // javascript regexp ^([1-9]\d{0,4}(-[1-9]\d{0,4})?)$ volumeNumber.setValidators(new StringTrimValidator(), new RegExpValidator("^([1-9]\\d{0,4}(-[1-9]\\d{0,4})?)$")); TextItem date = new TextItem(ModsCustomDataSource.FIELD_PER_VOLUME_YEAR, i18n.PeriodicalVolumeForm_Date_Title()); date.setRequired(true); // issue 43; see https://docs.google.com/document/d/1zSriHPdnUY5d_tKv0M8a6nEym560DKh2H6XZ24tGAEw/edit?pli=1 // javascript regexp ^([1-9]\d{3}(-[1-9]\d{3})?)$ date.setValidators(new StringTrimValidator(), new RegExpValidator("^([1-9]\\d{3}(-[1-9]\\d{3})?)$")); date.setEndRow(true); // identifiers final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS, i18n.PeriodicalVolumeForm_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"); TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.PeriodicalVolumeForm_Note_Title()); note.setWidth("*"); note.setHeight("*"); note.setColSpan("*"); setFields(volumeNumber, date, identifiers, note); }
Example 2
Source File: GDriveSettings.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
public GDriveSettings() { setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON); setTitle(I18N.message("googledrive")); setWidth(400); setHeight(150); setCanDragResize(true); setIsModal(true); setShowModalMask(true); centerInPage(); setPadding(2); form.setTitleOrientation(TitleOrientation.TOP); final TextItem clientId = ItemFactory.newTextItem("clientid", "clientid", null); clientId.setWidth(370); clientId.setRequired(true); clientId.setEndRow(true); final TextItem clientSecret = ItemFactory.newTextItem("clientsecret", "clientsecret", null); clientSecret.setWidth(370); clientSecret.setRequired(true); clientSecret.setEndRow(true); ButtonItem authorize = new ButtonItem("authorize", I18N.message("authorize")); authorize.setAutoFit(true); authorize.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { onAuthenticate(); } }); form.setFields(clientId, clientSecret, authorize); addItem(form); GDriveService.Instance.get().loadSettings(new AsyncCallback<String[]>() { @Override public void onFailure(Throwable caught) { Log.serverError(caught); } @Override public void onSuccess(String[] settings) { clientId.setValue(settings[0]); clientSecret.setValue(settings[1]); } }); }
Example 3
Source File: ZohoSettings.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
public ZohoSettings() { setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON); setTitle(I18N.message("zoho")); setAutoSize(true); setCanDragResize(true); setIsModal(true); setShowModalMask(true); centerInPage(); setPadding(2); form.setTitleOrientation(TitleOrientation.TOP); final TextItem authToken = ItemFactory.newTextItem("authtoken", "authtoken", null); authToken.setWidth(370); authToken.setRequired(true); authToken.setEndRow(true); ButtonItem save = new ButtonItem("save", I18N.message("save")); save.setAutoFit(true); save.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { onAuthenticate(); } }); form.setFields(authToken, save); addItem(form); ZohoService.Instance.get().loadAuthToken(new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { Log.serverError(caught); } @Override public void onSuccess(String setting) { authToken.setValue(setting); } }); }
Example 4
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 5
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); }