/** * Push a {@link Column} onto the list at index zero, setting ascending to * true. If the column already exists, it will be removed from its current * position and placed at the start of the list. If the Column is already at * the start of the list, its ascending bit will be flipped (ascending to * descending and vice versa). * * @param column the {@link Column} to push * @return the {@link ColumnSortInfo} that was pushed */ public ColumnSortInfo push(Column<?, ?> column) { // If the column matches the primary column, toggle the order. boolean ascending = (column == null) ? true : column.isDefaultSortAscending(); if (size() > 0 && get(0).getColumn() == column) { ascending = !get(0).isAscending(); } // Push the new column. ColumnSortInfo toRet = new ColumnSortInfo(column, ascending); push(toRet); return toRet; }
/** * Mark a {@linkplain ColumnSortInfo#getColumn column} as sorted. * * @see #getColumnSortList */ protected void pushColumnSort(ColumnSortInfo columnSortInfo) { getColumnSortList().push(columnSortInfo); }
sortList.push(column); updatingSortList = false; ColumnSortEvent.fire(this, sortList);
public void refreshTable() { processVarListGrid.getColumnSortList().clear(); processVarListGrid.getColumnSortList().push(new ColumnSortList.ColumnSortInfo(processVarListGrid.getColumn(2), false)); processVarListGrid.redraw(); }
public void refreshTable() { processVarListGrid.getColumnSortList().clear(); processVarListGrid.getColumnSortList().push( new ColumnSortList.ColumnSortInfo( processVarListGrid.getColumn( 2 ), false ) ); processVarListGrid.redraw(); }
@Override public void initColumns(ExtendedPagedTable extendedPagedTable) { Column processNameColumn = initProcessNameColumn(); Column versionColumn = initVersionColumn(); Column deploymentColumn = initDeploymentColumn(); ColumnMeta<ProcessSummary> actionsColumnMeta = initActionsColumn(); List<ColumnMeta<ProcessSummary>> columnMetas = new ArrayList<ColumnMeta<ProcessSummary>>(); columnMetas.add(new ColumnMeta<>(processNameColumn, constants.Name())); columnMetas.add(new ColumnMeta<>(versionColumn, constants.Version())); columnMetas.add(new ColumnMeta<>(deploymentColumn, constants.Deployment_Name())); columnMetas.add(actionsColumnMeta); extendedPagedTable.addSelectionIgnoreColumn(actionsColumnMeta.getColumn()); extendedPagedTable.addColumns(columnMetas); extendedPagedTable.setColumnWidth(actionsColumnMeta.getColumn(), AbstractMultiGridView.ACTIONS_COLUMN_WIDTH, Style.Unit.PX); extendedPagedTable.getColumnSortList().push(processNameColumn); }
public void setItems(List<T> persons) { List<T> list = dataProvider.getList(); list.clear(); if (persons != null) { list.addAll(persons); } SetSelectionModel<T> selectionModel = getSelectionModel(); if (selectionModel != null) { selectionModel.clear(); } dataProvider.flush(); ColumnSortList sortList = dataTable.getColumnSortList(); sortList.clear(); if (defaultSortColumnIndex != null) { sortList.push(dataTable.getColumn(defaultSortColumnIndex)); } getPager().setDisplay(dataTable); getPager().setPage(0); }
/** * Click on a specific header of a cell table. * * @param table The targeted cell table * @param index The targeted cell header index in the table */ public static void clickHeader(AbstractCellTable<?> table, int index) { BrowserSimulatorImpl.get().fireLoopEnd(); table.getColumnSortList().push(table.getColumn(index)); ColumnSortEvent.fire(table, table.getColumnSortList()); BrowserSimulatorImpl.get().fireLoopEnd(); }
/** * Click on a specific header of a cell table. * * @param table The targeted cell table * @param index The targeted cell header index in the table */ public static void clickHeader(AbstractCellTable<?> table, int index) { BrowserSimulatorImpl.get().fireLoopEnd(); table.getColumnSortList().push(table.getColumn(index)); ColumnSortEvent.fire(table, table.getColumnSortList()); BrowserSimulatorImpl.get().fireLoopEnd(); }
/** * Push a {@link Column} onto the list at index zero, setting ascending to * true. If the column already exists, it will be removed from its current * position and placed at the start of the list. If the Column is already at * the start of the list, its ascending bit will be flipped (ascending to * descending and vice versa). * * @param column the {@link Column} to push * @return the {@link ColumnSortInfo} that was pushed */ public ColumnSortInfo push(Column<?, ?> column) { // If the column matches the primary column, toggle the order. boolean ascending = (column == null) ? true : column.isDefaultSortAscending(); if (size() > 0 && get(0).getColumn() == column) { ascending = !get(0).isAscending(); } // Push the new column. ColumnSortInfo toRet = new ColumnSortInfo(column, ascending); push(toRet); return toRet; }
/** * Push a {@link Column} onto the list at index zero, setting ascending to * true. If the column already exists, it will be removed from its current * position and placed at the start of the list. If the Column is already at * the start of the list, its ascending bit will be flipped (ascending to * descending and vice versa). * * @param column the {@link Column} to push * @return the {@link ColumnSortInfo} that was pushed */ public ColumnSortInfo push(Column<?, ?> column) { // If the column matches the primary column, toggle the order. boolean ascending = (column == null) ? true : column.isDefaultSortAscending(); if (size() > 0 && get(0).getColumn() == column) { ascending = !get(0).isAscending(); } // Push the new column. ColumnSortInfo toRet = new ColumnSortInfo(column, ascending); push(toRet); return toRet; }
@SuppressWarnings("unchecked") @Override protected void createColumns(DefaultCellTable<Application> table, ListDataProvider<Application> dataProvider) { final TextColumn<Application> nameColumn = new TextColumn<Application>() { @Override public String getValue(Application application) { return application.localName(); } }; nameColumn.setSortable(true); final TextColumn<Application> namespaceColumn = new TextColumn<Application>() { @Override public String getValue(Application application) { return application.namespace(); } }; namespaceColumn.setSortable(true); ColumnSortEvent.ListHandler<Application> sortHandler = new ColumnSortEvent.ListHandler<Application>( dataProvider.getList()); sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn)); sortHandler.setComparator(namespaceColumn, createColumnCommparator(namespaceColumn)); table.addColumn(nameColumn, Singleton.MESSAGES.label_name()); table.addColumn(namespaceColumn, Singleton.MESSAGES.label_targetNamespace()); table.addColumnSortHandler(sortHandler); table.addColumnSortHandler(sortHandler); table.getColumnSortList().push(namespaceColumn); table.getColumnSortList().push(nameColumn); }
@SuppressWarnings("unchecked") @Override protected void createColumns(DefaultCellTable<ArtifactReference> table, ListDataProvider<ArtifactReference> dataProvider) { final TextColumn<ArtifactReference> nameColumn = new TextColumn<ArtifactReference>() { @Override public String getValue(ArtifactReference reference) { return reference.getName(); } }; nameColumn.setSortable(true); final TextColumn<ArtifactReference> urlColumn = new TextColumn<ArtifactReference>() { @Override public String getValue(ArtifactReference reference) { return reference.getUrl(); } }; urlColumn.setSortable(true); ColumnSortEvent.ListHandler<ArtifactReference> sortHandler = new ColumnSortEvent.ListHandler<ArtifactReference>( dataProvider.getList()); sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn)); sortHandler.setComparator(urlColumn, createColumnCommparator(urlColumn)); table.addColumn(nameColumn, Singleton.MESSAGES.label_name()); table.addColumn(urlColumn, Singleton.MESSAGES.label_url()); table.addColumnSortHandler(sortHandler); table.addColumnSortHandler(sortHandler); table.getColumnSortList().push(urlColumn); table.getColumnSortList().push(nameColumn); }
@SuppressWarnings("unchecked") @Override protected void createColumns(DefaultCellTable<Component> table, ListDataProvider<Component> dataProvider) { final TextColumn<Component> nameColumn = new TextColumn<Component>() { @Override public String getValue(Component component) { ComponentProviderProxy provider = _componentProviders.getExtensionProviderByComponentName(component .getName()); if (provider == null) { return component.getName(); } return provider.getDisplayName(); } }; nameColumn.setSortable(true); ColumnSortEvent.ListHandler<Component> sortHandler = new ColumnSortEvent.ListHandler<Component>( dataProvider.getList()); sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn)); table.addColumn(nameColumn, Singleton.MESSAGES.label_name()); table.addColumnSortHandler(sortHandler); table.getColumnSortList().push(nameColumn); }
@Override protected void createColumns(DefaultCellTable<Reference> table, ListDataProvider<Reference> dataProvider) { Column<Reference, String> nameColumn = new Column<Reference, String>(new ClickableTextCell()) { @Override public String getValue(Reference reference) { return reference.localName(); } }; nameColumn.setSortable(true); final TextColumn<Reference> namespaceColumn = new TextColumn<Reference>() { @Override public String getValue(Reference reference) { return reference.namespace(); } }; namespaceColumn.setSortable(true); ColumnSortEvent.ListHandler<Reference> sortHandler = new ColumnSortEvent.ListHandler<Reference>( dataProvider.getList()); sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn)); sortHandler.setComparator(namespaceColumn, createColumnCommparator(namespaceColumn)); table.addColumn(nameColumn, Singleton.MESSAGES.label_name()); table.addColumn(namespaceColumn, Singleton.MESSAGES.label_targetNamespace()); table.addColumnSortHandler(sortHandler); table.getColumnSortList().push(namespaceColumn); table.getColumnSortList().push(nameColumn); }
@SuppressWarnings("unchecked") @Override protected void createColumns(DefaultCellTable<Component> table, ListDataProvider<Component> dataProvider) { final TextColumn<Component> nameColumn = new TextColumn<Component>() { @Override public String getValue(Component component) { ComponentProviderProxy provider = _componentProviders.getExtensionProviderByComponentName(component .getName()); if (provider == null) { return component.getName(); } return provider.getDisplayName(); } }; nameColumn.setSortable(true); ColumnSortEvent.ListHandler<Component> sortHandler = new ColumnSortEvent.ListHandler<Component>( dataProvider.getList()); sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn)); table.addColumn(nameColumn, Singleton.MESSAGES.label_name()); table.addColumnSortHandler(sortHandler); table.getColumnSortList().push(nameColumn); }
@Override protected void createColumns(DefaultCellTable<Service> table, ListDataProvider<Service> dataProvider) { Column<Service, String> nameColumn = new Column<Service, String>(new ClickableTextCell()) { @Override public String getValue(Service service) { return service.localName(); } }; nameColumn.setSortable(true); final TextColumn<Service> namespaceColumn = new TextColumn<Service>() { @Override public String getValue(Service service) { return service.namespace(); } }; namespaceColumn.setSortable(true); ColumnSortEvent.ListHandler<Service> sortHandler = new ColumnSortEvent.ListHandler<Service>( dataProvider.getList()); sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn)); sortHandler.setComparator(namespaceColumn, createColumnCommparator(namespaceColumn)); table.addColumn(nameColumn, Singleton.MESSAGES.label_name()); table.addColumn(namespaceColumn, Singleton.MESSAGES.label_targetNamespace()); table.addColumnSortHandler(sortHandler); table.getColumnSortList().push(namespaceColumn); table.getColumnSortList().push(nameColumn); }
@Override protected void createColumns(DefaultCellTable<Validator> table, ListDataProvider<Validator> dataProvider) { TextColumn<Validator> nameColumn = new TextColumn<Validator>() { @Override public String getValue(Validator validator) { return validator.getName(); } }; nameColumn.setSortable(true); TextColumn<Validator> typeColumn = new TextColumn<Validator>() { @Override public String getValue(Validator validator) { return validator.getType(); } }; typeColumn.setSortable(true); ColumnSortEvent.ListHandler<Validator> sortHandler = new ColumnSortEvent.ListHandler<Validator>( dataProvider.getList()); sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn)); sortHandler.setComparator(typeColumn, createColumnCommparator(typeColumn)); table.addColumn(nameColumn, Singleton.MESSAGES.label_name()); table.addColumn(typeColumn, Singleton.MESSAGES.label_type()); table.addColumnSortHandler(sortHandler); table.getColumnSortList().push(typeColumn); table.getColumnSortList().push(nameColumn); table.setWidth("100%", false); //$NON-NLS-1$ table.setColumnWidth(nameColumn, 70, Style.Unit.PCT); table.setColumnWidth(typeColumn, 30, Style.Unit.PCT); }
@Override protected void createColumns(DefaultCellTable<Reference> table, ListDataProvider<Reference> dataProvider) { Column<Reference, String> nameColumn = new Column<Reference, String>(new ClickableTextCell()) { @Override public String getValue(Reference reference) { return reference.localName(); } }; nameColumn.setFieldUpdater(new FieldUpdater<Reference, String>() { @Override public void update(int index, Reference object, String value) { _presenter.onNavigateToReference(object, _application); } }); nameColumn.setSortable(true); ColumnSortEvent.ListHandler<Reference> sortHandler = new ColumnSortEvent.ListHandler<Reference>( dataProvider.getList()); sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn)); table.addColumn(nameColumn, Singleton.MESSAGES.label_name()); table.addColumnSortHandler(sortHandler); table.getColumnSortList().push(nameColumn); }
protected void createColumns(DefaultCellTable<ComponentReference> table, ListDataProvider<ComponentReference> dataProvider) { TextColumn<ComponentReference> nameColumn = new TextColumn<ComponentReference>() { @Override public String getValue(ComponentReference reference) { return reference.localName(); } }; nameColumn.setSortable(true); TextColumn<ComponentReference> interfaceColumn = new TextColumn<ComponentReference>() { @Override public String getValue(ComponentReference reference) { return reference.getInterface(); } }; interfaceColumn.setSortable(true); ColumnSortEvent.ListHandler<ComponentReference> sortHandler = new ColumnSortEvent.ListHandler<ComponentReference>( dataProvider.getList()); sortHandler.setComparator(nameColumn, createColumnCommparator(nameColumn)); sortHandler.setComparator(interfaceColumn, createColumnCommparator(interfaceColumn)); table.addColumn(nameColumn, Singleton.MESSAGES.label_name()); table.addColumn(interfaceColumn, Singleton.MESSAGES.label_interface()); table.addColumnSortHandler(sortHandler); table.getColumnSortList().push(nameColumn); }