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

The following examples show how to use com.smartgwt.client.widgets.form.fields.SelectItem#setWrapTitle() . 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
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 vote down vote up
public static SelectItem newImportFolderProviderOption(String value) {
	SelectItem selector = new SelectItem("provider", I18N.message("type"));
	LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>();
	if (Feature.enabled(Feature.IMPORT_LOCAL_FOLDERS))
		opts.put(GUIImportFolder.PROVIDER_FILE, I18N.message("localfolder"));
	if (Feature.enabled(Feature.IMPORT_REMOTE_FOLDERS)) {
		opts.put(GUIImportFolder.PROVIDER_SMB, I18N.message("smbshare"));
		opts.put(GUIImportFolder.PROVIDER_SMB2, I18N.message("smb2share"));
		opts.put(GUIImportFolder.PROVIDER_SMB3, I18N.message("smb3share"));
		opts.put(GUIImportFolder.PROVIDER_FTP, I18N.message("fftp"));
		opts.put(GUIImportFolder.PROVIDER_FTPS, I18N.message("ftps"));
		opts.put(GUIImportFolder.PROVIDER_SFTP, I18N.message("sftp"));
	}
	selector.setValueMap(opts);

	selector.setWrapTitle(false);
	selector.setWidth(150);

	selector.setValue(value);
	selector.setDefaultValue(value);

	return selector;
}
 
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 newBarcodeGenerationFormatSelector(String name, String title, String value) {
	SelectItem item = new SelectItem(name, I18N.message(title));
	item.setWrapTitle(false);
	item.setWidth(110);

	LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>();
	opts.put("CODE_128", "CODE_128");
	opts.put("CODE_39", "CODE_39");
	opts.put("EAN_13", "EAN_13");
	opts.put("EAN_8", "EAN_8");
	opts.put("ITF", "ITF");
	opts.put("UPC_A", "UPC_A");
	opts.put("QR_CODE", "QR_CODE");

	item.setValueMap(opts);

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

	return item;
}
 
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 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 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 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 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 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 vote down vote up
public static SelectItem newEmailSelector(String name, String title) {
	final SelectItem selector = new SelectItem(filterItemName(name));
	selector.setTitle(I18N.message(title));
	selector.setWrapTitle(false);
	selector.setValueField("email");
	selector.setDisplayField("email");
	selector.setPickListWidth(350);
	selector.setMultiple(true);
	selector.setHideEmptyPickList(true);
	ListGridField email = new ListGridField("email", I18N.message("email"));
	email.setWidth("*");
	ListGridField firstName = new ListGridField("firstName", I18N.message("firstname"));
	firstName.setWidth(90);
	ListGridField lastName = new ListGridField("lastName", I18N.message("lastname"));
	lastName.setWidth(90);
	selector.setPickListFields(email, firstName, lastName);
	selector.setOptionDataSource(new ContactsDS());
	return selector;
}
 
Example 8
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 9
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 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 10
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 11
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 12
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 newTemplateSelector(boolean withEmpty, Long selectedTemplateId) {
	SelectItem templateItem = new SelectItem("template", I18N.message("template"));
	templateItem.setDisplayField("name");
	templateItem.setValueField("id");
	templateItem.setWidth(150);
	templateItem.setMultiple(false);
	templateItem.setWrapTitle(false);
	templateItem.setMultipleAppearance(MultipleAppearance.PICKLIST);
	templateItem.setOptionDataSource(new TemplatesDS(withEmpty, selectedTemplateId, null));

	if (!Feature.enabled(Feature.TEMPLATE))
		templateItem.setDisabled(true);
	if (selectedTemplateId != null)
		templateItem.setValue(selectedTemplateId.toString());
	return templateItem;
}
 
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 newAttributesSelector() {
	final SelectItem selectItem = new SelectItem("attributes", I18N.message("attributes"));
	selectItem.setMultiple(true);
	selectItem.setMultipleAppearance(MultipleAppearance.PICKLIST);
	selectItem.setDisplayField("label");
	selectItem.setValueField("name");
	selectItem.setPickListWidth(150);
	selectItem.setOptionDataSource(new AttributesDS());
	selectItem.setWrapTitle(false);
	return selectItem;
}
 
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 newAttributeSetSelector() {
	final SelectItem selectItem = new SelectItem("attributeset", I18N.message("attributeset"));
	selectItem.setMultiple(false);
	selectItem.setMultipleAppearance(MultipleAppearance.PICKLIST);
	selectItem.setDisplayField("name");
	selectItem.setValueField("id");
	selectItem.setWidth(120);
	selectItem.setOptionDataSource(new AttributeSetsDS(false, GUIAttributeSet.TYPE_DEFAULT));
	selectItem.setWrapTitle(false);

	return selectItem;
}
 
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 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 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 newStampSelector() {
	SelectItem item = new SelectItem("stamp", I18N.message("stamp"));
	item.setRequiredMessage(I18N.message("fieldrequired"));
	ListGridField name = new ListGridField("name", I18N.message("name"));
	item.setWidth(200);
	item.setPickListWidth(200);
	item.setPickListFields(name);
	item.setDisplayField("name");
	item.setValueField("id");
	item.setWrapTitle(false);
	item.setOptionDataSource(new StampsDS(Session.get().getUser().getId(), true));
	if (!Feature.enabled(Feature.STAMP))
		item.setDisabled(true);
	return item;
}
 
Example 17
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 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 newRunlevelSelector() {
	SelectItem item = new SelectItem("runlevel", I18N.message("currentrunlevel"));
	LinkedHashMap<String, String> opts = new LinkedHashMap<String, String>();
	opts.put("default", I18N.message("default"));
	opts.put("bulkload", I18N.message("bulkload"));
	opts.put("slave", I18N.message("slave"));
	opts.put("devel", I18N.message("devel"));
	item.setValueMap(opts);
	item.setWrapTitle(false);
	item.setValue(Session.get().getConfig("runlevel"));
	item.setRequired(true);
	item.setWidth(150);
	item.setDisabled("demo".equals(Session.get().getConfig("runlevel")));
	return item;
}
 
Example 19
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 20
Source File: TaskEditor.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private VLayout prepareMessagesPanel() {
	VLayout messagesPanel = new VLayout();
	messagesPanel.setWidth100();
	messagesPanel.setHeight100();

	DynamicForm messagesForm = new DynamicForm();
	messagesForm.setTitleOrientation(TitleOrientation.TOP);
	messagesForm.setNumCols(2);
	messagesForm.setTitleOrientation(TitleOrientation.LEFT);
	messagesForm.setValuesManager(vm);

	SelectItem creationMessageTemplate = ItemFactory.newSelectItem("creationMessageTemplate",
			state.getType() == GUIWFState.TYPE_TASK ? "messageontaskreached" : "messageonendstatusreached");
	creationMessageTemplate.setWrapTitle(false);

	SelectItem assignmentMessageTemplate = ItemFactory.newSelectItem("assignmentMessageTemplate",
			"messageontaskassignment");
	assignmentMessageTemplate.setWrapTitle(false);

	SelectItem reminderMessageTemplate = ItemFactory.newSelectItem("reminderMessageTemplate", "messageonremind");
	reminderMessageTemplate.setWrapTitle(false);

	if (state.getType() == GUIWFState.TYPE_TASK)
		messagesForm.setItems(creationMessageTemplate, assignmentMessageTemplate, reminderMessageTemplate);
	else
		messagesForm.setItems(creationMessageTemplate);

	messagesPanel.addMember(messagesForm);

	MessageService.Instance.get().loadTemplates(I18N.getLocale(), "user",
			new AsyncCallback<GUIMessageTemplate[]>() {

				@Override
				public void onFailure(Throwable caught) {
					Log.serverError(caught);
				}

				@Override
				public void onSuccess(GUIMessageTemplate[] templates) {
					LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
					map.put("", "");
					for (GUIMessageTemplate t : templates)
						map.put("" + t.getName(), t.getName());

					creationMessageTemplate.setValueMap(map);
					creationMessageTemplate.setValue("");
					creationMessageTemplate.setValue(state.getCreationMessageTemplate());

					assignmentMessageTemplate.setValueMap(map);
					assignmentMessageTemplate.setValue("");
					assignmentMessageTemplate.setValue(state.getAssignmentMessageTemplate());

					reminderMessageTemplate.setValueMap(map);
					reminderMessageTemplate.setValue("");
					reminderMessageTemplate.setValue(state.getReminderMessageTemplate());
				}
			});

	return messagesPanel;
}