private void setupIndicatorOptionsGrid() { List<ColumnConfig> columnConfigs = new ArrayList<ColumnConfig>(); columnConfigs.add(new EditColorColumn()); columnConfigs.add(new ReadTextColumn("name", I18N.CONSTANTS.indicators(), 50)); ColumnModel columnmodelIndicators = new ColumnModel(columnConfigs); EditorGrid<NamedSlice> indicatorOptionGrid = new EditorGrid<NamedSlice>(indicatorsStore, columnmodelIndicators); indicatorOptionGrid.setBorders(false); indicatorOptionGrid.setAutoExpandColumn("name"); indicatorOptionGrid.setAutoWidth(true); indicatorOptionGrid.setHeight(100); indicatorOptionGrid.getView().setShowDirtyCells(false); indicatorOptionGrid.setSelectionModel(new CellSelectionModel<PiechartLayerOptions.NamedSlice>()); indicatorOptionGrid.addListener(Events.AfterEdit, new Listener<GridEvent<NamedSlice>>() { @Override public void handleEvent(GridEvent<NamedSlice> be) { be.getModel().getSlice().setColor(be.getModel().getColor()); ValueChangeEvent.fire(PiechartLayerOptions.this, piechartMapLayer); } }); VBoxLayoutData vbld = new VBoxLayoutData(); vbld.setFlex(1); panel.add(indicatorOptionGrid); }
protected BaseGridOfEntities(ArrayList beansToDisplay) { ColumnModel cm = createColumnModel(); loader = new BaseListLoader(new MemoryProxy(beansToDisplay), new FixedBeanModelReader()); store = buildListStore(beansToDisplay, loader); grid = new EditorGrid(store, cm); grid.setBorders(true); grid.setAutoExpandMax(800); grid.setAutoExpandColumn(expandedColumnId); grid.setAutoHeight(true); ComponentPlugin plugin = getGridPlugin(); if (plugin != null) { grid.addPlugin(getGridPlugin()); } grid.addListener(Events.RowDoubleClick, new Listener<GridEvent>() { public void handleEvent(GridEvent be) { ModelData md = be.getGrid().getStore().getAt(be.getRowIndex()); onGridRowDoubleClick(md); } }); String heading = buildHeading(); this.setLayout(new FitLayout()); this.setHeading(heading); this.setFrame(true); this.add(grid); }
grid.setAutoExpandColumn("title"); grid.setSelectionModel(new GridSelectionModel<ReportMetadataDTO>()); grid.setClicksToEdit(ClicksToEdit.ONE);