当前位置: 首页>>代码示例>>Java>>正文


Java FieldUpdater类代码示例

本文整理汇总了Java中com.google.gwt.cell.client.FieldUpdater的典型用法代码示例。如果您正苦于以下问题:Java FieldUpdater类的具体用法?Java FieldUpdater怎么用?Java FieldUpdater使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FieldUpdater类属于com.google.gwt.cell.client包,在下文中一共展示了FieldUpdater类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addDeleteColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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 );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:26,代码来源:ListenersPanelViewImpl.java

示例2: addKindColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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() );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:40,代码来源:ListenersPanelViewImpl.java

示例3: setupAnalyzeResultDisplayPanel

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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);
		}
	});
}
 
开发者ID:dpinney,项目名称:essence,代码行数:22,代码来源:AnalyzerAndReportUI.java

示例4: addTableColumns

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的package包/类
@Override
protected void addTableColumns(CellTable<Synonym> table) {
	SynonymColumn synonymColumn = new SynonymColumn();
	
	synonymColumn.setFieldUpdater(new FieldUpdater<Synonym, String>() {
		@Override
		public void update(int index, Synonym synonym, String value) {
			ControlledVocabularyTerm term = synonym.getControlledVocabularyTerm();
			if(term != null) {
				linkedTermsView.show(term);
			}
		}
	});
	synonymColumn.setCellStyleNames("clickable-text");
	
    table.addColumn(new OntologyColumn(), "Ontology/Codelist");
    table.addColumn(new TermColumn(), "Term");
    table.addColumn(synonymColumn, "Synonym");
    table.addColumn(new TypeColumn(), "Type");
    table.addColumn(new SourceColumn(), "Source");
    table.addColumn(new UsageColumn(), "Usage");
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:23,代码来源:ApproveRejectSynonymComposite.java

示例5: addColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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;
}
 
开发者ID:mvp4g,项目名称:mvp4g-examples,代码行数:24,代码来源:MailListView.java

示例6: addColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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;
}
 
开发者ID:mvp4g,项目名称:mvp4g-examples,代码行数:24,代码来源:UserListView.java

示例7: createColumns

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:26,代码来源:ApplicationReferencesList.java

示例8: constructBooleanColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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;
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:23,代码来源:AbstractGrid.java

示例9: TextBoxTableColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的package包/类
public TextBoxTableColumn(String key) {
    super(new TextInputCell());
    this.key = key;

    this.setFieldUpdater(new FieldUpdater<AssistedObject, String>() {

        @Override
        public void update(int index, AssistedObject ao, String value) {
            List<String> ids = SharedUtil.listFromDotSeparated(TextBoxTableColumn.this.key);
            handlerFactory
                .createHandler(ao)
                .getRelatedKVOMultiLevel(ids)
                .setUnchecked(ids.get(ids.size() - 1), value);
        }
    });
}
 
开发者ID:inepex,项目名称:ineform,代码行数:17,代码来源:AbstractIneTable.java

示例10: addColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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;
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:25,代码来源:CwCellSampler.java

示例11: addDeleteColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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 );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:26,代码来源:WorkItemHandlersPanelViewImpl.java

示例12: addTypeColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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() );
    }
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:ListenersPanelViewImpl.java

示例13: setUpClockColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的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 );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:38,代码来源:KSessionsPanelViewImpl.java

示例14: WhiteListColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的package包/类
public WhiteListColumn() {
    super( new WhiteListCell() );

    setFieldUpdater( new FieldUpdater<EnhancedDependency, String>() {
        @Override
        public void update( final int index,
                            final EnhancedDependency dependency,
                            final String value ) {
            final DependencyValidator dependencyValidator = new DependencyValidator( dependency.getDependency() );

            if ( dependencyValidator.validate() ) {
                if ( WhiteListCell.ADD_ALL.equals( value ) ) {
                    presenter.onAddAll( dependency.getPackages() );
                } else if ( WhiteListCell.ADD_NONE.equals( value ) ) {
                    presenter.onRemoveAll( dependency.getPackages() );
                }
            } else {
                showMessage( dependencyValidator.getMessage() );
            }
        }
    } );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:23,代码来源:WhiteListColumn.java

示例15: addColumn

import com.google.gwt.cell.client.FieldUpdater; //导入依赖的package包/类
/**
 * Add a column with a header.
 *
 * @param <C> the cell generator
 * @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<Person, C> addColumn(Cell<C> cell,
                                        String headerText,
                                        final GetValue<C> getter,
                                        FieldUpdater<Person, C> fieldUpdater) {
  Column<Person, C> column = new Column<Person, C>(cell) {
    @Override
    public C getValue(Person object) {
      return getter.getValue(object);
    }
  };
  column.setFieldUpdater(fieldUpdater);
  resultTable.addColumn(column, headerText);
  return column;
}
 
开发者ID:mvp4g,项目名称:mvp4g2-examples,代码行数:23,代码来源:ListView.java


注:本文中的com.google.gwt.cell.client.FieldUpdater类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。