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

The following examples show how to use com.smartgwt.client.widgets.grid.ListGridField#setShowDefaultContextMenu() . 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: 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 2
Source File: GUILanguagesPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onDraw() {
	ListGridField enabled = new ListGridField("eenabled", " ", 24);
	enabled.setType(ListGridFieldType.IMAGE);
	enabled.setCanSort(false);
	enabled.setAlign(Alignment.CENTER);
	enabled.setShowDefaultContextMenu(false);
	enabled.setImageURLPrefix(Util.imagePrefix());
	enabled.setImageURLSuffix(".gif");
	enabled.setCanFilter(false);

	ListGridField code = new ListGridField("code", I18N.message("code"), 80);
	code.setCanEdit(false);

	ListGridField name = new ListGridField("name", I18N.message("name"));
	name.setCanEdit(false);

	list = new ListGrid();
	list.setEmptyMessage(I18N.message("notitemstoshow"));
	list.setCanEdit(false);
	list.setWidth100();
	list.setHeight100();
	list.setAutoFetchData(true);
	list.setDataSource(new LanguagesDS(true));
	list.setSelectionType(SelectionStyle.SINGLE);
	list.setFields(enabled, code, name);

	addMember(list);

	if (Feature.enabled(Feature.GUI_LANGUAGES))
		list.addCellContextClickHandler(new CellContextClickHandler() {
			@Override
			public void onCellContextClick(CellContextClickEvent event) {
				showContextMenu();
				event.cancel();
			}
		});
}
 
Example 3
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 4
Source File: SearchIndexingPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private Tab fillLanguagesTab() {
	Tab languagesTab = new Tab(I18N.message("languages"));
	Layout languagesTabPanel = new HLayout();
	languagesTabPanel.setWidth100();
	languagesTabPanel.setHeight100();

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

	ListGridField code = new ListGridField("code", I18N.message("code"), 80);
	code.setCanEdit(false);

	ListGridField name = new ListGridField("name", I18N.message("name"));
	name.setCanEdit(false);

	langsList = new ListGrid();
	langsList.setCanEdit(false);
	langsList.setWidth100();
	langsList.setHeight100();
	langsList.setAutoFetchData(true);
	langsList.setDataSource(new LanguagesDS(false));
	langsList.setShowFilterEditor(true);
	langsList.setFilterOnKeypress(true);
	langsList.setSelectionType(SelectionStyle.SINGLE);
	langsList.setFields(enabled, code, name);

	languagesTabPanel.addMember(langsList);
	languagesTab.setPane(languagesTabPanel);

	if (Feature.enabled(Feature.INDEX_LANGUAGES))
		langsList.addCellContextClickHandler(new CellContextClickHandler() {
			@Override
			public void onCellContextClick(CellContextClickEvent event) {
				showLanguagesMenu();
				event.cancel();
			}
		});

	return languagesTab;
}
 
Example 5
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();
			}
		});
}