本文整理匯總了Java中com.google.gwt.user.cellview.client.Column.setFieldUpdater方法的典型用法代碼示例。如果您正苦於以下問題:Java Column.setFieldUpdater方法的具體用法?Java Column.setFieldUpdater怎麽用?Java Column.setFieldUpdater使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.cellview.client.Column
的用法示例。
在下文中一共展示了Column.setFieldUpdater方法的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: addColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
/**
* Add a column with a header.
*
* @param <C> the cell type
* @param cell the cell used to render the column
* @param headerText the header string
* @param getter the value getter for the cell
*/
private <C> Column<MailItem, C> addColumn(com.google.gwt.cell.client.Cell<C> cell,
String headerText,
final GetValue<C> getter,
FieldUpdater<MailItem, C> fieldUpdater) {
Column<MailItem, C> column = new Column<MailItem, C>(cell) {
@Override
public C getValue(MailItem object) {
return getter.getValue(object);
}
};
column.setFieldUpdater(fieldUpdater);
list.addColumn(column,
headerText);
return column;
}
示例5: addColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
/**
* Add a column with a header.
*
* @param <C> the cell type
* @param cell the cell used to render the column
* @param headerText the header string
* @param getter the value getter for the cell
*/
private <C> Column<UserBean, C> addColumn(Cell<C> cell,
String headerText,
final GetValue<C> getter,
FieldUpdater<UserBean, C> fieldUpdater) {
Column<UserBean, C> column = new Column<UserBean, C>(cell) {
@Override
public C getValue(UserBean object) {
return getter.getValue(object);
}
};
column.setFieldUpdater(fieldUpdater);
grid.addColumn(column,
headerText);
return column;
}
示例6: 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);
}
示例7: constructBooleanColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
protected float constructBooleanColumn(DataGrid<T> table, String title,
final BooleanValueProvider<T> valueProvider,
Comparator<T> comparator, Boolean isSortAscending, float prefWidth) {
Header<SafeHtml> header = new SafeHtmlHeader(
SafeHtmlUtils.fromSafeConstant(title));
Column<T, Boolean> column = new Column<T, Boolean>(new UneditableCheckboxCell()) {
@Override
public Boolean getValue(T item) {
return valueProvider.getValue(item);
}
};
column.setFieldUpdater(new FieldUpdater<T,Boolean>() {
@Override
public void update(int index, T object, Boolean value) {
onRowClicked(getObjectId(object));
}
});
table.addColumn(column, header);
table.setColumnWidth(column, prefWidth, Unit.PX);
processColumnSort(table, column, comparator, isSortAscending);
return prefWidth;
}
示例8: addColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
/**
* Add a column with a header.
*
* @param <C> the cell type
* @param cell the cell used to render the column
* @param headerText the header string
* @param getter the value getter for the cell
*/
@ShowcaseSource
private <C> Column<ContactInfo, C> addColumn(Cell<C> cell, String headerText,
final GetValue<C> getter, FieldUpdater<ContactInfo, C> fieldUpdater) {
Column<ContactInfo, C> column = new Column<ContactInfo, C>(cell) {
@Override
public C getValue(ContactInfo object) {
return getter.getValue(object);
}
};
column.setFieldUpdater(fieldUpdater);
if (cell instanceof AbstractEditableCell<?, ?>) {
editableCells.add((AbstractEditableCell<?, ?>) cell);
}
contactList.addColumn(column, headerText);
return column;
}
示例9: addDeleteColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void addDeleteColumn() {
final ButtonCell deleteCell = new ButtonCell( ButtonType.DANGER, IconType.TRASH );
final Column<WorkItemHandlerModel, String> column = new Column<WorkItemHandlerModel, String>( deleteCell ) {
@Override
public String getValue( WorkItemHandlerModel object ) {
return "";
}
};
column.setFieldUpdater( new FieldUpdater<WorkItemHandlerModel, String>() {
@Override
public void update( int index,
WorkItemHandlerModel model,
String value ) {
presenter.onDelete( model );
}
} );
column.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
dataGrid.addColumn( column,
CommonConstants.INSTANCE.Delete() );
dataGrid.setColumnWidth( column,
60,
Style.Unit.PX );
}
示例10: addTypeColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void addTypeColumn() {
Column<ListenerModel, String> column = new Column<ListenerModel, String>( new EditTextCell() ) {
@Override
public String getValue( ListenerModel listenerModel ) {
return listenerModel.getType();
}
};
column.setFieldUpdater( new FieldUpdater<ListenerModel, String>() {
@Override
public void update( int index,
ListenerModel model,
String value ) {
model.setType( value );
}
} );
dataGrid.addColumn( column,
ProjectEditorResources.CONSTANTS.Type() );
}
示例11: setUpClockColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void setUpClockColumn() {
ArrayList<String> options = new ArrayList<String>();
options.add( ProjectEditorResources.CONSTANTS.Realtime() );
options.add( ProjectEditorResources.CONSTANTS.Pseudo() );
Column<KSessionModel, String> column = new Column<KSessionModel, String>( new SelectionCell( options ) ) {
@Override
public String getValue( KSessionModel kSessionModel ) {
if ( kSessionModel.getClockType().equals( ClockTypeOption.PSEUDO ) ) {
return ProjectEditorResources.CONSTANTS.Pseudo();
} else if ( kSessionModel.getClockType().equals( ClockTypeOption.REALTIME ) ) {
return ProjectEditorResources.CONSTANTS.Realtime();
} else {
return kSessionModel.getClockType().toString();
}
}
};
column.setFieldUpdater( new FieldUpdater<KSessionModel, String>() {
@Override
public void update( int index,
KSessionModel model,
String value ) {
if ( value.equals( ProjectEditorResources.CONSTANTS.Pseudo() ) ) {
model.setClockType( ClockTypeOption.PSEUDO );
} else {
model.setClockType( ClockTypeOption.REALTIME );
}
}
} );
dataGrid.addColumn( column,
ProjectEditorResources.CONSTANTS.Clock() );
dataGrid.setColumnWidth( column,
60,
Style.Unit.PCT );
}
示例12: addPropertyNameColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void addPropertyNameColumn() {
Column<PropertyRow, String> column = new Column<PropertyRow, String>( new EditTextCell() ) {
@Override
public String getValue( PropertyRow propertyRow ) {
if ( propertyRow.getName() != null ) {
return propertyRow.getName();
} else {
return "";
}
}
};
column.setFieldUpdater( new PropertyNameFieldUpdater<PropertyRow, String>( (EditTextCell) column.getCell() ) );
dataGrid.addColumn( column,
Constants.INSTANCE.persistence_unit_property_grid_property_name_column() );
dataGrid.setColumnWidth( column, 45, Style.Unit.PCT );
}
示例13: addPropertyValueColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void addPropertyValueColumn() {
final Column<PropertyRow, String> column = new Column<PropertyRow, String>( new EditTextCell() ) {
@Override
public String getValue( PropertyRow propertyRow ) {
if ( propertyRow.getValue() != null ) {
return propertyRow.getValue();
} else {
return "";
}
}
};
column.setFieldUpdater( new PropertyValueFieldUpdater<PropertyRow, String>( (EditTextCell) column.getCell() ) );
dataGrid.addColumn( column,
Constants.INSTANCE.persistence_unit_property_grid_property_value_column() );
dataGrid.setColumnWidth( column, 45, Style.Unit.PCT );
}
示例14: addRemoveRowColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void addRemoveRowColumn() {
ButtonCell buttonCell = new ButtonCell(IconType.TRASH,
ButtonType.DANGER,
ButtonSize.SMALL);
Column<ContainerConfig, String> column = new Column<ContainerConfig, String>(buttonCell) {
@Override
public String getValue(ContainerConfig containerConfig) {
return translationService.getTranslation(ContainerConfigParamsView_Delete);
}
};
column.setFieldUpdater((index, containerConfig, value) -> presenter.onDeleteContainer(containerConfig));
dataGrid.addColumn(column,
"");
dataGrid.setColumnWidth(column,
90,
Style.Unit.PX);
}
示例15: addParamValueColumn
import com.google.gwt.user.cellview.client.Column; //導入方法依賴的package包/類
private void addParamValueColumn() {
final Column<TemplateParam, String> column = new Column<TemplateParam, String>(new EditTextCell()) {
@Override
public String getValue(TemplateParam templateParam) {
if (templateParam.getValue() != null) {
return templateParam.getValue();
} else {
return EMPTY_STRING;
}
}
};
column.setFieldUpdater(new ParamValueFieldUpdater((EditTextCell) column.getCell()));
dataGrid.addColumn(column,
translationService.getTranslation(TemplateParamsTableView_ParamValueColumn));
dataGrid.setColumnWidth(column,
55,
Style.Unit.PCT);
}