Java Code Examples for com.smartgwt.client.widgets.grid.ListGridField#setHidden()

The following examples show how to use com.smartgwt.client.widgets.grid.ListGridField#setHidden() . 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 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 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 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 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 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 4
Source File: AliasesPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void onDraw() {
	ListGridField id = new ListGridField("id", I18N.message("id"), 50);
	id.setHidden(true);
	ListGridField name = new ListGridField("name", I18N.message("name"), 200);
	ListGridField path = new ListGridField("path", I18N.message("path"));

	ListGridField icon = new ListGridField("icon", " ", 20);
	icon.setType(ListGridFieldType.IMAGE);
	icon.setCanSort(false);
	icon.setAlign(Alignment.CENTER);
	icon.setShowDefaultContextMenu(false);
	icon.setImageURLPrefix(Util.imagePrefix());
	icon.setImageURLSuffix(".png");
	icon.setCanFilter(false);

	listGrid = new ListGrid();
	listGrid.setEmptyMessage(I18N.message("notitemstoshow"));
	listGrid.setCanFreezeFields(true);
	listGrid.setAutoFetchData(true);
	dataSource = new FolderAliasesDS(folder.getId());
	listGrid.setDataSource(dataSource);
	listGrid.setFields(id, icon, name, path);
	addMember(listGrid);

	listGrid.addDoubleClickHandler(new DoubleClickHandler() {

		@Override
		public void onDoubleClick(DoubleClickEvent event) {
			FolderNavigator.get().openFolder(listGrid.getSelectedRecord().getAttributeAsLong("id"));
		}
	});
}
 
Example 5
Source File: AliasesPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void onDraw() {
	ListGridField id = new ListGridField("id", I18N.message("id"), 50);
	id.setHidden(true);

	ListGridField folderId = new ListGridField("folderId", I18N.message("id"), 50);
	folderId.setHidden(true);

	ListGridField filename = new ListGridField("filename", I18N.message("filename"), 200);
	filename.setHidden(true);
	ListGridField path = new ListGridField("path", I18N.message("path"));

	ListGridField icon = new ListGridField("icon", " ", 20);
	icon.setType(ListGridFieldType.IMAGE);
	icon.setCanSort(false);
	icon.setAlign(Alignment.CENTER);
	icon.setShowDefaultContextMenu(false);
	icon.setImageURLPrefix(Util.imagePrefix());
	icon.setImageURLSuffix(".png");
	icon.setCanFilter(false);

	listGrid = new ListGrid();
	listGrid.setEmptyMessage(I18N.message("notitemstoshow"));
	listGrid.setCanFreezeFields(true);
	listGrid.setAutoFetchData(true);
	dataSource = new DocumentAliasesDS(document.getId());
	listGrid.setDataSource(dataSource);
	listGrid.setFields(id, icon, filename, path, folderId);
	addMember(listGrid);

	listGrid.addDoubleClickHandler(new DoubleClickHandler() {

		@Override
		public void onDoubleClick(DoubleClickEvent event) {
			DocumentsPanel.get().openInFolder(listGrid.getSelectedRecord().getAttributeAsLong("folderId"),
					listGrid.getSelectedRecord().getAttributeAsLong("id"));
		}
	});
}
 
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 newAutomationRoutineSelector(String name, Long value, final ChangedHandler handler,
		boolean showEmpty) {
	final SelectItem select = newSelectItem(filterItemName(name), "routine");
	select.setValueField("id");
	select.setDisplayField("name");
	select.setEmptyDisplayValue(I18N.message("customcode"));

	ListGridField id = new ListGridField("id", I18N.message("id"));
	id.setHidden(true);
	ListGridField _name = new ListGridField("name", I18N.message("name"));
	ListGridField description = new ListGridField("description", I18N.message("description"));
	select.setPickListFields(id, _name, description);
	select.setPickListWidth(250);
	select.setOptionDataSource(new AutomationRoutinesDS(showEmpty));
	select.setValue(value);

	ChangedHandler setNullOnEmpty = new ChangedHandler() {

		@Override
		public void onChanged(ChangedEvent event) {
			if (event != null && event.getValue().equals("")) {
				select.setValue((String) null);
				select.clearValue();
			}
		}
	};
	select.addChangedHandler(setNullOnEmpty);
	if (handler != null)
		select.addChangedHandler(handler);

	return select;
}
 
Example 7
Source File: MenusPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public MenusPanel() {
	setWidth100();

	// Initialize the listing panel as placeholder
	listing.setAlign(Alignment.CENTER);
	listing.setHeight("55%");
	listing.setShowResizeBar(true);

	ListGridField id = new ListGridField("id", 40);
	id.setHidden(true);

	ListGridField name = new ListGridField("name", I18N.message("name"), 350);
	name.setCanFilter(true);
	name.setCellFormatter(new I18NCellFormatter());

	menus = new TreeGrid();
	menus.setWidth100();
	menus.setShowHeader(false);
	menus.setLeaveScrollbarGap(false);
	menus.setCanReorderRecords(false);
	menus.setCanDragRecordsOut(false);
	menus.setAutoFetchData(true);
	menus.setLoadDataOnDemand(true);
	menus.setCanSelectAll(false);
	menus.setShowConnectors(true);
	menus.setShowRoot(false);
	menus.setCanAcceptDrop(false);
	menus.setCanAcceptDroppedRecords(false);
	menus.setNodeIcon(Util.imageUrl("cube_yellow16.png"));
	menus.setFolderIcon(Util.imageUrl("cube_yellow16.png"));
	menus.setDataSource(new MenusDS());
	menus.setFields(id, name);

	listing.addMember(menus);

	rightsContainer.setAlign(Alignment.CENTER);
	rightsContainer.addMember(rights);

	setMembers(listing, rightsContainer);

	menus.addSelectionChangedHandler(new SelectionChangedHandler() {
		@Override
		public void onSelectionChanged(SelectionEvent event) {
			Record record = menus.getSelectedRecord();
			if (record != null)
				SecurityService.Instance.get().getMenu(Long.parseLong(record.getAttributeAsString("id")),
						new AsyncCallback<GUIMenu>() {

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

							@Override
							public void onSuccess(GUIMenu menu) {
								showRights(menu);
							}
						});
		}
	});
}
 
Example 8
Source File: SearchHitsGrid.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public SearchHitsGrid() {
	super(null);
	setShowRecordComponents(true);
	setShowRecordComponentsByCell(true);
	setSelectionType(Session.get().isAdmin() ? SelectionStyle.MULTIPLE : SelectionStyle.SINGLE);
	setShowRowNumbers(true);

	fieldsMap.get("type").setHidden(true);
	fieldsMap.get("customId").setHidden(true);

	fields.add(fieldsMap.get("id"));
	fields.add(fieldsMap.get("thumbnail"));
	fields.add(fieldsMap.get("statusIcons"));
	fields.add(fieldsMap.get("icon"));

	String[] cols = Session.get().getInfo().getConfig("gui.search.columns").split(",");
	for (String col : cols) {
		ListGridField field = fieldsMap.get(col);
		if (field != null) {
			field.setHidden(false);
			fields.add(field);
		}
	}

	if (!fields.contains(fieldsMap.get("filename")))
		fields.add(fieldsMap.get("filename"));
	if (!fields.contains(fieldsMap.get("score")))
		fields.add(fieldsMap.get("score"));
	if (!fields.contains(fieldsMap.get("lastModified")))
		fields.add(fieldsMap.get("lastModified"));
	if (!fields.contains(fieldsMap.get("type")))
		fields.add(fieldsMap.get("type"));
	if (!fields.contains(fieldsMap.get("size")))
		fields.add(fieldsMap.get("size"));
	if (!fields.contains(fieldsMap.get("fileVersion")))
		fields.add(fieldsMap.get("fileVersion"));
	if (!fields.contains(fieldsMap.get("version")))
		fields.add(fieldsMap.get("version"));
	if (!fields.contains(fieldsMap.get("publisher")))
		fields.add(fieldsMap.get("publisher"));
	if (!fields.contains(fieldsMap.get("published")))
		fields.add(fieldsMap.get("published"));
	if (!fields.contains(fieldsMap.get("creator")))
		fields.add(fieldsMap.get("creator"));
	if (!fields.contains(fieldsMap.get("created")))
		fields.add(fieldsMap.get("created"));
	if (!fields.contains(fieldsMap.get("customId")))
		fields.add(fieldsMap.get("customId"));
	if (!fields.contains(fieldsMap.get("folder")))
		fields.add(fieldsMap.get("folder"));
	if (!fields.contains(fieldsMap.get("rating")))
		fields.add(fieldsMap.get("rating"));
	if (!fields.contains(fieldsMap.get("rating")))
		fields.add(fieldsMap.get("rating"));
	if (!fields.contains(fieldsMap.get("comment")))
		fields.add(fieldsMap.get("comment"));
	if (!fields.contains(fieldsMap.get("workflowStatus")))
		fields.add(fieldsMap.get("workflowStatus"));
	if (!fields.contains(fieldsMap.get("workflowStatusDisp")))
		fields.add(fieldsMap.get("workflowStatusDisp"));
	if (!fields.contains(fieldsMap.get("startPublishing")))
		fields.add(fieldsMap.get("startPublishing"));
	if (!fields.contains(fieldsMap.get("stopPublishing")))
		fields.add(fieldsMap.get("stopPublishing"));
	if (!fields.contains(fieldsMap.get("template")))
		fields.add(fieldsMap.get("template"));
	if (!fields.contains(fieldsMap.get("language")))
		fields.add(fieldsMap.get("language"));

	setFields(fields.toArray(new ListGridField[0]));

	loadGridLayout(null);
}
 
Example 9
Source File: TrashPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void onDraw() {
	ListGridField id = new ListGridField("id");
	id.setHidden(true);

	ListGridField fileName = new ListGridField("filename", I18N.message("name"));
	fileName.setCanFilter(true);
	fileName.setWidth("*");

	ListGridField icon = new ListGridField("icon", " ", 24);
	icon.setType(ListGridFieldType.IMAGE);
	icon.setCanSort(false);
	icon.setAlign(Alignment.CENTER);
	icon.setShowDefaultContextMenu(false);
	icon.setImageURLPrefix(Util.imagePrefix());
	icon.setImageURLSuffix(".png");
	icon.setCanFilter(false);

	ListGridField lastModified = new ListGridField("lastModified", I18N.message("lastmodified"), 110);
	lastModified.setAlign(Alignment.CENTER);
	lastModified.setType(ListGridFieldType.DATE);
	lastModified.setCellFormatter(new DateCellFormatter(false));
	lastModified.setCanFilter(false);
	lastModified.setHidden(true);

	ListGridField customId = new ListGridField("customId", I18N.message("customid"), 110);
	customId.setType(ListGridFieldType.TEXT);
	customId.setCanFilter(true);
	customId.setHidden(true);

	list = new RefreshableListGrid();
	list.setEmptyMessage(I18N.message("notitemstoshow"));
	list.setWidth100();
	list.setHeight100();
	list.setAutoFetchData(true);
	list.setFields(icon, fileName, customId, lastModified);
	list.setSelectionType(SelectionStyle.MULTIPLE);
	list.setDataSource(new GarbageDS());
	list.setShowFilterEditor(true);
	list.setFilterOnKeypress(true);
	addMember(list);

	if (Session.get().getCurrentFolder() != null && Session.get().getCurrentFolder().isWrite())
		list.addCellContextClickHandler(new CellContextClickHandler() {
			@Override
			public void onCellContextClick(CellContextClickEvent event) {
				showContextMenu();
				event.cancel();
			}
		});
}