Java Code Examples for com.smartgwt.client.widgets.form.fields.SelectItem#setValueMap()
The following examples show how to use
com.smartgwt.client.widgets.form.fields.SelectItem#setValueMap() .
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 SelectItem newRetentionDateOption(int value) { SelectItem selector = new SelectItem("dateoption", I18N.message("dateoption")); LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>(); opts.put("" + GUIRetentionPolicy.DATE_OPT_CREATION, I18N.message("created")); opts.put("" + GUIRetentionPolicy.DATE_OPT_PUBLISHED, I18N.message("published")); opts.put("" + GUIRetentionPolicy.DATE_OPT_STOPPUBLISHING, I18N.message("stoppublishing")); opts.put("" + GUIRetentionPolicy.DATE_OPT_ARCHIVED, I18N.message("archiveds")); selector.setValueMap(opts); selector.setWrapTitle(false); selector.setWidth(150); selector.setValue("" + value); selector.setDefaultValue("" + value); return selector; }
Example 2
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
public static SelectItem newFrequencySelector(String name, String title) { SelectItem select = new SelectItem(filterItemName(name), I18N.message(title)); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("0", ""); map.put("1", I18N.message("daily")); map.put("7", I18N.message("weekly")); map.put("15", I18N.message("biweekly")); map.put("30", I18N.message("monthly")); map.put("180", I18N.message("sixmonthly")); map.put("365", I18N.message("yearly")); select.setValueMap(map); select.setWidth(100); return select; }
Example 3
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
/** * Simple boolean selector for Extended Attribute * * @param name name of the item * @param title title of the item(optional) * @param allowEmpty flag to indicate id the item must accept empty value * * @return the new item */ public static SelectItem newBooleanSelectorForAttribute(String name, String title, boolean allowEmpty) { String itemName = "_" + name.replaceAll(" ", Constants.BLANK_PLACEHOLDER); SelectItem select = new SelectItem(); select.setName(itemName); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); if (allowEmpty) map.put("", " "); map.put("1", I18N.message("yes")); map.put("0", I18N.message("no")); select.setValueMap(map); select.setTitle(I18N.message(title)); select.setWidth(80); select.setValue(""); return select; }
Example 4
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
public static SelectItem newEmailFromSelector(String name, String title) { final SelectItem selector = new SelectItem(filterItemName(name)); if (title != null) selector.setTitle(I18N.message(title)); else selector.setTitle(I18N.message("from")); selector.setWidth(300); selector.setWrapTitle(false); selector.setValueField("email"); selector.setDisplayField("email"); selector.setHideEmptyPickList(true); if (Session.get().getUser().getEmail2() != null && !Session.get().getUser().getEmail2().isEmpty()) selector.setValueMap(Session.get().getUser().getEmail(), Session.get().getUser().getEmail2()); else selector.setValueMap(Session.get().getUser().getEmail()); selector.setValue(Session.get().getUser().getEmail()); return selector; }
Example 5
Source File: SensorLossRuleTemplate.java From SensorWebClient with GNU General Public License v2.0 | 6 votes |
private Canvas createEditConditionCanvas() { StaticTextItem label = createLabelItem(i18n.sensorFailure()); SelectItem unitItem = createUnitsItem(); unitItem.addChangedHandler(createEntryUnitChangedHandler()); unitItem.setValueMap(createTimeunitsMap()); unitItem.setWidth(2 * EDIT_ITEMS_WIDTH); TextItem valueItem = createValueItem(); valueItem.addChangedHandler(createValueChangedHandler()); valueItem.setWidth(EDIT_ITEMS_WIDTH); valueItem.setRequired(true); // valueItem.setKeyPressFilter("[0-9]+(\\.|,)[0-9]+"); FormItem[] formItems = new FormItem[] { label, unitItem, valueItem }; conditionForm = assembleEditConditionForm(formItems); return alignVerticalCenter(conditionForm); }
Example 6
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
public static SelectItem new2AFMethodSelector(String name, String value) { SelectItem select = new SelectItem(filterItemName(name), I18N.message("authenticationmethod")); select.setWidth(150); select.setWrapTitle(false); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("", I18N.message("disable2fa")); if (Session.get().getTenantConfigAsBoolean("2fa." + Constants.TWOFA_GOOGLE_AUTHENTICATOR + ".enabled")) map.put(Constants.TWOFA_GOOGLE_AUTHENTICATOR, "Google Authenticator"); if (Session.get().getTenantConfigAsBoolean("2fa." + Constants.TWOFA_YUBIKEY + ".enabled")) map.put(Constants.TWOFA_YUBIKEY, "Yubikey"); select.setValueMap(map); if (value != null && map.get(value) != null) select.setValue(value.toString()); else select.setValue(""); return select; }
Example 7
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
public static SelectItem newRetentionAction(int value) { SelectItem selector = new SelectItem("action", I18N.message("action")); LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>(); opts.put("" + GUIRetentionPolicy.ACTION_ARCHIVE, I18N.message("archive")); opts.put("" + GUIRetentionPolicy.ACTION_UNPUBLISH, I18N.message("unpublish")); opts.put("" + GUIRetentionPolicy.ACTION_DELETE, I18N.message("ddelete")); selector.setValueMap(opts); selector.setWrapTitle(false); selector.setWidth(150); selector.setValue("" + value); selector.setDefaultValue("" + value); return selector; }
Example 8
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newDashletTypeSelector(String value) { SelectItem selector = new SelectItem(); LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>(); opts.put("document", I18N.message("dashlet.type.document")); opts.put("docevent", I18N.message("dashlet.type.docevent")); opts.put("note", I18N.message("dashlet.type.note")); opts.put("content", I18N.message("dashlet.type.content")); selector.setValueMap(opts); selector.setName("type"); selector.setTitle(I18N.message("type")); selector.setValue(value); selector.setRequired(true); selector.setWidth(120); return selector; }
Example 9
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newUserTypeSelector(String name, int userType) { SelectItem selector = new SelectItem(); LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>(); opts.put("" + GUIUser.TYPE_DEFAULT, I18N.message("default")); opts.put("" + GUIUser.TYPE_READONLY, I18N.message("readonly")); selector.setValueMap(opts); selector.setName(filterItemName(name)); selector.setTitle(I18N.message("usertype")); selector.setValue("" + userType); selector.setRequired(true); selector.setWidth(120); return selector; }
Example 10
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newSplittingPolicySelector() { SelectItem select = new SelectItem("splittingpolicy", I18N.message("splittingpolicy")); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("0", I18N.message("allpages")); map.put("1", I18N.message("selectionofpages")); map.put("2", I18N.message("blankpageasseparator")); map.put("3", I18N.message("barcodeasseparator")); map.put("4", I18N.message("textasseparator")); select.setValueMap(map); select.setValue("0"); select.setWidth(200); return select; }
Example 11
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newSizeOperator(String name, String title) { SelectItem item = new SelectItem(); LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>(); opts.put("lessthan", I18N.message("lessthan")); opts.put("greaterthan", I18N.message("greaterthan")); item.setValueMap(opts); item.setName(filterItemName(name)); if (title != null) item.setTitle(I18N.message(title)); else item.setShowTitle(false); item.setWidth(100); return item; }
Example 12
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newEmailFields(String name, String title) { SelectItem select = new SelectItem(filterItemName(name), I18N.message(title)); select.setWidth(110); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("0", I18N.message("subject")); map.put("1", I18N.message("sender")); map.put("2", I18N.message("content")); map.put("3", I18N.message("recipient")); select.setValueMap(map); return select; }
Example 13
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newLanguageSelector(String name, boolean withEmpty, boolean gui) { SelectItem item = new SelectItem(); if (gui) item.setValueMap(I18N.getSupportedGuiLanguages(withEmpty)); else item.setValueMap(I18N.getSupportedLanguages(withEmpty)); item.setName(filterItemName(name)); item.setTitle(I18N.message("language")); item.setWrapTitle(false); item.setWidth(120); return item; }
Example 14
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newRecipientTypeSelector(String name) { SelectItem selector = new SelectItem(); LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>(); opts.put("to", I18N.message("to").toUpperCase()); opts.put("cc", I18N.message("cc").toUpperCase()); opts.put("bcc", I18N.message("bcc").toUpperCase()); selector.setValueMap(opts); selector.setName(filterItemName(name)); selector.setShowTitle(false); selector.setValue("to"); selector.setRequired(true); return selector; }
Example 15
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newMultipleSelector(String name, String title) { SelectItem selectItemMultipleGrid = new SelectItem(); selectItemMultipleGrid.setName(filterItemName(name)); selectItemMultipleGrid.setTitle(I18N.message(title)); selectItemMultipleGrid.setMultiple(true); selectItemMultipleGrid.setValueMap(""); return selectItemMultipleGrid; }
Example 16
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newPrioritySelector(String name, String title) { SelectItem select = new SelectItem(filterItemName(name), title); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("0", I18N.message("low")); map.put("1", I18N.message("medium")); map.put("2", I18N.message("high")); select.setValueMap(map); select.setValue("0"); return select; }
Example 17
Source File: FormGenerator.java From proarc with GNU General Public License v3.0 | 5 votes |
public SelectItem getSelectItem(Field f, String lang) { SelectItem item = new SelectItem(f.getName(), f.getTitle(lang)); if (f.getOptionDataSource() != null) { setOptionDataSource(item, f, lang); } else { item.setValueMap(f.getValueMap()); } item.setDefaultValue(f.getDefaultValue()); return item; }
Example 18
Source File: CreateComplexRuleLayout.java From SensorWebClient with GNU General Public License v2.0 | 5 votes |
private HLayout createSingle(String ruleName){ this.singleCount++; DynamicForm block1 = new DynamicForm(); block1.setWidth("50%"); block1.setNumCols(1); DynamicForm block2 = new DynamicForm(); block2.setWidth("50%"); block2.setNumCols(1); SelectItem rule1Item = new SelectItem(); rule1Item.setShowTitle(false); rule1Item.setValueMap(this.rulesHashMap); rule1Item.setWidth(this.selectItemWidth); if (ruleName != null) { rule1Item.setValue(ruleName); } SpacerItem spacerItem = new SpacerItem(); spacerItem.setShowTitle(false); spacerItem.setHeight(20); block2.setFields(rule1Item); HLayout layout = new HLayout(); layout.setWidth(200); layout.setHeight(25); layout.addMember(block1); layout.addMember(block2); // save tree this.tempTree = this.rootTree; Tree right = new Tree(rule1Item, null, null); this.rootTree = new Tree(this.singleOperator, this.tempTree, right); return layout; }
Example 19
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
public static SelectItem newEmailFolderingSelector(String name, String title) { SelectItem select = new SelectItem(filterItemName(name), I18N.message(title)); select.setWidth(110); LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("0", I18N.message("none")); map.put("1", I18N.message("year")); map.put("2", I18N.message("month")); map.put("3", I18N.message("day")); select.setValueMap(map); return select; }
Example 20
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
public static SelectItem newEmailProtocolSelector(String name, String title) { SelectItem select = new SelectItem(filterItemName(name), I18N.message(title)); select.setWidth(110); select.setValueMap("pop3", "imap"); return select; }