Java Code Examples for com.smartgwt.client.widgets.form.fields.SelectItem#setEndRow()
The following examples show how to use
com.smartgwt.client.widgets.form.fields.SelectItem#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: DownloadTicketDialog.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
private void prepareForm() { form = new DynamicForm(); form.setAlign(Alignment.LEFT); form.setNumCols(4); SelectItem type = ItemFactory.newAliasTypeSelector(); type.setName("type"); type.setValue(""); type.setEndRow(true); type.setColSpan(4); type.setWrapTitle(false); DateItem date = ItemFactory.newDateItem("date", I18N.message("expireson")); date.setEndRow(true); date.setColSpan(4); date.setWrapTitle(false); SpinnerItem maxDownloads = ItemFactory.newSpinnerItem("maxDownloads", I18N.message("maxdownloads"), (Integer) null); maxDownloads.setEndRow(true); maxDownloads.setColSpan(4); maxDownloads.setWrapTitle(false); maxDownloads.setRequired(false); maxDownloads.setMin(0); SpinnerItem duedateTimeItem = ItemFactory.newSpinnerItem("duedateNumber", I18N.message("expiresin"), 24); duedateTimeItem.setWrapTitle(false); duedateTimeItem.setDefaultValue(24); duedateTimeItem.setMin(0); SelectItem duedateTime = ItemFactory.newDueTimeSelector("duedateTime", ""); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("hour", I18N.message("hours")); map.put("day", I18N.message("ddays")); duedateTime.setValueMap(map); duedateTime.setValue("hour"); form.setItems(type, duedateTimeItem, duedateTime, date, maxDownloads); }
Example 2
Source File: GDriveCreate.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
public GDriveCreate() { setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON); setTitle(I18N.message("createdoc")); setWidth(300); setHeight(120); setCanDragResize(true); setIsModal(true); setShowModalMask(true); centerInPage(); setPadding(5); setMembersMargin(3); DynamicForm form = new DynamicForm(); vm = new ValuesManager(); form.setValuesManager(vm); form.setTitleOrientation(TitleOrientation.TOP); TextItem fileName = ItemFactory.newTextItem("fileName", "filename", null); fileName.setRequired(true); fileName.setWidth(200); SelectItem type = ItemFactory.newSelectItem("type", I18N.message("type")); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("doc", "doc"); map.put("docx", "docx"); map.put("odt", "odt"); map.put("txt", "txt"); map.put("xls", "xls"); map.put("xlsx", "xlsx"); map.put("ods", "ods"); map.put("ppt", "ppt"); map.put("pptx", "pptx"); map.put("odp", "odp"); type.setValueMap(map); type.setValue("doc"); type.setWidth(50); type.setEndRow(true); type.setRequired(true); create = new SubmitItem(); create.setTitle(I18N.message("create")); create.setAlign(Alignment.RIGHT); create.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { onCreate(); } }); form.setItems(fileName, type, create); addItem(form); }
Example 3
Source File: AutomationTriggerProperties.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
private void refresh() { vm.clearValues(); vm.clearErrors(false); if (formsContainer.getMembers() != null) formsContainer.removeMembers(formsContainer.getMembers()); DynamicForm form2 = new DynamicForm(); form2.setWidth100(); form2.setTitleOrientation(TitleOrientation.TOP); form2.setValuesManager(vm); form2.setNumCols(1); final TextAreaItem automation = ItemFactory.newTextAreaItemForAutomation("automation", "automation", trigger.getAutomation(), changedHandler, false); automation.setStartRow(false); automation.setWidth("*"); automation.setDisabled(trigger.getRoutine()!=null); form2.setItems(automation); DynamicForm form1 = new DynamicForm(); form1.setNumCols(2); form1.setTitleOrientation(TitleOrientation.TOP); form1.setValuesManager(vm); form1.setHeight100(); SelectItem events = ItemFactory.newEventsSelector("events", I18N.message("triggeron"), changedHandler, true, true, true); events.setRowSpan(3); events.setValues(trigger.getEventsArray()); SpacerItem spacer = new SpacerItem(); spacer.setHeight(100); SelectItem routine = ItemFactory.newAutomationRoutineSelector("routine", trigger.getRoutine() != null ? trigger.getRoutine().getId() : null, changedHandler, true); routine.setEndRow(true); routine.addChangedHandler(changedHandler); ChangedHandler cngHandler = new ChangedHandler() { @Override public void onChanged(ChangedEvent event) { if (event == null) { automation.setDisabled(false); } else { automation.setDisabled(event.getValue() != null && !event.getValue().toString().isEmpty()); } } }; routine.addChangedHandler(cngHandler); form1.setItems(events, folderSelector, routine, spacer); formsContainer.setMembers(form1, form2); }
Example 4
Source File: ConversionDialog.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
public ConversionDialog(GUIDocument document) { this.document = document; setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON); setTitle(I18N.message("convert") + " - " + document.getFileName()); setCanDragResize(true); setIsModal(true); setShowModalMask(true); centerInPage(); setAutoSize(true); final RadioGroupItem action = ItemFactory.newRadioGroup("action", I18N.message("action")); action.setRequired(true); action.setEndRow(true); final SelectItem format = ItemFactory.newConversionFormatItem(document.getFileName()); format.setEndRow(true); format.setRequired(true); final ButtonItem convert = new ButtonItem(); convert.setStartRow(false); convert.setTitle(I18N.message("convert")); convert.setAutoFit(true); convert.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { onConvert(); } }); FolderService.Instance.get().getFolder(document.getFolder().getId(), false, false, false, new AsyncCallback<GUIFolder>() { @Override public void onFailure(Throwable caught) { Log.serverError(caught); } @Override public void onSuccess(GUIFolder folder) { convert.setDisabled(!folder.isDownload() && !folder.isWrite()); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); if (folder.isDownload()) map.put("download", I18N.message("download")); if (folder.isWrite()) map.put("save", I18N.message("save")); action.setValueMap(map); action.setValue("download"); form.setFields(format, action, convert); addItem(form); } }); }
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); }