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

The following examples show how to use com.smartgwt.client.widgets.grid.ListGridField#setAlign() . 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: 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 2
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 3
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 4
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 5
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 6
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 7
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 8
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 9
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 10
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 11
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();
			}
		});
}
 
Example 12
Source File: SubscriptionsLayout.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
private void layoutRuleNameField(SubscriptionListGrid grid) {
    ListGridField nameField = grid.getNameField();
    nameField.setAlign(CENTER);
}
 
Example 13
Source File: EditRulesLayout.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
private void init() {

        this.ownRulesGrid = new OwnRulesListGrid();
        this.otherRulesGrid = new OtherUserRulesListGrid();


        // grid fields
        ListGridField typeField = new ListGridField(EDIT_RULES_TYPE, i18n.type());
        typeField.setWidth(60);
        typeField.setAlign(Alignment.CENTER);

        ListGridField nameField = new ListGridField(EDIT_RULES_NAME, i18n.name());
        nameField.setAlign(Alignment.CENTER);

        ListGridField descriptionField = new ListGridField(EDIT_RULES_DESCRIPTION, i18n.description());
        descriptionField.setAlign(Alignment.CENTER);

        ListGridField editField = new ListGridField(EDIT_RULES_EDIT, i18n.edit());
        editField.setWidth(110);
        editField.setCanFilter(false);
        editField.setAlign(Alignment.CENTER);

        ListGridField publishField = new ListGridField(EDIT_RULES_PUBLISHED, i18n.publishButton());
        publishField.setWidth(130);
        publishField.setCanFilter(false);
        publishField.setAlign(Alignment.CENTER);

        ListGridField deleteField = new ListGridField(EDIT_RULES_DELETE, i18n.delete());
        deleteField.setWidth(110);
        deleteField.setCanFilter(false);
        deleteField.setAlign(Alignment.CENTER);
        
        ListGridField copyField = new ListGridField(EDIT_RULES_COPY, i18n.copy());
        copyField.setWidth(110);
        copyField.setCanFilter(false);
        copyField.setAlign(Alignment.CENTER);

        // fill grid with rows and data
        ListGridField[] ownRulesFields = new ListGridField[] { typeField, nameField, descriptionField, editField, publishField, deleteField };
        this.ownRulesGrid.setFields(ownRulesFields);
        this.ownRulesGrid.setCanResizeFields(false);
        
        ListGridField[] otherRulesfields = new ListGridField[] { typeField, nameField, descriptionField, copyField };
        this.otherRulesGrid.setDefaultFields(otherRulesfields);
        this.otherRulesGrid.setCanResizeFields(false);

        this.form.setFields(this.headerItem);
        
        DynamicForm headerForm1 = new DynamicForm();
        HeaderItem header1 = new HeaderItem();
        header1.setDefaultValue(i18n.ownRules());
        headerForm1.setItems(header1);

        DynamicForm headerForm2 = new DynamicForm();
        HeaderItem header2 = new HeaderItem();
        header2.setDefaultValue(i18n.otherRules());
        headerForm2.setItems(header2);

        // add to mainLayout
        addMember(this.form);
        addMember(this.spacer);
        addMember(headerForm1);
        addMember(this.ownRulesGrid);
        addMember(this.spacer);
        addMember(headerForm2);
        addMember(this.otherRulesGrid);
    }
 
Example 14
Source File: AllRulesLayout.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
private ListGridField createRuleTypeField(AllRulesListGrid grid) {
    ListGridField typeField = grid.createRuleTypeField();
    typeField.setAlign(CENTER);
    typeField.setWidth(60);
    return typeField;
}
 
Example 15
Source File: AllRulesLayout.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
private ListGridField createRuleOwnerField(AllRulesListGrid grid) {
    ListGridField ownerField = grid.createRuleOwnerField();
    ownerField.setAlign(CENTER);
    ownerField.setWidth(150);
    return ownerField;
}
 
Example 16
Source File: AllRulesLayout.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
private ListGridField createRuleNameField(AllRulesListGrid grid) {
    ListGridField nameField = grid.createRuleNameField();
    nameField.setAlign(CENTER);
    return nameField;
}
 
Example 17
Source File: AllRulesLayout.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
private ListGridField createRuleDescriptionField(AllRulesListGrid grid) {
    ListGridField descriptionField = grid.createRuleDescriptionField();
    descriptionField.setAlign(Alignment.CENTER);
    return descriptionField;
}
 
Example 18
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;
}