@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; }
@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; }
public EntityModelCellTable(SelectionMode selectionMode, Resources resources, boolean hideCheckbox, boolean showSelectAllCheckbox) { super(DEFAULT_PAGESIZE, resources); dontApplyResizableHeaderStyle(); style = cellTableResources.cellTableValidation(); style.ensureInjected(); this.editorAdapter = new HasDataListModelEditorAdapter<>(this); // Configure table selection model switch (selectionMode) { case MULTIPLE: setSelectionModel(new MultiSelectionModel<>(), DefaultSelectionEventManager.createCheckboxManager(0)); break; case NONE: setSelectionModel(new NoSelectionModel<>()); break; case SINGLE: default: setSelectionModel(new SingleSelectionModel<>()); break; } addSelectionChangeHandler(); addCheckBoxColumn(hideCheckbox, showSelectAllCheckbox); super.setHeight(LOADING_HEIGHT + Unit.PX.getType()); }
setSelectionModel(new SingleSelectionModel<>()); } else { setSelectionModel(new MultiSelectionModel<>(), DefaultSelectionEventManager.createCheckboxManager());