• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ListHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setupTable

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的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));
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:27,代码来源:HistoryPopup.java


示例2: addTableColumns

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addTableColumns() {
	
    table.setWidth("100%");
    table.setPageSize(10);
    table.addStyleName("gwt-CellTable");
    table.addStyleName("spaced-vert");
    table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
	table.setSelectionModel(new NoSelectionModel<ControlledVocabularyTermLink>(keyProvider));
    
	
	table.addColumn(new NameColumn(), "Linked Term");
	table.addColumn(new DomainColumn(), "Domain");
	table.addColumn(new ContextColumn(), "Context");
	table.addColumn(new SourceColumn(), "Source");
	table.addColumn(new UsageColumn(), "Usage");
		
	ListHandler<ControlledVocabularyTermLink> sortHandler 
			= new ListHandler<ControlledVocabularyTermLink>(dataProvider.getList());
	for(int i = 1; i < table.getColumnCount(); i++) {
		Column<ControlledVocabularyTermLink, ?> column = table.getColumn(i);
		if(column.isSortable() && column instanceof Comparator<?>) {
			sortHandler.setComparator(column, (Comparator<ControlledVocabularyTermLink>)column);
		}
	}
			
	table.addColumnSortHandler(sortHandler);
	table.getColumnSortList().push(table.getColumn(table.getColumnCount()-1));
	// Second time to reverse sort order
	table.getColumnSortList().push(table.getColumn(table.getColumnCount()-1));
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:32,代码来源:ControlledVocabularyTermLinksView.java


示例3: initTable

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
private void initTable() {
    ListHandler<MetadataEnumeration> sortHandler =
        new ListHandler<MetadataEnumeration>(listProvider.getList());

    table.addColumnSortHandler(sortHandler);
    table.setEmptyTableWidget(new Label("No Authors found.."));
    
    this.metacompare = new Comparator<MetadataEnumeration>() {
      @Override
      public int compare(MetadataEnumeration e1, MetadataEnumeration e2) {
        if(e1.getLabel() != null && e2.getLabel() != null)
          return e1.getLabel().compareToIgnoreCase(e2.getLabel());
        return 0;
      }
    };
    
    // Name Column
    TextColumn<MetadataEnumeration> namecol = 
        new TextColumn<MetadataEnumeration>() {
      @Override
      public String getValue(MetadataEnumeration menum) {
        return menum.getLabel();
      }
    };
    table.addColumn(namecol, "Author Name");
    namecol.setSortable(true);
    sortHandler.setComparator(namecol, this.metacompare);
    table.getColumnSortList().push(namecol);    
    
    listProvider.addDataDisplay(table);
    pager.setDisplay(table);
}
 
开发者ID:KnowledgeCaptureAndDiscovery,项目名称:ontosoft,代码行数:33,代码来源:CommunityView.java


示例4: initializeColumns

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
/**
 * Defines the columns in the custom table. Maps the data in the
 * PasswordCard for each row into the appropriate column in the table, and
 * defines handlers for each column.
 */
private void initializeColumns(ListHandler<PasswordCard> sortHandler) {

	// Title.
	titleColumn = new Column<PasswordCard, String>(new TextCell()) {
		@Override
		public String getValue(PasswordCard object) {
			return object.getTitre();
		}
	};
	titleColumn.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
	titleColumn.setSortable(true);
	sortHandler.setComparator(titleColumn, new Comparator<PasswordCard>() {
		@Override
		public int compare(PasswordCard o1, PasswordCard o2) {
			return o1.getTitre().compareTo(o2.getTitre());
		}
	});
	titleColumn.setFieldUpdater(new FieldUpdater<PasswordCard, String>() {
		@Override
		public void update(int index, PasswordCard object, String value) {
			// Called when the user changes the value.
			object.setTitre(value);
			dataProvider.refresh();
		}
	});
	dataGrid.setColumnWidth(0, 25, Unit.PCT);

}
 
开发者ID:guiguib,项目名称:yaph,代码行数:34,代码来源:PasswordView.java


示例5: seedData

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
protected void seedData(Set<Payment> schedule) {
	resetTableColumns();
	
	// Attach a column sort handler to the ListDataProvider to sort the
	// list.
	data = new ListHandler<Payment>(new ArrayList<Payment>(schedule));
	loanResults.addColumnSortHandler(data);
	loanResults.setRowData(data.getList());
	
	// Initialize the columns.
	initTableColumns(data);
	
}
 
开发者ID:fastnsilver,项目名称:fns-projects,代码行数:14,代码来源:LoanMainViewImpl.java


示例6: SampleListView

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
public SampleListView(List<ShowcaseSampleDefinition> data, final SampleOverviewPage overviewPage) {
	initWidget(UIBINDER.createAndBindUi(this));
	ProvidesKey<ShowcaseSampleDefinition> sampleKeyProvider = new ProvidesKey<ShowcaseSampleDefinition>() {

		public Object getKey(ShowcaseSampleDefinition item) {
			return item.getTitle();
		}
	};

	// We fill the grid through a list of SamplePanelFactory objects:
	dataProvider = new ListDataProvider<ShowcaseSampleDefinition>(sampleKeyProvider);
	dataProvider.addDataDisplay(grid);

	// Selection: show sample on click
	final SingleSelectionModel<ShowcaseSampleDefinition> selectionModel;
	selectionModel = new SingleSelectionModel<ShowcaseSampleDefinition>(sampleKeyProvider);
	grid.setSelectionModel(selectionModel);
	selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {

		public void onSelectionChange(SelectionChangeEvent event) {
			ExampleBase.showSample(selectionModel.getSelectedObject());
		}
	});

	// Add a sort handler:
	sortHandler = new ListHandler<ShowcaseSampleDefinition>(dataProvider.getList());
	grid.addColumnSortHandler(sortHandler);

	// Initialize the grid columns:
	initColumns();

	// Apply the entire data-set:
	setData(data);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:35,代码来源:SampleListView.java


示例7: setup

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
public void setup(AbstractDataProvider<T> dataProvider, SelectionModel<? super T> selectionModel, SimplePager simplePager,
        ListHandler<T> sortHandler) {
    if (dataProvider != null) {
        dataProvider.addDataDisplay(this);
    }
    if (selectionModel != null) {
        setSelectionModel(selectionModel);
    }
    if (simplePager != null) {
        simplePager.setDisplay(this);
    }
    if (sortHandler != null) {
        addColumnSortHandler(sortHandler);
    }
}
 
开发者ID:rkfg,项目名称:gwtutil,代码行数:16,代码来源:ResizableDataGrid.java


示例8: CsvTable

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
public CsvTable(String csv, int data_offset, boolean sortable) {
	this.data = Util.parseCSVTable(csv);
	this.data_offset = data_offset;
	this.sortable = sortable;
	this.table = new DataGrid<String[]>();

	table.setStylePrimaryName("DataTable");
	//table.setTableLayoutFixed(true);

	List<String[]> datalist = Arrays.asList(data);

	// Strip out header
	datalist = datalist.subList(data_offset, datalist.size());

	this.ldp = new ListDataProvider<String[]>(datalist);

	ldp.addDataDisplay(table);

	table.setRowCount(ldp.getList().size(), true);
	table.setVisibleRange(0, ldp.getList().size());

	// TODO: Hack to make sure display is refreshed after sorting

	this.sorthandler = new ListHandler<String[]>(datalist) {
		public void onColumnSort(ColumnSortEvent event) {
			super.onColumnSort(event);
			ldp.refresh();
		}
	};

	table.addColumnSortHandler(sorthandler);

	initWidget(table);
}
 
开发者ID:jhu-digital-manuscripts,项目名称:rosa,代码行数:35,代码来源:CsvTable.java


示例9: getSortHandler

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
public ListHandler<JavaScriptObject> getSortHandler() {
	return sortHandler;
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:4,代码来源:ModelGrid.java


示例10: PasswordView

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
public PasswordView() {

		// Create a DataGrid.

		/*
		 * Set a key provider that provides a unique key for each PasswordCard.
		 * If key is used to identify PasswordCard when fields (such as the url
		 * and login) change.
		 */
		ProvidesKey<PasswordCard> KEY_PROVIDER = new ProvidesKey<PasswordCard>() {
			@Override
			public Object getKey(PasswordCard item) {
				return item == null ? null : item.getId();
			}
		};

		dataGrid = new DataGrid<PasswordCard>(20, tableRes, KEY_PROVIDER);
		dataGrid.setWidth("100%");

		/*
		 * Do not refresh the headers every time the data is updated. The footer
		 * depends on the current data, so we do not disable auto refresh on the
		 * footer.
		 */
		dataGrid.setAutoHeaderRefreshDisabled(true);

		// Set the message to display when the table is empty.
		dataGrid.setEmptyTableWidget(new Label("Vide"));

		// Attach a column sort handler to the ListDataProvider to sort the
		// list.
		dataProvider = new ListDataProvider<PasswordCard>();
		ListHandler<PasswordCard> sortHandler = new ListHandler<PasswordCard>(dataProvider.getList());
		dataGrid.addColumnSortHandler(sortHandler);

		// Create a Pager to control the table.
		SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
		pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true);
		pager.setDisplay(dataGrid);

		// Add a selection model so we can select cells.
		final NoSelectionModel<PasswordCard> selectionModel = new NoSelectionModel<PasswordCard>();
		selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
			@Override
			public void onSelectionChange(SelectionChangeEvent event) {
				// final PasswordCard passwordCard =
				// selectionModel.getLastSelectedObject();

			}
		});

		dataGrid.setSelectionModel(selectionModel);

		/*
		 * final SelectionModel<PasswordCard> selectionModel = new
		 * MultiSelectionModel<PasswordCard>( KEY_PROVIDER);
		 */
		/*
		 * dataGrid.setSelectionModel(selectionModel,
		 * DefaultSelectionEventManager .<PasswordCard>
		 * createCheckboxManager());
		 */

		// Initialize the columns.
		initializeColumns(sortHandler);

		// Specify a custom table.
		dataGrid.setTableBuilder(new CustomTableBuilder());
		dataGrid.setHeaderBuilder(new CustomHeaderBuilder());
		dataGrid.setFooterBuilder(new CustomFooterBuilder());

		// Add the CellList to the adapter in the database.
		dataProvider.addDataDisplay(dataGrid);

		initWidget(uiBinder.createAndBindUi(this));
	}
 
开发者ID:guiguib,项目名称:yaph,代码行数:77,代码来源:PasswordView.java


示例11: createColumnSortHandler

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
protected ListHandler<M> createColumnSortHandler(Column<M, ?> column, Comparator<M> comparator)
{
   ListHandler<M> columnSortHandler = new ListHandler<M>(dataProvider.getList());
   columnSortHandler.setComparator(column, comparator);
   return columnSortHandler;
}
 
开发者ID:symulakr,项目名称:generators-example,代码行数:7,代码来源:CustomCellTable.java


示例12: getSortHandler

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
public ListHandler<T> getSortHandler() {
    return sortHandler;
}
 
开发者ID:rkfg,项目名称:gwtutil,代码行数:4,代码来源:CompleteResizableDataGrid.java


示例13: onInitialize

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  resources = GWT.create(Resources.class);
  resources.styles().ensureInjected();

  // Create a DataGrid.

  /*
   * Set a key provider that provides a unique key for each contact. If key is
   * used to identify contacts when fields (such as the name and address)
   * change.
   */
  dataGrid = new DataGrid<ContactInfo>(ContactDatabase.ContactInfo.KEY_PROVIDER);
  dataGrid.setWidth("100%");

  /*
   * Do not refresh the headers every time the data is updated. The footer
   * depends on the current data, so we do not disable auto refresh on the
   * footer.
   */
  dataGrid.setAutoHeaderRefreshDisabled(true);

  // Set the message to display when the table is empty.
  dataGrid.setEmptyTableWidget(new Label(constants.cwCustomDataGridEmpty()));

  // Attach a column sort handler to the ListDataProvider to sort the list.
  ListHandler<ContactInfo> sortHandler =
      new ListHandler<ContactInfo>(ContactDatabase.get().getDataProvider().getList());
  dataGrid.addColumnSortHandler(sortHandler);

  // Create a Pager to control the table.
  SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
  pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true);
  pager.setDisplay(dataGrid);

  // Add a selection model so we can select cells.
  final SelectionModel<ContactInfo> selectionModel =
      new MultiSelectionModel<ContactInfo>(ContactDatabase.ContactInfo.KEY_PROVIDER);
  dataGrid.setSelectionModel(selectionModel, DefaultSelectionEventManager
      .<ContactInfo> createCheckboxManager());

  // Initialize the columns.
  initializeColumns(sortHandler);

  // Specify a custom table.
  dataGrid.setTableBuilder(new CustomTableBuilder());
  dataGrid.setHeaderBuilder(new CustomHeaderBuilder());
  dataGrid.setFooterBuilder(new CustomFooterBuilder());

  // Add the CellList to the adapter in the database.
  ContactDatabase.get().addDataDisplay(dataGrid);

  // Create the UiBinder.
  Binder uiBinder = GWT.create(Binder.class);
  return uiBinder.createAndBindUi(this);
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:61,代码来源:CwCustomDataGrid.java


示例14: onInitialize

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a CellTable.

  // Set a key provider that provides a unique key for each contact. If key is
  // used to identify contacts when fields (such as the name and address)
  // change.
  cellTable = new CellTable<ContactInfo>(
      ContactDatabase.ContactInfo.KEY_PROVIDER);
  cellTable.setWidth("100%", true);

  // Do not refresh the headers and footers every time the data is updated.
  cellTable.setAutoHeaderRefreshDisabled(true);
  cellTable.setAutoFooterRefreshDisabled(true);

  // Attach a column sort handler to the ListDataProvider to sort the list.
  ListHandler<ContactInfo> sortHandler = new ListHandler<ContactInfo>(
      ContactDatabase.get().getDataProvider().getList());
  cellTable.addColumnSortHandler(sortHandler);

  // Create a Pager to control the table.
  SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
  pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true);
  pager.setDisplay(cellTable);

  // Add a selection model so we can select cells.
  final SelectionModel<ContactInfo> selectionModel = new MultiSelectionModel<ContactInfo>(
      ContactDatabase.ContactInfo.KEY_PROVIDER);
  cellTable.setSelectionModel(selectionModel,
      DefaultSelectionEventManager.<ContactInfo> createCheckboxManager());

  // Initialize the columns.
  initTableColumns(selectionModel, sortHandler);

  // Add the CellList to the adapter in the database.
  ContactDatabase.get().addDataDisplay(cellTable);

  // Create the UiBinder.
  Binder uiBinder = GWT.create(Binder.class);
  Widget widget = uiBinder.createAndBindUi(this);

  return widget;
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:48,代码来源:CwCellTable.java


示例15: onInitialize

import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; //导入依赖的package包/类
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a DataGrid.

  /*
   * Set a key provider that provides a unique key for each contact. If key is
   * used to identify contacts when fields (such as the name and address)
   * change.
   */
  dataGrid = new DataGrid<ContactInfo>(ContactDatabase.ContactInfo.KEY_PROVIDER);
  dataGrid.setWidth("100%");

  /*
   * Do not refresh the headers every time the data is updated. The footer
   * depends on the current data, so we do not disable auto refresh on the
   * footer.
   */
  dataGrid.setAutoHeaderRefreshDisabled(true);

  // Set the message to display when the table is empty.
  dataGrid.setEmptyTableWidget(new Label(constants.cwDataGridEmpty()));

  // Attach a column sort handler to the ListDataProvider to sort the list.
  ListHandler<ContactInfo> sortHandler =
      new ListHandler<ContactInfo>(ContactDatabase.get().getDataProvider().getList());
  dataGrid.addColumnSortHandler(sortHandler);

  // Create a Pager to control the table.
  SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
  pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true);
  pager.setDisplay(dataGrid);

  // Add a selection model so we can select cells.
  final SelectionModel<ContactInfo> selectionModel =
      new MultiSelectionModel<ContactInfo>(ContactDatabase.ContactInfo.KEY_PROVIDER);
  dataGrid.setSelectionModel(selectionModel, DefaultSelectionEventManager
      .<ContactInfo> createCheckboxManager());

  // Initialize the columns.
  initTableColumns(selectionModel, sortHandler);

  // Add the CellList to the adapter in the database.
  ContactDatabase.get().addDataDisplay(dataGrid);

  // Create the UiBinder.
  Binder uiBinder = GWT.create(Binder.class);
  return uiBinder.createAndBindUi(this);
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:53,代码来源:CwDataGrid.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DistributionPointName类代码示例发布时间:2022-05-21
下一篇:
Java XRSurfaceData类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap