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

Java DefaultSelectionEventManager类代码示例

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

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



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

示例1: setupTable

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


示例2: NotesTable

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的package包/类
public NotesTable() {
        selectionModel = new MultiSelectionModel<Note>();
        table.setSelectionModel(selectionModel, DefaultSelectionEventManager.<Note> createDefaultManager());
        info.setCellStyleNames(AppStyles.NOTE_TEXT);
        list.setCellStyleNames(AppStyles.NOTE_LIST_NAME);
        table.addColumn(info, "Note");
//        table.addColumn(list, "List");
        initWidget(table);
        dataProvider = new ListDataProvider<Note>();
        dataProvider.addDataDisplay(table);

        table.addCellPreviewHandler(new CellPreviewEvent.Handler() {
            @Override
            public void onCellPreview(CellPreviewEvent event) {
                if (BrowserEvents.CLICK.equalsIgnoreCase(event.getNativeEvent().getType())) {
                    selectedColumn = event.getColumn();
                    selectedRow = event.getIndex();
                    //used to prepare double click info
                }
            }
        });
    }
 
开发者ID:turbomanage,项目名称:listmaker,代码行数:23,代码来源:NotesTable.java


示例3: setState

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的package包/类
/**
 * Sets the state of the editor 
 * @param state ENABLED, READONLY, or DISABLED
 * @param selectedType Currently selected region label
 */
public void setState(int state, RegionTypeInfo selectedType) {
	
	if (this.state == state) //No change
		return;
	
	this.state = state;
	cellTemplate.setReadOnly(state != STATE_ENABLED);
	cellList.redraw();
	if (state == STATE_ENABLED)
	    cellList.setSelectionModel(selectionModel, DefaultSelectionEventManager.<RegionTypeInfo>createDefaultManager());
	else if (state == STATE_READONLY)
		cellList.setSelectionModel(new ReadOnlySelectionModel(selectedType, null), DefaultSelectionEventManager.<RegionTypeInfo>createWhitelistManager());
	else //DISABLED
		cellList.setSelectionModel(noSelectionModel, DefaultSelectionEventManager.<RegionTypeInfo>createWhitelistManager());
}
 
开发者ID:PRImA-Research-Lab,项目名称:prima-aletheia-web-emop,代码行数:21,代码来源:SimpleRegionTypeEditor.java


示例4: reloadTable

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的package包/类
private void reloadTable(JSONValue response) {

		List< Pair<JsonRiskAnalysis, Boolean> > results = new ArrayList<>();
		for (int i = 0; i < response.isArray().size(); ++i) {
			JsonRiskAnalysis obj = new JsonRiskAnalysis(response.isArray().get(i));
			Boolean b;
			if (comparison.contains(obj.getID())) b = true;
			else b = false;
			results.add(new Pair<>(obj, b));
		}
		
	    table.setSelectionModel(selectionModel, DefaultSelectionEventManager.<Pair<JsonRiskAnalysis, Boolean>>createBlacklistManager(0));
	    
	    table.setRowData(0, results);
	    
	    dataProvider = new ListDataProvider<Pair<JsonRiskAnalysis, Boolean>>();
		dataProvider.addDataDisplay( table );
		
		for( int i = 0; i < results.size(); i++ ) {
			dataProvider.getList().add( results.get(i) );
		}
		
		SimplePager pager = new SimplePager();
	    pager.setDisplay( table );
	    
	    tablePanel.clear();
		tablePanel.add( table );
		tablePanel.add( pager );
		table.setWidth("100%");
		tablePanel.setWidth("100%");
		panel.setWidth("100%");
		panel.setWidget(tablePanel);
	}
 
开发者ID:RISCOSS,项目名称:riscoss-corporate,代码行数:34,代码来源:RASModule.java


示例5: initWidgets

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的package包/类
@Override
public UserAttributesEditor.View initWidgets(NewUserAttributeEditor.View newUserAttributeEditorView) {
    this.newUserAttributeView = newUserAttributeEditorView;

    // Init the image list grid.
    attributesGrid = new CellTable<Map.Entry<String, String>>(presenter.KEY_PROVIDER);
    attributesGrid.setWidth("100%",
                            true);

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

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

    // Add a selection model so we can select cells.
    final SelectionModel<Map.Entry<String, String>> selectionModel = new MultiSelectionModel<Map.Entry<String, String>>(presenter.KEY_PROVIDER);
    attributesGrid.setSelectionModel(selectionModel,
                                     DefaultSelectionEventManager.<Map.Entry<String, String>>createCheckboxManager());

    presenter.addDataDisplay(attributesGrid);

    // Bind this view and initialize the widget.
    initWidget(uiBinder.createAndBindUi(this));

    return this;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:35,代码来源:UserAttributesEditorView.java


示例6: initTable

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的package包/类
public void initTable() {

        // Create a Pager to control the table.
        if (showPager) {
            pager = PagerCreator.create();
            pager.setDisplay(cellTable);
            if (pagerPos == PagerPosition.BOTH) {
                topPager = PagerCreator.create();
                topPager.setDisplay(cellTable);
            }
        }
        cellTable.setPageSize(pageSize);

        if (selectionBehaviour == SelectionBehaviour.SINGLE_SELECTION) {
            // Add a selection model so that only single selection is available.
            singleSelectionModel = new SingleSelectionModel<AssistedObject>(KEY_PROVIDER);
            cellTable.setSelectionModel(singleSelectionModel);

        } else if (selectionBehaviour == SelectionBehaviour.NO_SELECTION) {
            cellTable.setSelectionModel(new NoSelectionModel<AssistedObject>());
        } else if (selectionBehaviour == SelectionBehaviour.MULTIPLE_SELECTION) {
            multiSelectionModel = new MultiSelectionModel<AssistedObject>(KEY_PROVIDER);
            cellTable.setSelectionModel(
                multiSelectionModel,
                DefaultSelectionEventManager.<AssistedObject> createCheckboxManager());
        }

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

        cellTable.setRowStyles(new PointerAndCustomRowStyleProvider());

        // Set default empty widget
        cellTable.setEmptyTableWidget(new Label(IneFormI18n.inetable_noresult()));
    }
 
开发者ID:inepex,项目名称:ineform,代码行数:36,代码来源:AbstractIneTable.java


示例7: StudentChooserPresenter

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的package包/类
public StudentChooserPresenter(GwtPreferences preferences) {
    this.preferences = preferences;
    initWidget(uiBinder.createAndBindUi(this));
    TextCell textCell = new TextCell();
    studentList = new CellList<String>(textCell);
    selectionModel = new MultiSelectionModel<>();
    studentList.addCellPreviewHandler(new Handler<String>() {
        @Override
        public void onCellPreview(CellPreviewEvent<String> event) {
            if (BrowserEvents.CLICK.equals(event.getNativeEvent().getType())) {
                boolean isSelected = selectionModel.isSelected(event.getValue());
                selectionModel.setSelected(event.getValue(), ! isSelected);
                event.setCanceled(true);
            }
        }
    });
    DefaultSelectionEventManager<String> selectionManager =
            DefaultSelectionEventManager.createCheckboxManager();
    studentList.setSelectionModel(selectionModel, selectionManager);
    studentPanel.add(studentList);
    studentList.setRowData(preferences.getStudentNames());
    setListBoxValue(
            wordLength,
            preferences.getUltraghostMinimumWordLength());
    setListBoxValue(
            vocabularySize,
            preferences.getComputerStudentVocabularySize());
}
 
开发者ID:donkirkby,项目名称:vograbulary,代码行数:29,代码来源:StudentChooserPresenter.java


示例8: init

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的package包/类
protected void init() {
    ProvidesKey<T> keyProvider = new ProvidesKey<T>() {
        @Override
        public Object getKey(T item) {
            return item != null ? getObjectId(item) : null;
        }
    };
    table = new AvroUiDataGrid<T>(this.pageSize, keyProvider, gridResources);
    table.setAutoHeaderRefreshDisabled(true);
    Label emptyTableLabel = new Label(Utils.constants.dataGridEmpty());
    if (embedded) {
        emptyTableLabel.getElement().getStyle().setFontSize(14, Unit.PX);
        emptyTableLabel.getElement().getStyle().setColor("#999999");
    }
    table.setEmptyTableWidget(emptyTableLabel);

    selectionModel = new MultiSelectionModel<T>(keyProvider);

    table.setSelectionModel(selectionModel,
            DefaultSelectionEventManager.<T> createCheckboxManager());

    selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        @Override
        public void onSelectionChange(SelectionChangeEvent event) {
            table.redrawHeaders();
        }
    });

    prefferredWidth = initColumns(table);
    table.setMinimumTableWidth(prefferredWidth, Unit.PX);
    
    if (!filtrableColumns.isEmpty()) {
        table.setHeaderBuilder(new StringFilterHeaderBuilder<T>(this));
    }

    SimplePager pager = getPager();
    pager.setDisplay(table);

    String pagerId = "pager_"+pager.hashCode();

    String html =     "<table " +
                    "style='width:100%'>" +
                    "  <tr>" +
                    "     <td" +
                    "       align='right'>" +
                    "        <div id='" + pagerId + "'/>" +
                    "     </td>" +
                    "  </tr>" +
                    "</table>";

    HTMLPanel htmlPanel = new HTMLPanel(html);
    htmlPanel.add(pager, pagerId);

    addNorth(htmlPanel, 40);
    add(table); // center

    showShadow(embedded);
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:59,代码来源:AbstractGrid.java


示例9: onInitialize

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的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


示例10: onInitialize

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的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


示例11: onInitialize

import com.google.gwt.view.client.DefaultSelectionEventManager; //导入依赖的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.view.client.DefaultSelectionEventManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SpanTermQuery类代码示例发布时间:2022-05-21
下一篇:
Java PGPLiteralData类代码示例发布时间: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