com.smartgwt.client.widgets.grid.ListGridField Java Examples

The following examples show how to use com.smartgwt.client.widgets.grid.ListGridField. 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: DesaExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public ExportResultWidget() {
    i18n = GWT.create(ClientMessages.class);
    VLayout vLayout = new VLayout();
    vLayout.setWidth100();
    vLayout.setHeight100();
    grid = new ListGrid();
    grid.setSelectionType(SelectionStyle.SINGLE);
    grid.setFixedRecordHeights(false);
    grid.setWrapCells(true);
    ListGridField pidField = new ListGridField(ExportResourceApi.RESULT_ERROR_PID,
            i18n.ExportResultWidget_PID_Title());

    ListGridField errorField = new ListGridField(ExportResourceApi.RESULT_ERROR_MESSAGE,
            i18n.ExportResultWidget_Message_Title());
    grid.setFields(pidField, errorField);
    grid.addSelectionUpdatedHandler(new SelectionUpdatedHandler() {

        @Override
        public void onSelectionUpdated(SelectionUpdatedEvent event) {
            logForm.editSelectedData(grid);
        }
    });
    logForm = createLogForm();
    vLayout.setMembers(grid, logForm);
    this.widget = vLayout;
}
 
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 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 #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 ComboBoxItem newEmailComboSelector(String name, String title) {
	final ComboBoxItem selector = new ComboBoxItem(filterItemName(name));
	selector.setTitle(I18N.message(title));
	selector.setWrapTitle(false);
	selector.setValueField("email");
	selector.setDisplayField("email");
	selector.setPickListWidth(350);
	selector.setFetchDelay(2000);
	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 #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 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 #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 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 #9
Source File: UserHistoryPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void onDraw() {
	ListGridField event = new ListGridField("event", I18N.message("event"), 200);
	ListGridField date = new ListGridField("date", I18N.message("date"), 110);
	date.setAlign(Alignment.CENTER);
	date.setType(ListGridFieldType.DATE);
	date.setCellFormatter(new DateCellFormatter(false));
	date.setCanFilter(false);
	ListGridField comment = new ListGridField("comment", I18N.message("comment"));
	ListGridField sid = new ListGridField("sid", I18N.message("sid"), 200);
	ListGridField ip = new ListGridField("ip", I18N.message("ip"), 100);

	ListGrid listGrid = new ListGrid();
	listGrid.setEmptyMessage(I18N.message("notitemstoshow"));
	listGrid.setCanFreezeFields(true);
	listGrid.setAutoFetchData(true);
	listGrid.setDataSource(new UserHistoryDS(userId));
	listGrid.setFields(event, date, ip, sid, comment);
	addMember(listGrid);
}
 
Example #10
Source File: SubscriptionsLayout.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void layoutDeleteRuleField(SubscriptionListGrid grid) {
    ListGridField deleteField = grid.getDeleteField();
    deleteField.setWidth("15%");
    deleteField.setAlign(CENTER);
    deleteField.setCanFilter(false);
    deleteField.setCanSort(false);
}
 
Example #11
Source File: CatalogBrowser.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createAdvancedOptions() {
        formCatalog = createCatalogForm();

        lgResult = new ListGrid();
        lgResult.setDataSource(BibliographyQueryDataSource.getInstance());
//        lgResult.setUseAllDataSourceFields(true);
        ListGridField preview = new ListGridField(BibliographyQueryDataSource.FIELD_PREVIEW,
                i18n.CatalogBrowser_HeaderPreview_Title());
        ListGridField title = new ListGridField(BibliographyQueryDataSource.FIELD_TITLE,
                i18n.CatalogBrowser_HeaderTitle_Title());
        lgResult.setDetailField(BibliographyQueryDataSource.FIELD_PREVIEW);
        lgResult.setFields(title, preview);
//        lgResult.setAutoFetchData(true);
        lgResult.setHeight100();
        lgResult.setWidth100();
        lgResult.setCanExpandRecords(true);
        lgResult.setCanExpandMultipleRecords(false);
        lgResult.setExpansionMode(ExpansionMode.DETAIL_FIELD);
        lgResult.setSelectionType(SelectionStyle.SINGLE);
//        lgResult.setSelectionAppearance(SelectionAppearance.CHECKBOX);
        lgResult.setAlternateRecordStyles(true);
        lgResult.addDataArrivedHandler(new DataArrivedHandler() {

            @Override
            public void onDataArrived(DataArrivedEvent event) {
                if (event.getStartRow() == 0 && event.getEndRow() > 0) {
                    lgResult.focus();
                    lgResult.selectSingleRecord(0);
                }
            }
        });

        VLayout layout = new VLayout();
        layout.setMembers(formCatalog, lgResult);
        layout.setMargin(4);
        layout.setMembersMargin(4);
        layout.setOverflow(Overflow.AUTO);
        return layout;
    }
 
Example #12
Source File: FormGenerator.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private static ListGridField[] getPickListFields(Field optionField, String lang) {
    List<Field> columns = optionField.getFields();
    ListGridField[] listFields = new ListGridField[columns.size()];
    int i = 0;
    for (Field field : optionField.getFields()) {
        listFields[i++] = new ListGridField(field.getName(), field.getTitle(lang));
    }
    return listFields;
}
 
Example #13
Source File: SelectionMenuModel.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void loadDataIntoListGrid() {
    listGrid.setDataSource(SOSDataSource.getInstance());
    listGrid.setFields(new ListGridField("itemName", "Service"));
    listGrid.setAutoFetchData(true);
    listGrid.setShowHeader(false);
    listGrid.setLeaveScrollbarGap(false);
}
 
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 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 #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 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 #16
Source File: SubscriptionsLayout.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void layoutActivateRuleField(SubscriptionListGrid grid) {
    ListGridField activatedField = grid.getActivatedField();
    activatedField.setWidth("15%");
    activatedField.setAlign(CENTER);
    activatedField.setCanFilter(false);
    activatedField.setCanSort(false);
}
 
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 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 #18
Source File: AllRulesLayout.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private AllRulesListGrid createAllRulesListGrid() {
    AllRulesListGrid grid = new AllRulesListGrid();
    ListGridField nameField = createRuleNameField(grid);
    ListGridField editField = createEditRuleField(grid);
    ListGridField typeField = createRuleTypeField(grid);
    ListGridField ownerField = createRuleOwnerField(grid);
    ListGridField deleteField = createDeleteRuleField(grid);
    ListGridField publishedField = createRulePublishedField(grid);
    ListGridField descriptionField = createRuleDescriptionField(grid);
    grid.setFields(typeField, ownerField, nameField, descriptionField, publishedField, editField, deleteField);
    grid.setCanResizeFields(false);
    return grid;
}
 
Example #19
Source File: AllRulesLayout.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ListGridField createRulePublishedField(AllRulesListGrid grid) {
    ListGridField publishField = grid.createRulePublishedField();
    publishField.setCanFilter(false);
    publishField.setAlign(CENTER);
    publishField.setWidth(110);
    return publishField;
}
 
Example #20
Source File: AllRulesLayout.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ListGridField createEditRuleField(AllRulesListGrid grid) {
    ListGridField editField = grid.createEditRuleField();
    editField.setCanFilter(false);
    editField.setAlign(CENTER);
    editField.setWidth(110);
    return editField;
}
 
Example #21
Source File: AllRulesLayout.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private ListGridField createDeleteRuleField(AllRulesListGrid grid) {
    ListGridField deleteField = grid.createDeleteRuleField();
    deleteField.setCanFilter(false);
    deleteField.setAlign(CENTER);
    deleteField.setWidth(110);
    return deleteField;
}
 
Example #22
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 #23
Source File: TableTab.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Inits the.
 */
private void init() {

    setID(this.id);
    setTitle(this.title);
    setIcon("../img/icons/table.png"); //$NON-NLS-1$
    setPane(this.grid);

    // grid.setWidth100();
    // grid.setHeight100();
    // grid.setHeight(View.getInstance().getHeightForDataPanel());
    this.grid.setEmptyMessage(i18n.noData());

    this.dateField = new ListGridField("date", i18n.date()); //$NON-NLS-1$
    this.dateField.setAlign(Alignment.CENTER);
    this.dateField.setType(ListGridFieldType.TEXT);
    this.dateField.setCanFilter(false);
    this.dateField.setCanGroupBy(false);
    this.dateField.setCanSort(true);
    this.dateField.setCanToggle(false);
    // dateField.setWidth(View.getInstance().getWidthForDataPanel() / 2);

    this.valuesField = new ListGridField("value", "values"); //$NON-NLS-1$ //$NON-NLS-2$
    this.valuesField.setAlign(Alignment.CENTER);
    this.valuesField.setType(ListGridFieldType.TEXT);
    this.valuesField.setCanFilter(false);
    this.valuesField.setCanGroupBy(false);
    this.valuesField.setCanSort(false);
    this.valuesField.setCanToggle(false);
    // valuesField.setWidth(View.getInstance().getWidthForDataPanel() / 2);

    this.grid.setFields(this.dateField, this.valuesField);
    // grid.setCanResizeFields(true);

}
 
Example #24
Source File: PluginsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onDraw() {
	ListGridField name = new ListGridField("name", I18N.message("name"), 250);
	name.setCanEdit(false);

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

	final ListGrid list = new ListGrid();
	list.setEmptyMessage(I18N.message("notitemstoshow"));
	list.setCanEdit(false);
	list.setWidth100();
	list.setHeight100();
	list.setAutoFetchData(true);
	list.setShowFilterEditor(false);
	list.setSelectionType(SelectionStyle.SINGLE);
	list.setFields(name, version);

	addMember(list);

	SystemService.Instance.get().getPlugins(new AsyncCallback<GUIValue[]>() {
		@Override
		public void onFailure(Throwable caught) {
			Log.serverError(caught);
		}

		@Override
		public void onSuccess(GUIValue[] plugins) {
			ListGridRecord[] records = new ListGridRecord[plugins.length];
			for (int i = 0; i < plugins.length; i++) {
				records[i] = new ListGridRecord();
				records[i].setAttribute("name", plugins[i].getCode());
				records[i].setAttribute("version", plugins[i].getValue());
			}
			list.setRecords(records);
		}
	});
}
 
Example #25
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 #26
Source File: ChannelsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onDraw() {
	ToolStrip toolStrip = new ToolStrip();
	toolStrip.setHeight(20);
	toolStrip.setWidth100();
	toolStrip.addSpacer(2);
	ToolStripButton refresh = new ToolStripButton();
	refresh.setTitle(I18N.message("refresh"));
	toolStrip.addButton(refresh);
	refresh.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			list.refresh(new ChannelsDS());
		}
	});
	toolStrip.addFill();

	Layout listing = new VLayout();
	setMembers(toolStrip, listing);

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

	ListGridField members = new ListGridField("members", I18N.message("members"));
	members.setCanEdit(false);
	members.setWidth("*");

	list = new RefreshableListGrid();
	list.setEmptyMessage(I18N.message("notitemstoshow"));
	list.setCanEdit(false);
	list.setWidth100();
	list.setHeight100();
	list.setAutoFetchData(true);
	list.setSelectionType(SelectionStyle.SINGLE);
	list.setFields(name, members);
	list.setDataSource(new ChannelsDS());

	listing.addMember(list);
}
 
Example #27
Source File: WorkflowTriggersPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void refresh() {
	ListGridField workflow = new ListGridField("workflow", I18N.message("workflow"), 200);
	workflow.setCanFilter(true);

	ListGridField template = new ListGridField("template", I18N.message("template"), 200);
	template.setCanFilter(true);

	ListGridField checkin = new ListGridField("triggerAtCheckin", I18N.message("triggeratcheckin"));
	checkin.setCanFilter(false);
	checkin.setAlign(Alignment.LEFT);
	checkin.setWidth("*");

	list = new ListGrid() {
		@Override
		protected String getCellCSSText(ListGridRecord record, int rowNum, int colNum) {
			return super.getCellCSSText(record, rowNum, colNum);
		}
	};
	list.setEmptyMessage(I18N.message("notitemstoshow"));

	list.setShowRecordComponents(true);
	list.setShowRecordComponentsByCell(true);
	list.setCanFreezeFields(true);
	list.setAutoFetchData(true);
	list.setSelectionType(SelectionStyle.SINGLE);
	list.setFilterOnKeypress(true);
	list.setShowFilterEditor(false);
	list.setDataSource(new WorkflowTriggersDS("" + folder.getId()));
	list.setFields(workflow, template, checkin);

	list.addCellContextClickHandler(new CellContextClickHandler() {
		@Override
		public void onCellContextClick(CellContextClickEvent event) {
			showContextMenu();
			event.cancel();
		}
	});

	addMember(list, 0);
}
 
Example #28
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 #29
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 #30
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();
			}
		});
}