本文整理汇总了Java中com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler方法的典型用法代码示例。如果您正苦于以下问题:Java ColumnSortEvent.ListHandler方法的具体用法?Java ColumnSortEvent.ListHandler怎么用?Java ColumnSortEvent.ListHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.cellview.client.ColumnSortEvent
的用法示例。
在下文中一共展示了ColumnSortEvent.ListHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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);
}
示例4: 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);
}
示例5: 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");
}
示例6: 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;
}
示例7: initImagesGrid
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入方法依赖的package包/类
private void initImagesGrid() {
imagesGrid = new CellTable<KieImage>(KEY_PROVIDER);
imagesGrid.setWidth("100%", true);
// Do not refresh the headers and footers every time the data is updated.
imagesGrid.setAutoHeaderRefreshDisabled(true);
imagesGrid.setAutoFooterRefreshDisabled(true);
// Attach a column sort handler to the ListDataProvider to sort the list.
ColumnSortEvent.ListHandler<KieImage> sortHandler = new ColumnSortEvent.ListHandler<KieImage>(imagesProvider.getList());
imagesGrid.addColumnSortHandler(sortHandler);
// Create a Pager to control the table.
SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
pager = new SimplePager(SimplePager.TextLocation.CENTER, pagerResources, false, 0, true);
pager.setDisplay(imagesGrid);
// Add a selection model so we can select cells.
final SelectionModel<KieImage> selectionModel = new MultiSelectionModel<KieImage>(KEY_PROVIDER);
imagesGrid.setSelectionModel(selectionModel,
DefaultSelectionEventManager.<KieContainer>createCheckboxManager());
// Initialize the columns.
initTableColumns(selectionModel, sortHandler);
// Add the CellList to the adapter in the database.
addDataDisplay(imagesGrid);
}
示例8: initArtifactsGrid
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入方法依赖的package包/类
private void initArtifactsGrid() {
artifactsGrid = new CellTable<KieArtifact>(KEY_PROVIDER);
artifactsGrid.setWidth("100%", true);
// Do not refresh the headers and footers every time the data is updated.
artifactsGrid.setAutoHeaderRefreshDisabled(true);
artifactsGrid.setAutoFooterRefreshDisabled(true);
// Attach a column sort handler to the ListDataProvider to sort the list.
ColumnSortEvent.ListHandler<KieArtifact> sortHandler = new ColumnSortEvent.ListHandler<KieArtifact>(gridProvider.getList());
artifactsGrid.addColumnSortHandler(sortHandler);
// Create a Pager to control the table.
SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
pager = new SimplePager(SimplePager.TextLocation.CENTER, pagerResources, false, 0, true);
pager.setDisplay(artifactsGrid);
// Add a selection model so we can select cells.
final SelectionModel<KieArtifact> selectionModel = new MultiSelectionModel<KieArtifact>(KEY_PROVIDER);
artifactsGrid.setSelectionModel(selectionModel,
DefaultSelectionEventManager.<KieArtifact>createCheckboxManager());
// Initialize the columns.
initTableColumns(selectionModel, sortHandler);
// Add the CellList to the adapter in the database.
addDataDisplay(artifactsGrid);
}
示例9: KieContainersExplorer
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入方法依赖的package包/类
@UiConstructor
public KieContainersExplorer() {
containerList = new CellTable<KieContainer>(KEY_PROVIDER);
containerList.setWidth("100%", true);
// Do not refresh the headers and footers every time the data is updated.
containerList.setAutoHeaderRefreshDisabled(true);
containerList.setAutoFooterRefreshDisabled(true);
// Attach a column sort handler to the ListDataProvider to sort the list.
ColumnSortEvent.ListHandler<KieContainer> sortHandler = new ColumnSortEvent.ListHandler<KieContainer>(containersProvider.getList());
containerList.addColumnSortHandler(sortHandler);
// Create a Pager to control the table.
SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
pager = new SimplePager(SimplePager.TextLocation.CENTER, pagerResources, false, 0, true);
pager.setDisplay(containerList);
// Add a selection model so we can select cells.
final SelectionModel<KieContainer> selectionModel = new MultiSelectionModel<KieContainer>(KEY_PROVIDER);
containerList.setSelectionModel(selectionModel,
DefaultSelectionEventManager.<KieContainer>createCheckboxManager());
// Initialize the columns.
initTableColumns(selectionModel, sortHandler);
// Add the CellList to the adapter in the database.
addDataDisplay(containerList);
initWidget(uiBinder.createAndBindUi(this));
}
示例10: createTypeColumn
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入方法依赖的package包/类
private Column<Notification, String> createTypeColumn(final ColumnSortEvent.ListHandler<Notification> sortHandler) {
final Cell<String> typeCell = new TextCell();
final Column<Notification, String> typeColumn = new Column<Notification, String>(typeCell) {
@Override
public String getValue(final Notification object) {
return getNotificationTypeMessage(object);
}
};
typeColumn.setSortable(true);
sortHandler.setComparator(typeColumn,
(o1, o2) -> o1.getType().compareTo(o2.getType()));
return typeColumn;
}
示例11: buildViewColumns
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入方法依赖的package包/类
protected void buildViewColumns() {
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.
ColumnSortEvent.ListHandler<Notification> sortHandler = new ColumnSortEvent.ListHandler<Notification>(logsProvider.getList());
view.setColumnSortHandler(sortHandler);
// Log's type.
final com.google.gwt.user.cellview.client.Column<Notification, String> typeColumn = createTypeColumn(sortHandler);
if (typeColumn != null) {
view.addColumn(typeColumn,
"Type");
}
// Log element's UUID.
final com.google.gwt.user.cellview.client.Column<Notification, String> contextColumn = createContextColumn(sortHandler);
if (contextColumn != null) {
view.addColumn(contextColumn,
"Context");
}
// Log's message.
final com.google.gwt.user.cellview.client.Column<Notification, String> messageColumn = createMessageColumn(sortHandler);
if (messageColumn != null) {
view.addColumn(messageColumn,
"Message");
}
}
示例12: createTypeColumn
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入方法依赖的package包/类
private com.google.gwt.user.cellview.client.Column<Notification, String> createTypeColumn(ColumnSortEvent.ListHandler<Notification> sortHandler) {
// Log type..
final Cell<String> typeCell = new TextCell();
final com.google.gwt.user.cellview.client.Column<Notification, String> typeColumn = new com.google.gwt.user.cellview.client.Column<Notification, String>(typeCell) {
@Override
public String getValue(final Notification object) {
return getNotificationTypeMessage(object);
}
};
typeColumn.setSortable(true);
sortHandler.setComparator(typeColumn,
(o1, o2) -> o1.getType().compareTo(o2.getType()));
return typeColumn;
}
示例13: createContextColumn
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入方法依赖的package包/类
private com.google.gwt.user.cellview.client.Column<Notification, String> createContextColumn(ColumnSortEvent.ListHandler<Notification> sortHandler) {
// Log element's context.
final Cell<String> contextCell = new TextCell();
final com.google.gwt.user.cellview.client.Column<Notification, String> contextColumn = new com.google.gwt.user.cellview.client.Column<Notification, String>(contextCell) {
@Override
public String getValue(final Notification object) {
return getNotificationContextMessage(object);
}
};
contextColumn.setSortable(false);
return contextColumn;
}
示例14: setColumnSortHandler
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入方法依赖的package包/类
@Override
public UserAttributesEditor.View setColumnSortHandler(ColumnSortEvent.ListHandler<Map.Entry<String, String>> sortHandler) {
attributesGrid.addColumnSortHandler(sortHandler);
return this;
}
示例15: setColumnSortHandler
import com.google.gwt.user.cellview.client.ColumnSortEvent; //导入方法依赖的package包/类
@Override
public Notifications.View setColumnSortHandler(final ColumnSortEvent.ListHandler<Notification> sortHandler) {
logsGrid.addColumnSortHandler(sortHandler);
return this;
}