本文整理匯總了Java中com.google.gwt.user.cellview.client.Column類的典型用法代碼示例。如果您正苦於以下問題:Java Column類的具體用法?Java Column怎麽用?Java Column使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Column類屬於com.google.gwt.user.cellview.client包,在下文中一共展示了Column類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addDeleteColumn
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
private void addDeleteColumn() {
final ButtonCell deleteCell = new ButtonCell( ButtonType.DANGER, IconType.TRASH );
final Column<ListenerModel, String> column = new Column<ListenerModel, String>( deleteCell ) {
@Override
public String getValue( ListenerModel object ) {
return "";
}
};
column.setFieldUpdater( new FieldUpdater<ListenerModel, String>() {
@Override
public void update( int index,
ListenerModel model,
String value ) {
presenter.onDelete( model );
}
} );
column.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
dataGrid.addColumn( column,
CommonConstants.INSTANCE.Delete() );
dataGrid.setColumnWidth( column,
60,
Style.Unit.PX );
}
示例2: addKindColumn
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
private void addKindColumn() {
ArrayList<String> options = new ArrayList<String>();
options.add(RULE_RUNTIME_EVENT_LISTENER);
options.add( AGENDA_EVENT_LISTENER );
options.add( PROCESS_EVENT_LISTENER );
Column<ListenerModel, String> column = new Column<ListenerModel, String>( new SelectionCell( options ) ) {
@Override
public String getValue( ListenerModel listenerModel ) {
if ( listenerModel.getKind() == null || listenerModel.getKind().equals( ListenerModel.Kind.RULE_RUNTIME_EVENT_LISTENER) ) {
return RULE_RUNTIME_EVENT_LISTENER;
} else if ( listenerModel.getKind().equals( ListenerModel.Kind.PROCESS_EVENT_LISTENER ) ) {
return PROCESS_EVENT_LISTENER;
} else if ( listenerModel.getKind().equals( ListenerModel.Kind.AGENDA_EVENT_LISTENER ) ) {
return AGENDA_EVENT_LISTENER;
} else {
return listenerModel.getKind().toString();
}
}
};
column.setFieldUpdater( new FieldUpdater<ListenerModel, String>() {
@Override
public void update( int index,
ListenerModel model,
String value ) {
if ( value.equals(RULE_RUNTIME_EVENT_LISTENER) ) {
model.setKind( ListenerModel.Kind.RULE_RUNTIME_EVENT_LISTENER);
} else if ( value.equals( PROCESS_EVENT_LISTENER ) ) {
model.setKind( ListenerModel.Kind.PROCESS_EVENT_LISTENER );
} else if ( value.equals( AGENDA_EVENT_LISTENER ) ) {
model.setKind( ListenerModel.Kind.AGENDA_EVENT_LISTENER );
}
}
} );
dataGrid.addColumn( column,
ProjectEditorResources.CONSTANTS.Kind() );
}
示例3: setupAnalyzeResultDisplayPanel
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
private void setupAnalyzeResultDisplayPanel(CellTable<AnalyzerResultDTO> table,
final ListDataProvider<AnalyzerResultDTO> dataProvider) {
final ClickableTextCellRuleID clickableIDcell = new ClickableTextCellRuleID();
Column<AnalyzerResultDTO,String> ruleIDColumn = new Column<AnalyzerResultDTO,String>(clickableIDcell) {
@Override
public String getValue (AnalyzerResultDTO dr) {
if (dr.getRefRuleId() == null)
return "none";
else
return dr.getRefRuleId().toString();
}
};
table.addColumn(ruleIDColumn, "Ref Rule ID");
table.addColumnStyleName(2, "ar_number_column_style");
ruleIDColumn.setFieldUpdater(new FieldUpdater<AnalyzerResultDTO,String> () {
public void update(int index, AnalyzerResultDTO ar, String value) {
showRuleDetailDialog(ar);
}
});
}
示例4: setupTable
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
@SuppressWarnings("unchecked")
protected void setupTable() {
table.setWidth("100%");
table.addStyleName("gwt-CellTable");
table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
table.setSelectionModel(new NoSelectionModel<CuratorAction>(keyProvider));
table.addColumn(new ActionDateColumn(), "Date");
table.addColumn(new CuratorColumn(), "Curator");
table.addColumn(new ActionColumn(), "Action");
table.addColumn(new EntityColumn(), "Entity");
table.addColumn(new OntologyColumn(), "Ontology/Codelist");
table.addColumn(new TermColumn(), "Term");
table.addColumn(new EntityValueColumn(), "Relationship/Synonym");
table.addColumn(new CommentsColumn(), "Comments");
ListHandler<CuratorAction> sortHandler = new ListHandler<CuratorAction>(dataProvider.getList());
for(int i = 0; i < table.getColumnCount(); i++) {
Column<CuratorAction, ?> column = table.getColumn(i);
if(column.isSortable() && column instanceof Comparator<?>) {
sortHandler.setComparator(column, (Comparator<CuratorAction>)column);
}
}
table.addColumnSortHandler(sortHandler);
table.getColumnSortList().push(table.getColumn(0));
}
示例5: setupTable
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
private void setupTable() {
Column<Relationship, Boolean> checkColumn = new Column<Relationship, Boolean>(
new CheckboxCell(true, false)) {
@Override
public Boolean getValue(Relationship object) {
return selection.isSelected(object);
}
};
table.addStyleName("gwt-CellTable");
table.addStyleName("decorator-panel");
table.setWidth("100%");
table.setKeyboardPagingPolicy(KeyboardPagingPolicy.CURRENT_PAGE);
table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
table.addColumn(checkColumn);
table.setColumnWidth(checkColumn, 16, Unit.PX);
table.addColumn(new RelationshipColumn(), "Relationship");
table.addColumn(new RelatedTermColumn(), "Related Term");
table.addColumn(new StatusColumn(), "Status");
table.setSelectionModel(selection,
DefaultSelectionEventManager.<Relationship>createCheckboxManager(0));
}
示例6: addApproveColumn
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
private void addApproveColumn() {
int rejectColumnIndex = -1;
for(int i = 0; i < table.getColumnCount(); i++) {
Column<T, ?> column = table.getColumn(i);
if(column instanceof ApproveRejectComposite<?>.ApprovedByColumn) {
return;
}
if(column instanceof ApproveRejectComposite<?>.RejectedByColumn) {
rejectColumnIndex = i;
}
}
if(rejectColumnIndex >= 0) {
table.insertColumn(rejectColumnIndex, new ApprovedByColumn(),
"Approved By");
} else if(curator != null) {
table.insertColumn(table.getColumnCount() - 2, new ApprovedByColumn(),
"Approved By");
} else {
table.addColumn(new ApprovedByColumn(), "Approved By");
}
}
示例7: refreshColumns
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private void refreshColumns() {
for (int i = 0; i < treeGrid.getColumnCount(); i++) {
treeGrid.removeColumn(i);
header.removeColumn(i);
}
for (Entry<Integer, Column<T, ?>> kv : columns.entrySet()) {
if (kv.getValue() instanceof ExpandableColumn) {
treeGrid.addExpandableColumn((ExpandableColumn<T>) kv
.getValue());
header.addColumn(kv.getValue(), columnNames.get(kv.getValue()));
} else {
treeGrid.addColumn(kv.getValue());
header.addColumn(kv.getValue(), columnNames.get(kv.getValue()));
}
}
}
示例8: DomainList
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
public DomainList() {
table = new CellTable<>(15, (Resources) GWT.create(TableResources.class));
table.addColumn( new Column<String,SafeHtml>(new SafeHtmlCell() ) {
@Override
public SafeHtml getValue(String domain) {
return new LinkHtml( domain, "javascript:selectDomain(\"" + domain + "\")" ); };
}, "Domain");
dataProvider = new ListDataProvider<String>();
dataProvider.addDataDisplay( table );
SimplePager pager = new SimplePager();
pager.setDisplay( table );
table.setWidth("100%");
tablePanel.add( table );
tablePanel.add( pager );
tablePanel.setWidth("100%");
}
示例9: updateColumnSortList
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
/**
* Update list of sorted columns.
*
* @param columnSortList Table {@code ColumnSortList}.
* @param ordering Ordering criteria.
*/
private void updateColumnSortList(
ColumnSortList columnSortList,
SeriesManager.Ordering ordering) {
Column<?, ?> column;
int by = ordering.getBy();
if (by == SeriesManager.Ordering.BY_COUNTRY_NAME) {
column = CountryNameColumn.get();
} else {
column = YearColumn.get(by);
}
ColumnSortList.ColumnSortInfo columnSortInfo =
new ColumnSortList.ColumnSortInfo(column, ordering.isAscending());
columnSortList.clear();
columnSortList.push(columnSortInfo);
}
示例10: onColumnSort
import com.google.gwt.user.cellview.client.Column; //導入依賴的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));
}
}
示例11: testAddRemoveColumn
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
@Test
public void testAddRemoveColumn() {
final Column column = mock(Column.class);
when(column.getDataStoreName()).thenReturn("id");
final ColumnMeta meta = new ColumnMeta(column,
"caption");
meta.setHeader(new TextHeader("header"));
columnPicker.addColumn(meta);
assertTrue(columnPicker.getColumnMetaList().contains(meta));
verify(dataGrid).addColumn(column,
meta.getHeader());
assertEquals(1,
dataGrid.getColumnCount());
columnPicker.removeColumn(meta);
assertFalse(columnPicker.getColumnMetaList().contains(meta));
verify(dataGrid).removeColumn(0);
assertEquals(0,
dataGrid.getColumnCount());
}
示例12: testSortColumn
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
@Test
public void testSortColumn() {
final Column column1 = mock(Column.class);
final ColumnMeta meta1 = new ColumnMeta(column1,
"caption1",
true,
1);
meta1.setHeader(new TextHeader("header1"));
final Column column0 = mock(Column.class);
final ColumnMeta meta0 = new ColumnMeta(column0,
"caption0",
true,
0);
meta0.setHeader(new TextHeader("header0"));
columnPicker.addColumns(Arrays.asList(meta1,
meta0));
assertEquals(2,
columnPicker.getColumnMetaList().size());
verify(dataGrid).addColumn(column0,
meta0.getHeader());
verify(dataGrid).addColumn(column1,
meta1.getHeader());
assertEquals(2,
dataGrid.getColumnCount());
}
示例13: testColumnPreference
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
@Test
public void testColumnPreference() {
final Column column = mock(Column.class);
when(column.getDataStoreName()).thenReturn("id");
final ColumnMeta meta = new ColumnMeta(column,
"caption");
meta.setHeader(new TextHeader("header"));
columnPicker.addColumn(meta);
final List<GridColumnPreference> columnsState = columnPicker.getColumnsState();
assertEquals(1,
columnsState.size());
final GridColumnPreference preference = columnsState.get(0);
assertEquals(preference.getName(),
column.getDataStoreName());
assertEquals(0,
preference.getPosition().intValue());
}
示例14: testSetColumnWidth
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
@Test
public void testSetColumnWidth() {
final Column column1 = createColumn("col1",
"col1");
final ColumnMeta meta1 = new ColumnMeta(column1,
"caption1",
true,
1);
final Column column2 = createColumn("col2",
"col2");
final ColumnMeta meta2 = new ColumnMeta(column2,
"caption2",
true,
0);
when(dataGrid.getColumnWidth(column1)).thenReturn("38.0px");
columnPicker.addColumns(Lists.newArrayList(meta1,
meta2));
verify(dataGrid).setColumnWidth(eq(column1),
eq("38px"));
}
示例15: getColumnHeader
import com.google.gwt.user.cellview.client.Column; //導入依賴的package包/類
protected ResizableMovableHeader<T> getColumnHeader(final String caption,
final Column column) {
final ResizableMovableHeader header = new ResizableMovableHeader<T>(caption,
dataGrid,
columnPicker,
column) {
@Override
protected int getTableBodyHeight() {
return dataGrid.getOffsetHeight();
}
};
header.addColumnChangedHandler(new ColumnChangedHandler() {
@Override
public void afterColumnChanged() {
afterColumnChangedHandler();
}
@Override
public void beforeColumnChanged() {
}
});
return header;
}