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

The following examples show how to use com.smartgwt.client.widgets.form.fields.SelectItem#setDisabled() . 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: ImportSettingsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ImportSettingsPanel(GUIArchive archive, ChangedHandler changedHandler) {
	this.archive = archive;

	form.setValuesManager(vm);
	form.setTitleOrientation(TitleOrientation.TOP);

	TextItem description = ItemFactory.newTextItem("description", "description", archive.getDescription());
	description.addChangedHandler(changedHandler);
	description.setDisabled(archive.getStatus() != GUIArchive.STATUS_OPENED);

	RadioGroupItem importTemplates = ItemFactory.newBooleanSelector("importtemplates", "importtemplates");
	importTemplates.setValue(archive.getImportTemplate() == 1 ? "yes" : "no");
	importTemplates.addChangedHandler(changedHandler);
	importTemplates.setDisabled(archive.getStatus() != GUIArchive.STATUS_OPENED);

	SelectItem options = ItemFactory.newImportCustomIds();
	options.setWidth(200);
	options.setValue(Integer.toString(archive.getImportCustomId()));
	options.addChangedHandler(changedHandler);
	options.setDisabled(archive.getStatus() != GUIArchive.STATUS_OPENED);

	form.setFields(description, importTemplates, options);

	addMember(form);
}
 
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 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 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 newWorkflowSelector() {
	SelectItem item = new SelectItem("workflow", I18N.message("workflow"));
	item.setRequiredMessage(I18N.message("fieldrequired"));
	ListGridField name = new ListGridField("name", I18N.message("name"));
	ListGridField description = new ListGridField("description", I18N.message("description"));
	item.setWidth(250);
	item.setPickListWidth(300);
	item.setPickListFields(name, description);
	item.setDisplayField("name");
	item.setValueField("id");
	item.setWrapTitle(false);
	item.setOptionDataSource(new WorkflowsDS(false, true));
	if (!Feature.enabled(Feature.WORKFLOW))
		item.setDisabled(true);
	return item;
}
 
Example 4
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 5
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 newFormSelector() {
	SelectItem item = new SelectItem("form", I18N.message("form"));
	item.setRequiredMessage(I18N.message("fieldrequired"));
	ListGridField name = new ListGridField("name", I18N.message("name"));
	item.setPickListFields(name);
	item.setDisplayField("name");
	item.setValueField("id");
	item.setWrapTitle(false);
	item.setOptionDataSource(new FormsDS());
	if (!Feature.enabled(Feature.FORM))
		item.setDisabled(true);
	return item;
}
 
Example 6
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 7
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 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 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;
}