本文整理汇总了Java中com.google.gwt.user.cellview.client.ColumnSortEvent类的典型用法代码示例。如果您正苦于以下问题:Java ColumnSortEvent类的具体用法?Java ColumnSortEvent怎么用?Java ColumnSortEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColumnSortEvent类属于com.google.gwt.user.cellview.client包,在下文中一共展示了ColumnSortEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkStatusChanges
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
private void checkStatusChanges(Set<T> entities) {
boolean sort = false;
for(T entity : entities) {
if(entity.getStatus().equals(Status.PENDING)) {
addAprroveRejectColumns(entity);
dataProvider.getList().add(entity);
sort = true;
} else {
fireUpdateEvent(entity);
}
}
if(sort) {
ColumnSortEvent.fire(table, table.getColumnSortList());
}
}
示例2: onColumnSort
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
@Override
public void onColumnSort(ColumnSortEvent event) {
SeriesManager.Ordering.Direction direction;
if (event.isSortAscending()) {
direction = SeriesManager.Ordering.Direction.ASC;
} else {
direction = SeriesManager.Ordering.Direction.DESC;
}
Column<?, ?> column = event.getColumn();
if (column instanceof CountryNameColumn) {
manager.setOrdering(new SeriesManager.Ordering(
SeriesManager.Ordering.BY_COUNTRY_NAME, direction));
}
if (column instanceof YearColumn) {
manager.setOrdering(new SeriesManager.Ordering(
((YearColumn) column).getYear(), direction));
}
}
示例3: createAttributeNameColumn
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
protected com.google.gwt.user.cellview.client.Column<Entry<String, String>, String> createAttributeNameColumn(ColumnSortEvent.ListHandler<Entry<String, String>> sortHandler) {
// Attribute name.
final Cell<String> nameCell = canManageAttributes() ? new EditTextCell() : new TextCell();
final com.google.gwt.user.cellview.client.Column<Entry<String, String>, String> keyColumn = new com.google.gwt.user.cellview.client.Column<Entry<String, String>, String>(
nameCell) {
@Override
public String getValue(final Entry<String, String> object) {
return object.getKey() != null ? object.getKey() : "";
}
};
keyColumn.setSortable(true);
sortHandler.setComparator(keyColumn,
new Comparator<Entry<String, String>>() {
@Override
public int compare(Entry<String, String> o1,
Entry<String, String> o2) {
return o1.getKey().compareTo(o2.getKey());
}
});
keyColumn.setFieldUpdater(canManageAttributes() ? keyModifiedEventHandler : null);
return keyColumn;
}
示例4: createAttributeValueColumn
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
protected com.google.gwt.user.cellview.client.Column<Entry<String, String>, String> createAttributeValueColumn(ColumnSortEvent.ListHandler<Entry<String, String>> sortHandler) {
// Attribute value.
final Cell<String> valueCell = canManageAttributes() ? new EditTextCell() : new TextCell();
final com.google.gwt.user.cellview.client.Column<Entry<String, String>, String> valueColumn = new com.google.gwt.user.cellview.client.Column<Entry<String, String>, String>(
valueCell) {
@Override
public String getValue(final Entry<String, String> object) {
return object.getValue() != null ? object.getValue() : "";
}
};
valueColumn.setSortable(true);
sortHandler.setComparator(valueColumn,
new Comparator<Entry<String, String>>() {
@Override
public int compare(Entry<String, String> o1,
Entry<String, String> o2) {
return o1.getValue().compareTo(o2.getValue());
}
});
valueColumn.setFieldUpdater(canManageAttributes() ? valueModifiedEventHandler : null);
return valueColumn;
}
示例5: testInit
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
@Test
public void testInit() {
presenter.init();
verify(view,
times(1)).init(presenter);
verify(view,
times(1)).initWidgets(any(NewUserAttributeEditor.View.class));
verify(view,
times(1)).getColumnCount();
verify(view,
times(1)).setColumnSortHandler(any(ColumnSortEvent.ListHandler.class));
verify(view,
times(2)).addColumn(any(Column.class),
anyString());
verify(view,
times(0)).redraw();
verify(view,
times(0)).removeColumn(anyInt());
verify(view,
times(0)).setCanCreate(anyBoolean());
verify(view,
times(0)).showEmpty();
}
示例6: createColumns
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
@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);
}
示例7: createColumns
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
@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);
}
示例8: addSort
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
public void addSort(ModelColumn aColumn, boolean isAscending) {
if (aColumn.isSortable()) {
boolean contains = false;
int containsAt = -1;
for (int i = 0; i < sortList.size(); i++) {
if (sortList.get(i).getColumn() == aColumn) {
contains = true;
containsAt = i;
break;
}
}
if (contains) {
boolean wasAscending = sortList.get(containsAt).isAscending();
if (wasAscending == isAscending) {
return;
}
}
sortList.insert(sortList.size(), new ColumnSortList.ColumnSortInfo(aColumn, isAscending));
ColumnSortEvent.fire(Grid.this, sortList);
redrawHeaders();
}
}
示例9: unsortColumn
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
public void unsortColumn(ModelColumn aColumn) {
if (aColumn.isSortable()) {
boolean contains = false;
int containsAt = -1;
for (int i = 0; i < sortList.size(); i++) {
if (sortList.get(i).getColumn() == aColumn) {
contains = true;
containsAt = i;
break;
}
}
if (contains) {
sortList.remove(sortList.get(containsAt));
ColumnSortEvent.fire(Grid.this, sortList);
redrawHeaders();
}
}
}
示例10: addColumn
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
/**
* Add a new column to the end of the grid.
*
* @param column
*/
public void addColumn(fr.mncc.gwttoolbox.datagrid.client.columns.Column<T, ?> column) {
if (column == null)
return;
if (!column.getColumnWidth().trim().isEmpty())
setColumnWidth(column, column.getColumnWidth());
if (!column.hasHeader())
super.addColumn(column);
else if (!column.hasFooter())
super.addColumn(column, column.getHeader());
else
super.addColumn(column, column.getHeader(), column.getFooter());
if (column.isSortable()) {
if (columnSortHandler_ == null) {
columnSortHandler_ = new ColumnSortEvent.AsyncHandler(this);
addColumnSortHandler(columnSortHandler_);
}
getColumnSortList().push(column);
}
}
示例11: buildViewColumns
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
protected void buildViewColumns() {
//Remove existing columns should this be called again..
int columnCount = view.getColumnCount();
while (columnCount > 0) {
view.removeColumn(0);
columnCount = view.getColumnCount();
}
// Attach a column sort handler to the ListDataProvider to sort the list.
final ColumnSortEvent.ListHandler<Notification> sortHandler = new ColumnSortEvent.ListHandler<>(logsProvider.getList());
view.setColumnSortHandler(sortHandler);
// Log's type.
view.addColumn(createTypeColumn(sortHandler),
"Type");
// Log element's UUID.
view.addColumn(createContextColumn(),
"Context");
// Log's message.
view.addColumn(createMessageColumn(),
"Message");
}
示例12: addSortHandler
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
private void addSortHandler() {
propertiesTable.addColumnSortHandler(new ColumnSortEvent.Handler() {
@Override
public void onColumnSort(ColumnSortEvent event) {
Column<?, ?> column = event.getColumn();
ColumnId columnId;
if ((columnId = columnIds.get(column)) != null) {
switch (columnId) {
case NAME_COLUMN:
presenter.onSortByName(event.isSortAscending());
break;
case LABEL_COLUMN:
presenter.onSortByLabel(event.isSortAscending());
break;
case TYPE_COLUMN:
presenter.onSortByType(event.isSortAscending());
}
}
}
});
}
示例13: createMessageColumn
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
private com.google.gwt.user.cellview.client.Column<Notification, String> createMessageColumn(ColumnSortEvent.ListHandler<Notification> sortHandler) {
// Log message.
final Cell<String> messageCell = new TextCell();
final com.google.gwt.user.cellview.client.Column<Notification, String> messageColumn = new com.google.gwt.user.cellview.client.Column<Notification, String>(messageCell) {
@Override
public String getValue(final Notification object) {
return getNotificationSourceMessage(object);
}
};
messageColumn.setSortable(false);
return messageColumn;
}
示例14: show
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
public void show(ControlledVocabularyTerm term) {
table.setVisibleRange(0, table.getPageSize());
// Bit of a hack - set the empty table widget to the
// loading widget while the data is loaded from the server
table.setEmptyTableWidget(table.getLoadingIndicator());
dataProvider.getList().clear();
dialogBox.center();
service.loadControlledVocabularyTermLinks(term, new AsyncCallback<List<ControlledVocabularyTermLink>>() {
@Override
public void onSuccess(List<ControlledVocabularyTermLink> links) {
dataProvider.getList().addAll(links);
// Reset the empty table widget - see hack above
table.setEmptyTableWidget(emptyTableWidget);
// if client side sorting matches default server side
// sorting then no need to sort again on client
if(table.getColumnSortList().size() > 0
&& !(table.getColumnSortList().get(0).getColumn() instanceof UsageColumn)
&& table.getColumnSortList().get(0).isAscending()) {
ColumnSortEvent.fire(table, table.getColumnSortList());
}
}
@Override
public void onFailure(Throwable caught) {
GWT.log("Failed to load controlled vocab term links", caught);
ErrorView.instance().onUncaughtException(caught);
}
});
}
示例15: onSuccess
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入依赖的package包/类
@Override
public void onSuccess(List<T> entities) {
if(selection != null) {
selection.clear();
errorLabel.setVisible(false);
}
dataProvider.getList().clear();
addAprroveRejectColumns(entities);
dataProvider.getList().addAll(entities);
ColumnSortEvent.fire(table, table.getColumnSortList());
busyIndicator.idle();
}