Java Code Examples for com.smartgwt.client.widgets.form.fields.SelectItem#setTitle()

The following examples show how to use com.smartgwt.client.widgets.form.fields.SelectItem#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 vote down vote up
/**
 * 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 2
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newTenantSelector() {
	SelectItem tenant = new SelectItem("tenant");
	tenant.setTitle(I18N.message("tenant"));
	tenant.setWrapTitle(false);
	ListGridField id = new ListGridField("id", I18N.message("id"));
	id.setHidden(true);
	ListGridField _name = new ListGridField("name", I18N.message("name"));
	ListGridField displayName = new ListGridField("displayName", I18N.message("displayname"));
	tenant.setValueField("id");
	tenant.setDisplayField("displayName");
	tenant.setPickListWidth(300);
	tenant.setWidth(150);
	tenant.setPickListFields(id, _name, displayName);
	tenant.setOptionDataSource(new TenantsDS());
	return tenant;
}
 
Example 3
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newUserSelector(String name, String title, String groupIdOrName, boolean required) {
	SelectItem user = new SelectItem(filterItemName(name));
	user.setTitle(I18N.message(title));
	user.setWrapTitle(false);
	ListGridField id = new ListGridField("id", I18N.message("id"));
	id.setHidden(true);
	ListGridField username = new ListGridField("username", I18N.message("username"));
	ListGridField label = new ListGridField("label", I18N.message("name"));
	user.setValueField("id");
	user.setDisplayField("username");
	user.setPickListWidth(300);
	user.setPickListFields(id, username, label);
	user.setOptionDataSource(new UsersDS(groupIdOrName, required));
	user.setPickListProperties(new UserPickListProperties());
	return user;
}
 
Example 4
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
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: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newCharsetSelector(String name) {
	SelectItem item = new SelectItem();
	item.setName(filterItemName(name));
	item.setTitle(I18N.message("charset"));
	item.setWrapTitle(false);
	item.setDefaultValue("UTF-8");
	item.setDisplayField("name");
	item.setValueField("code");

	ListGridField code = new ListGridField("code", I18N.message("code"));
	code.setWidth(90);
	code.setHidden(true);
	code.setShowTitle(false);

	ListGridField nameField = new ListGridField("name", I18N.message("name"));
	nameField.setWidth("*");
	nameField.setShowTitle(false);

	item.setPickListFields(code, nameField);
	item.setOptionDataSource(new CharsetsDS());

	return item;
}
 
Example 6
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newStorageSelector(String name, Integer value) {
	SelectItem item = new SelectItem();
	item.setName(filterItemName(name));
	item.setTitle(I18N.message("storage"));
	item.setWrapTitle(false);
	item.setDisplayField("name");
	item.setValueField("id");
	item.setWidth(100);

	ListGridField nameField = new ListGridField("name", I18N.message("name"));
	nameField.setWidth("*");
	nameField.setShowTitle(false);

	item.setPickListFields(nameField);
	item.setOptionDataSource(new StoragesDS(true, false));

	if (value != null)
		item.setValue(value.toString());

	return item;
}
 
Example 7
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static SelectItem newTagInputMode(String name, String title) {
	SelectItem mode = new SelectItem();
	LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>();
	opts.put("free", I18N.message("free"));
	opts.put("preset", I18N.message("preset"));
	mode.setValueMap(opts);
	mode.setName(filterItemName(name));
	if (title != null)
		mode.setTitle(I18N.message(title));
	else
		mode.setShowTitle(false);
	mode.setWrapTitle(false);
	mode.setDefaultValue("free");
	mode.setWidth(150);
	return mode;
}
 
Example 8
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newArchiveSelector(int mode, Integer status) {
	SelectItem item = new SelectItem("archive");
	item.setTitle("");
	item.setRequiredMessage(I18N.message("fieldrequired"));
	ListGridField name = new ListGridField("name", I18N.message("name"));
	ListGridField description = new ListGridField("description", I18N.message("description"));
	item.setValueField("id");
	item.setDisplayField("name");
	item.setPickListWidth(300);
	item.setPickListFields(name, description);
	item.setOptionDataSource(new ArchivesDS(mode, null, status, null));
	if (!Feature.enabled(Feature.IMPEX))
		item.setDisabled(true);
	return item;
}
 
Example 9
Source File: Setup.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Prepares the registration form
 */
private Tab setupRegistration(final ValuesManager vm) {
	Tab registrationTab = new Tab();
	registrationTab.setTitle(I18N.message("registration"));

	TextItem regName = ItemFactory.newTextItem(REG_NAME, "name", null);
	regName.setWrapTitle(false);
	regName.setWidth(300);

	TextItem regOrganization = ItemFactory.newTextItem(REG_ORGANIZATION, "organization", null);
	regOrganization.setWrapTitle(false);
	regOrganization.setWidth(300);

	TextItem regWebsite = ItemFactory.newTextItem(REG_WEBSITE, "website", null);
	regWebsite.setWrapTitle(false);
	regWebsite.setWidth(300);

	TextItem regEmail = ItemFactory.newEmailItem(REG_EMAIL, "email", false);
	regEmail.setWrapTitle(false);
	regEmail.setWidth(300);

	SelectItem languageItem = ItemFactory.newLanguageSelector(LANGUAGE, false, true);
	languageItem.setTitle(I18N.message("language"));
	languageItem.setRequired(true);

	final DynamicForm regForm = new DynamicForm();
	regForm.setID("regForm");
	regForm.setValuesManager(vm);
	regForm.setFields(languageItem, regName, regEmail, regOrganization, regWebsite);

	registrationTab.setPane(regForm);
	return registrationTab;
}
 
Example 10
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newAliasTypeSelector() {
	SelectItem item = new SelectItem();
	item.setName("aliastype");
	item.setTitle(I18N.message("type"));
	item.setWrapTitle(false);

	LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
	map.put("", I18N.message("document"));
	map.put("conversion.pdf", I18N.message("pdfconversion"));

	item.setValueMap(map);
	return item;
}
 
Example 11
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
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 12
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newGroupSelector(String name, String title) {
	SelectItem group = new SelectItem(filterItemName(name));
	group.setTitle(I18N.message(title));
	group.setWrapTitle(false);
	group.setValueField("id");
	group.setDisplayField("name");
	group.setPickListWidth(300);
	ListGridField n = new ListGridField("name", I18N.message("name"));
	ListGridField description = new ListGridField("description", I18N.message("description"));
	group.setPickListFields(n, description);
	group.setOptionDataSource(new GroupsDS());
	return group;
}
 
Example 13
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
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 vote down vote up
public static SelectItem newWorkspaceSelector(Long value) {
	SelectItem item = new SelectItem("workspace");
	item.setTitle(I18N.message("workspace"));
	item.setRequiredMessage(I18N.message("fieldrequired"));
	item.setValueField("folderId");
	item.setDisplayField("name");
	item.setWrapTitle(false);
	item.setOptionDataSource(new FoldersDS("profile-workspace", true));
	item.setValue(value);
	item.setVisible(Feature.enabled(Feature.MULTI_WORKSPACE));
	item.setWidth(150);
	return item;
}
 
Example 15
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newDateOperator(String name, String title) {
	SelectItem dateOperator = new SelectItem();
	LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>();
	opts.put("before", I18N.message("before"));
	opts.put("after", I18N.message("after"));
	dateOperator.setValueMap(opts);
	dateOperator.setName(filterItemName(name));
	if (title != null)
		dateOperator.setTitle(I18N.message(title));
	else
		dateOperator.setShowTitle(false);
	dateOperator.setWidth(100);
	return dateOperator;
}
 
Example 16
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newSkinSelector() {
	SelectItem skinSelector = new SelectItem();
	skinSelector.setWidth(120);
	skinSelector.setName("skin");
	skinSelector.setTitle(I18N.message("skin"));
	skinSelector.setValueField("name");
	skinSelector.setDisplayField("label");
	skinSelector.setOptionDataSource(new SkinsDS());

	if (Session.get() != null && Session.get().getInfo().getBranding() != null)
		skinSelector.setValue(Session.get().getInfo().getBranding().getSkin());

	return skinSelector;
}
 
Example 17
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
protected SelectItem createUnitsItem() {
    SelectItem unitSelectItem = new SelectItem();
    unitSelectItem.setTitle(i18n.unit());
    unitSelectItem.setTitleOrientation(TOP);
    unitSelectItem.addChangedHandler(createUnitSelectionChangedHandler());
    return unitSelectItem;
}
 
Example 18
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
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 19
Source File: SensorLossRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private SelectItem createUnitsItem() {
    SelectItem unitSelectItem = new SelectItem();
    unitSelectItem.setTitle(i18n.unit());
    unitSelectItem.setTitleOrientation(TOP);
    unitSelectItem.addChangedHandler(createUnitSelectionChangedHandler());
    return unitSelectItem;
}
 
Example 20
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static SelectItem newFolderTemplateSelector() {
	SelectItem item = new SelectItem("foldertemplate");
	item.setTitle(I18N.message("foldertemplate"));
	item.setRequiredMessage(I18N.message("fieldrequired"));
	item.setValueField("id");
	item.setDisplayField("name");
	item.setWrapTitle(false);
	item.setOptionDataSource(new FolderTemplatesDS());
	if (!Feature.enabled(Feature.FOLDER_TEMPLATE))
		item.setDisabled(true);
	return item;
}