本文整理匯總了Java中com.google.gwt.user.cellview.client.Column.setSortable方法的典型用法代碼示例。如果您正苦於以下問題:Java Column.setSortable方法的具體用法?Java Column.setSortable怎麽用?Java Column.setSortable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.cellview.client.Column
的用法示例。
在下文中一共展示了Column.setSortable方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createColumnTextCell
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private ColumnMeta createColumnTextCell(final String value,
String dataStoreName) {
Column<String, String> testColumn = new Column<String, String>(new TextCell()) {
@Override
public String getValue(String object) {
return value;
}
};
testColumn.setSortable(true);
testColumn.setDataStoreName(dataStoreName);
final Header<String> header = new TextHeader(value);
ColumnMeta<String> columnMeta = new ColumnMeta(testColumn,
dataStoreName);
columnMeta.setHeader(header);
return columnMeta;
}
示例2: createColumnCheckboxCell
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private ColumnMeta createColumnCheckboxCell(String dataStoreName) {
CheckboxCell checkboxCell = new CheckboxCell(true,
false);
Column<String, Boolean> checkColumn = new Column<String, Boolean>(checkboxCell) {
@Override
public Boolean getValue(String object) {
return true;
}
};
Header<Boolean> selectPageHeader = new Header<Boolean>(checkboxCell) {
@Override
public Boolean getValue() {
return true;
}
};
checkColumn.setSortable(false);
checkColumn.setDataStoreName(dataStoreName);
ColumnMeta<String> checkColMeta = new ColumnMeta<String>(checkColumn,
"");
checkColMeta.setHeader(selectPageHeader);
return checkColMeta;
}
示例3: createColumns
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的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: addPropertyNameColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void addPropertyNameColumn() {
Column<ObjectProperty, String> column = new Column<ObjectProperty, String>(new TextCell()) {
@Override
public String getValue(ObjectProperty objectProperty) {
if (objectProperty.getName() != null) {
return objectProperty.getName();
} else {
return "";
}
}
};
column.setSortable(true);
propertiesTable.addColumn(column,
Constants.INSTANCE.objectBrowser_columnName());
propertiesTable.setColumnWidth(column,
25,
Style.Unit.PCT);
columnIds.put(column,
ColumnId.NAME_COLUMN);
}
示例5: addPropertyLabelColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void addPropertyLabelColumn() {
Column<ObjectProperty, String> column = new Column<ObjectProperty, String>(new TextCell()) {
@Override
public String getValue(ObjectProperty objectProperty) {
if (objectProperty.getName() != null) {
return AnnotationValueHandler.getStringValue(objectProperty,
MainDomainAnnotations.LABEL_ANNOTATION,
MainDomainAnnotations.VALUE_PARAM);
} else {
return "";
}
}
};
column.setSortable(true);
propertiesTable.addColumn(column,
Constants.INSTANCE.objectBrowser_columnLabel());
propertiesTable.setColumnWidth(column,
25,
Style.Unit.PCT);
columnIds.put(column,
ColumnId.LABEL_COLUMN);
}
示例6: displayColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
public void displayColumn(Column<String[], ?> c, int col, String name,
boolean start_sorted) {
table.addColumn(c, name);
if (sortable) {
c.setSortable(true);
Comparator<String[]> cmp = new StringCsvComparator(col);
sorthandler.setComparator(c, cmp);
if (start_sorted) {
table.getColumnSortList().push(c);
Collections.sort(ldp.getList(), cmp);
ldp.refresh();
}
}
}
示例7: createColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private Column createColumn(String value,
String dataStoreName) {
Column<String, String> testColumn = new Column<String, String>(new TextCell()) {
@Override
public String getValue(String object) {
return value;
}
};
testColumn.setSortable(true);
testColumn.setDataStoreName(dataStoreName);
return testColumn;
}
示例8: addColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
@Override
public void addColumn(ColumnType columnType, String columnId, String columnName, int index, boolean selectEnabled, boolean sortEnabled) {
Column<Integer,?> column = createColumn(columnType, columnId, selectEnabled, index);
if (column != null) {
column.setSortable(sortEnabled);
table.addColumn(column, columnName);
}
}
示例9: processColumnSort
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void processColumnSort(DataGrid<T> table, Column<?,?> column,
Comparator<T> comparator, Boolean isSortAscending) {
if (comparator != null) {
comparators.put(column, comparator);
column.setSortable(true);
if (isSortAscending != null) {
ColumnSortList.ColumnSortInfo sortInfo = new ColumnSortList.ColumnSortInfo(column, isSortAscending.booleanValue());
ColumnSortList sortList = table.getColumnSortList();
sortList.insert(sortList.size(), sortInfo);
}
}
}
示例10: addColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private <C, S> void addColumn(String header, Comparator<PacketProblem> comparator,
Column<PacketProblem, S> column, FieldUpdater<PacketProblem, S> fieldUpdater) {
if (comparator != null) {
column.setSortable(true);
columnSortHandler.setComparator(column, comparator);
}
if (fieldUpdater != null) {
column.setFieldUpdater(fieldUpdater);
}
addColumn(column, header);
}
示例11: createTypeColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的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;
}
示例12: createContextColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private Column<Notification, String> createContextColumn() {
final Cell<String> contextCell = new TextCell();
final Column<Notification, String> contextColumn = new Column<Notification, String>(contextCell) {
@Override
public String getValue(final Notification object) {
return getNotificationContextMessage(object);
}
};
contextColumn.setSortable(false);
return contextColumn;
}
示例13: createMessageColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private com.google.gwt.user.cellview.client.Column<Notification, String> createMessageColumn() {
final Cell<String> messageCell = new TextCell();
final Column<Notification, String> messageColumn = new Column<Notification, String>(messageCell) {
@Override
public String getValue(final Notification object) {
return getNotificationSourceMessage(object);
}
};
messageColumn.setSortable(false);
return messageColumn;
}
示例14: addPropertyTypeColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void addPropertyTypeColumn() {
Column<ObjectProperty, HyperLinkCell.HyperLink> column = new Column<ObjectProperty, HyperLinkCell.HyperLink>(new HyperLinkCell()) {
@Override
public HyperLinkCell.HyperLink getValue(ObjectProperty objectProperty) {
if (presenter != null && objectProperty.getName() != null) {
final String textValue = presenter.getPropertyTypeDisplayValue(objectProperty);
if (presenter.isSelectablePropertyType(objectProperty)) {
return HyperLinkCell.HyperLink.newLink(textValue);
} else {
return HyperLinkCell.HyperLink.newText(textValue);
}
} else {
return HyperLinkCell.HyperLink.newText("");
}
}
};
column.setFieldUpdater((index, objectProperty, value) -> {
if (presenter != null && presenter.isSelectablePropertyType(objectProperty)) {
presenter.onSelectPropertyType(objectProperty);
}
});
column.setSortable(true);
propertiesTable.addColumn(column,
Constants.INSTANCE.objectBrowser_columnType());
propertiesTable.setColumnWidth(column,
35,
Style.Unit.PCT);
columnIds.put(column,
ColumnId.TYPE_COLUMN);
}
示例15: addAliasColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
protected void addAliasColumn(CellTable<SslKeyStoreEntry> cellTable, String columnHeaderName) {
Column<SslKeyStoreEntry, String> aliasColumn = new Column<SslKeyStoreEntry, String>(new TextCell()) {
@Override
public String getValue(SslKeyStoreEntry keyItem) {
return keyItem.getAlias();
}
};
aliasColumn.setSortable(true);
cellTable.addColumn(aliasColumn, columnHeaderName);
cellTable.setColumnWidth(aliasColumn, 50, Style.Unit.PCT);
}