Java Code Examples for com.smartgwt.client.widgets.grid.ListGridField#setWidth()
The following examples show how to use
com.smartgwt.client.widgets.grid.ListGridField#setWidth() .
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 |
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 |
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 3
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
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 4
Source File: ItemFactory.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
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: AllRulesLayout.java From SensorWebClient with GNU General Public License v2.0 | 5 votes |
private ListGridField createDeleteRuleField(AllRulesListGrid grid) { ListGridField deleteField = grid.createDeleteRuleField(); deleteField.setCanFilter(false); deleteField.setAlign(CENTER); deleteField.setWidth(110); return deleteField; }
Example 6
Source File: WorkflowTriggersPanel.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
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 7
Source File: AllRulesLayout.java From SensorWebClient with GNU General Public License v2.0 | 5 votes |
private ListGridField createEditRuleField(AllRulesListGrid grid) { ListGridField editField = grid.createEditRuleField(); editField.setCanFilter(false); editField.setAlign(CENTER); editField.setWidth(110); return editField; }
Example 8
Source File: AllRulesLayout.java From SensorWebClient with GNU General Public License v2.0 | 5 votes |
private ListGridField createRulePublishedField(AllRulesListGrid grid) { ListGridField publishField = grid.createRulePublishedField(); publishField.setCanFilter(false); publishField.setAlign(CENTER); publishField.setWidth(110); return publishField; }
Example 9
Source File: SubscriptionsLayout.java From SensorWebClient with GNU General Public License v2.0 | 5 votes |
private void layoutActivateRuleField(SubscriptionListGrid grid) { ListGridField activatedField = grid.getActivatedField(); activatedField.setWidth("15%"); activatedField.setAlign(CENTER); activatedField.setCanFilter(false); activatedField.setCanSort(false); }
Example 10
Source File: SubscriptionsLayout.java From SensorWebClient with GNU General Public License v2.0 | 5 votes |
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: ChannelsPanel.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
@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 12
Source File: EditRulesLayout.java From SensorWebClient with GNU General Public License v2.0 | 4 votes |
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 13
Source File: AllRulesLayout.java From SensorWebClient with GNU General Public License v2.0 | 4 votes |
private ListGridField createRuleTypeField(AllRulesListGrid grid) { ListGridField typeField = grid.createRuleTypeField(); typeField.setAlign(CENTER); typeField.setWidth(60); return typeField; }
Example 14
Source File: AllRulesLayout.java From SensorWebClient with GNU General Public License v2.0 | 4 votes |
private ListGridField createRuleOwnerField(AllRulesListGrid grid) { ListGridField ownerField = grid.createRuleOwnerField(); ownerField.setAlign(CENTER); ownerField.setWidth(150); return ownerField; }
Example 15
Source File: FormatConvertersPanel.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
private void prepareAssociationsGrid() { associationsGrid = new ListGrid(); associationsGrid.setEmptyMessage(I18N.message("notitemstoshow")); associationsGrid.setShowFilterEditor(true); associationsGrid.setFilterOnKeypress(true); associationsGrid.setAutoFetchData(true); associationsGrid.setEditByCell(true); associationsGrid.setSelectionType(SelectionStyle.SINGLE); associationsGrid.setEditEvent(ListGridEditEvent.CLICK); associationsGrid.setDataSource(new FormatConvertersDS(null, null)); associationsGrid.setAllowFilterOperators(true); associationsGrid.setShowRecordComponents(true); associationsGrid.setShowRecordComponentsByCell(true); ListGridField in = new ListGridField("in", I18N.message("in"), 40); ListGridField out = new ListGridField("out", I18N.message("out"), 40); ListGridField converter = new ListGridField("converter", I18N.message("converter")); converter.setWidth("*"); converter.setCanEdit(!Session.get().isDemo()); converter.setCellFormatter(new CellFormatter() { @Override public String format(Object value, ListGridRecord record, int rowNum, int colNum) { String label = getConverterShortName(value != null ? value.toString() : null); boolean enabled = record.getAttributeAsBoolean("eenabled"); if (!enabled) label = "<span style='color:red;'>" + label + "</span>"; return label; } }); converter.setFilterEditorProperties(ItemFactory.newFormatConverterSelector()); associationsGrid.setFields(in, out, converter); associationsGrid.setEditorCustomizer(new ListGridEditorCustomizer() { public FormItem getEditor(ListGridEditorContext context) { ListGridField field = context.getEditField(); if (field.getName().equals("converter")) { final ListGridRecord selectedRecord = associationsGrid.getSelectedRecord(); final SelectItem editorItem = ItemFactory.newFormatConverterSelector( selectedRecord.getAttributeAsString("in"), selectedRecord.getAttributeAsString("out")); editorItem.setWidth("*"); return editorItem; } else return context.getDefaultProperties(); } }); associationsGrid.addEditCompleteHandler(new EditCompleteHandler() { @Override public void onEditComplete(EditCompleteEvent event) { Record converterRecord = settingsGrid.find(new AdvancedCriteria("id", OperatorId.EQUALS, associationsGrid.getSelectedRecord().getAttributeAsString("converter"))); if (converterRecord != null) associationsGrid.getSelectedRecord().setAttribute("eenabled", converterRecord.getAttributeAsBoolean("eenabled")); } }); }
Example 16
Source File: TrashPanel.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
@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 17
Source File: ComparatorsPanel.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
private void prepareAssociationsGrid() { associationsGrid = new ListGrid(); associationsGrid.setEmptyMessage(I18N.message("notitemstoshow")); associationsGrid.setShowFilterEditor(true); associationsGrid.setFilterOnKeypress(true); associationsGrid.setAutoFetchData(true); associationsGrid.setEditByCell(true); associationsGrid.setSelectionType(SelectionStyle.SINGLE); associationsGrid.setEditEvent(ListGridEditEvent.CLICK); associationsGrid.setDataSource(new ComparatorsDS(null)); associationsGrid.setAllowFilterOperators(true); associationsGrid.setShowRecordComponents(true); associationsGrid.setShowRecordComponentsByCell(true); ListGridField in = new ListGridField("in", I18N.message("ext"), 40); ListGridField comparator = new ListGridField("comparator", I18N.message("comparator")); comparator.setWidth("*"); comparator.setCanEdit(!Session.get().isDemo()); comparator.setCellFormatter(new CellFormatter() { @Override public String format(Object value, ListGridRecord record, int rowNum, int colNum) { String label = getComparatorShortName(value != null ? value.toString() : null); boolean enabled = record.getAttributeAsBoolean("eenabled"); if (!enabled) label = "<span style='color:red;'>" + label + "</span>"; return label; } }); comparator.setFilterEditorProperties(ItemFactory.newFormatConverterSelector()); associationsGrid.setFields(in, comparator); associationsGrid.setEditorCustomizer(new ListGridEditorCustomizer() { public FormItem getEditor(ListGridEditorContext context) { ListGridField field = context.getEditField(); if (field.getName().equals("comparator")) { final ListGridRecord selectedRecord = associationsGrid.getSelectedRecord(); final SelectItem editorItem = ItemFactory .newComparatorSelector(selectedRecord.getAttributeAsString("in")); editorItem.setWidth("*"); return editorItem; } else return context.getDefaultProperties(); } }); associationsGrid.addEditCompleteHandler(new EditCompleteHandler() { @Override public void onEditComplete(EditCompleteEvent event) { Record converterRecord = settingsGrid.find(new AdvancedCriteria("id", OperatorId.EQUALS, associationsGrid.getSelectedRecord().getAttributeAsString("comparator"))); if (converterRecord != null) associationsGrid.getSelectedRecord().setAttribute("eenabled", converterRecord.getAttributeAsBoolean("eenabled")); } }); }