/** * Returns the cell renderer. * * @param colIndex the column index * @return the cell renderer */ public GridCellRenderer<ModelData> getRenderer(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getRenderer() : null; }
/** * Returns true if the cell is editable. * * @param colIndex the column index * @return true if editable */ public boolean isCellEditable(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null && c.getEditor() != null; }
/** * Returns the column's alignment. * * @param colIndex the column index * @return the alignment */ public HorizontalAlignment getColumnAlignment(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getAlignment() : null; }
/** * Returns true if the column is hidden. * * @param colIndex the column index * @return true if hidden */ public boolean isHidden(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null && c.isHidden(); }
/** * Sets the dataIndex for a column. * * @param colIndex the column index * @param dataIndex the data index */ public void setDataIndex(int colIndex, String dataIndex) { ColumnConfig c = getColumn(colIndex); if (c != null) { c.setDataIndex(dataIndex); } }
/** * Returns the column's style. * * @param colIndex the column index * @return the column style */ public String getColumnStyle(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getStyle() : null; }
/** * Returns the tooltip for the specified column. * * @param colIndex the column index * @return the tooltip */ public String getColumnToolTip(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getToolTip() : null; }
/** * Returns true if the column is groupable. Applies when using a * {@link GroupingView}. * * @param colIndex the column index * @return true if the column is groupable. */ public boolean isGroupable(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null && c.isGroupable(); }
/** * Returns true if the specified column menu is disabled. * * @param colIndex the column index * @return true if disabled */ public boolean isMenuDisabled(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null && c.isMenuDisabled(); }
/** * Returns true if the column can be resized. * * @param colIndex the column index * @return true if resizable */ public boolean isResizable(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null && c.isResizable(); }
/** * Sets the editor for the column. * * @param colIndex the column index * @param editor the editor */ public void setEditor(int colIndex, CellEditor editor) { ColumnConfig c = getColumn(colIndex); if (c != null) { c.setEditor(editor); } }
/** * Returns true if the column can be resized. * * @param colIndex the column index * @return true if fixed */ public boolean isFixed(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null && c.isFixed(); }
/** * Returns true if the specified column is sortable. * * @param colIndex the column index * @return true if the column is sortable */ public boolean isSortable(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null && c.isSortable(); }
/** * Returns the header for the specified column. * * @param colIndex the column index * @return the header */ public String getColumnHeader(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getHeaderHtml() : null; }
/** * Returns the id of the column at the specified index. * * @param colIndex the column index * @return the id */ public String getColumnId(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getId() : null; }
/** * Returns the column width. * * @param colIndex the column index * @return the width */ public int getColumnWidth(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getWidth() : -1; }
/** * Returns the data index for the specified column. * * @param colIndex the column index * @return the data index */ public String getDataIndex(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getDataIndex() : null; }
/** * Returns the column's editor. * * @param colIndex the column index * @return the cell editor */ public CellEditor getEditor(int colIndex) { ColumnConfig c = getColumn(colIndex); return c != null ? c.getEditor() : null; }
@Override public void handleEvent(GridEvent event) { if (readOnly) { event.setCancelled(true); } String property = getColumnModel().getColumn(event.getColIndex()).getDataIndex(); Month month = IndicatorRowDTO.monthForProperty(property); if (locked.apply(month)) { event.setCancelled(true); } } });
protected Filter getMenuFilter(MenuEvent me) { MenuItem item = (MenuItem) me.getItem(); ColumnConfig config = grid.getColumnModel().getColumn((Integer) item.getData("index")); return getFilter(config.getDataIndex()); }