Package com.smartgwt.client.widgets.grid

Examples of com.smartgwt.client.widgets.grid.ListGrid


        searchStrategies.put(SearchMode.SAVED_SEARCH_MODE, favoritesSearchStrategy);

        // set the default search provider
        setSearchMode(SearchMode.BASIC_SEARCH_MODE);

        pickListGrid = new ListGrid();
        configurePickListGrid();

        DynamicForm searchTextForm = new DynamicForm();
        searchTextForm.setStyleName("searchBar");
        searchTextForm.setAutoWidth();
View Full Code Here


    }

    public void switchToBasicSearchMode() {
        pickListGrid.destroy();
        pickListGrid = new ListGrid();

        setSearchMode(SearchMode.BASIC_SEARCH_MODE);
        saveSearchButton.setIcon(IconEnum.STAR_OFF.getIcon16x16Path());
        saveSearchTextItem.hide();
        configurePickListGrid();
View Full Code Here

        populateInitialSearch();
    }

    public void switchToSavedSearchMode() {
        pickListGrid.destroy();
        pickListGrid = new ListGrid();

        setSearchMode(SearchMode.SAVED_SEARCH_MODE);

        saveSearchButton.setIcon(IconEnum.STAR_ON.getIcon16x16Path());
        saveSearchTextItem.setValue(MSG.view_searchBar_savedSearch_namePrompt());
View Full Code Here

                @Override
                public void onSuccess(List<SearchSuggestion> results) {

                    try {
                        ListGrid searchBarPickListGrid = searchBar.getPickListGrid();
                        DataSource ds = searchBarPickListGrid.getDataSource();

                        // create the datasource if needed
                        if (null == ds) {
                            ds = new DataSource();
                            ds.setClientOnly(true);
                            DataSourceTextField idField = new DataSourceTextField(ATTR_ID, "Id");
                            idField.setPrimaryKey(true);
                            idField.setCanView(false);

                            DataSourceTextField valueField = new DataSourceTextField(ATTR_VALUE, "Value");

                            ds.setFields(idField, valueField);

                            searchBarPickListGrid.setDataSource(ds);
                            searchBarPickListGrid.getField(ATTR_VALUE).setShowHover(true);
                            searchBarPickListGrid.getField(ATTR_VALUE).setHoverCustomizer(new HoverCustomizer() {

                                public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
                                    if (null == record) {
                                        return "";
                                    }
                                    String kind = record.getAttribute(ATTR_KIND);
                                    if (kind.equals("SAVED") || kind.equals("GLOBAL")) {
                                        String pattern = record.getAttribute(ATTR_PATTERN);

                                        if (!(null == pattern || pattern.isEmpty())) {
                                            return pattern;
                                        }
                                    }

                                    return "";
                                }
                            });

                        } else {
                            ds.invalidateCache();
                        }

                        for (SearchSuggestion searchSuggestion : results) {
                            Log.debug("search tab aware Suggestions: " + searchSuggestion.getKind() + ", "
                                + searchSuggestion.getValue() + ", " + searchSuggestion.getLabel());
                            ListGridRecord record = new ListGridRecord();
                            record.setAttribute(ATTR_ID, searchSuggestion.getValue());
                            if (null != searchSuggestion.getKind()) {
                                record.setAttribute(ATTR_KIND, searchSuggestion.getKind().getDisplayName());
                            }
                            record.setAttribute(ATTR_NAME, searchSuggestion.getLabel());
                            record.setAttribute(ATTR_VALUE, searchSuggestion.getValue());
                            String pattern = searchSuggestion.getOptional();
                            record.setAttribute(ATTR_PATTERN, (null == pattern) ? "" : pattern);
                            ds.addData(record);
                        }

                        try {
                            searchBarPickListGrid.setData(new ListGridRecord[] {});
                            searchBarPickListGrid.fetchData();
                        } catch (Exception e) {
                            Log.info("Caught exception on fetchData: " + e);
                        }

                        long suggestFetchTime = System.currentTimeMillis() - suggestStart;
View Full Code Here

        };
    }

    @Override
    protected ListGrid decorateLiveDataGrid(List<ListGridRecord> records) {
        ListGrid liveDataGrid = new ListGrid();
        liveDataGrid.setShowAllRecords(true);
        liveDataGrid.setData(records.toArray(new ListGridRecord[records.size()]));
        liveDataGrid.setSelectionType(SelectionStyle.NONE);
        ListGridField name = new ListGridField("name", MSG.dataSource_traits_field_trait());
        ListGridField value = new ListGridField("value", MSG.common_title_value());
        liveDataGrid.setFields(name, value);

        return liveDataGrid;
    }
View Full Code Here

                    }
                });
            }
        }

        ListGrid listGrid = getListGrid();
        listGrid.setAutoSaveEdits(false);
        listGrid.setFields(fields.toArray(new ListGridField[fields.size()]));
        listGrid.sort(FIELD_ADDRESS.propertyName(), SortDirection.ASCENDING);
        listGrid.setHoverWidth(200);
        showCommonActions();
    }
View Full Code Here

        Log.info("Polling job fetching the number of unack alerts for particular storage nodes has been scheduled");
    }

    @Override
    protected ListGrid createListGrid() {
        ListGrid listGrid = new ListGrid() {
            @Override
            protected Canvas getExpansionComponent(final ListGridRecord record) {
                if (record.getAttribute(FIELD_RESOURCE_ID.propertyName()) == null) {
                    // no resource set
                    return new HTMLFlow(MSG.view_adminTopology_storageNodes_noLoad());
                }
                int id = record.getAttributeAsInt(FIELD_ID);
                Log.debug("Expanding Storage Node [id=" + id + "] row");
                StorageNodeLoadComponent component = new StorageNodeLoadComponent(id, null);
                component.redraw();
                return component;
            }

        };
        listGrid.setCanExpandRecords(true);
        return listGrid;
    }
View Full Code Here

        setAutoFitOnField(version);

        // To get the ListGrid the Table must be initialized (via onInit()) by adding to the Canvas
        addMember(table);

        ListGrid listGrid = table.getListGrid();
        listGrid.setFields(id, name, size, /*md5,*/sha256, version); // today, we don't set md5, no sense showing it
        listGrid.setData(buildRecords(files));
        table.setTableActionDisableOverride(true);
    }
View Full Code Here

            setListGridFields(idField, categoryField, nameField, descriptionField, typeNameField, pluginNameField);
            setListGridDoubleClickHandler(new DoubleClickHandler() {
                @Override
                public void onDoubleClick(DoubleClickEvent event) {
                    ListGrid listGrid = (ListGrid) event.getSource();
                    ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
                    if (selectedRows != null && selectedRows.length == 1) {
                        String groupUrl = LinkManager.getResourceGroupLink(selectedRows[0].getAttributeAsInt("id"));
                        CoreGUI.goToView(groupUrl);
                    }
                }
View Full Code Here

        });
    }

    @Override
    protected ListGrid createListGrid() {
        return new ListGrid() {
            {
                setShowRecordComponents(true);
                setShowRecordComponentsByCell(true);
                setAutoFitData(Autofit.VERTICAL);
                setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.grid.ListGrid

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.