Search in sources :

Example 1 with DisplayColumnStyleEditorCommandHandler

use of org.eclipse.nebula.widgets.nattable.style.editor.command.DisplayColumnStyleEditorCommandHandler in project nebula.widgets.nattable by eclipse.

the class ColumnStyleChooserConfiguration method configureRegistry.

@Override
public void configureRegistry(IConfigRegistry configRegistry) {
    DisplayColumnStyleEditorCommandHandler columnChooserCommandHandler = new DisplayColumnStyleEditorCommandHandler(this.selectionLayer, this.labelAccumulator, configRegistry);
    this.bodyLayer.registerCommandHandler(columnChooserCommandHandler);
}
Also used : DisplayColumnStyleEditorCommandHandler(org.eclipse.nebula.widgets.nattable.style.editor.command.DisplayColumnStyleEditorCommandHandler)

Example 2 with DisplayColumnStyleEditorCommandHandler

use of org.eclipse.nebula.widgets.nattable.style.editor.command.DisplayColumnStyleEditorCommandHandler in project nebula.widgets.nattable by eclipse.

the class _000_Styled_grid method setup.

private NatTable setup(Composite parent) {
    DummyGridLayerStack gridLayer = new DummyGridLayerStack();
    final NatTable natTable = new NatTable(parent, gridLayer, false);
    DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();
    // Add an AggregateConfigLabelAccumulator - we can add other
    // accumulators to this as required
    AggregateConfigLabelAccumulator aggregrateConfigLabelAccumulator = new AggregateConfigLabelAccumulator();
    bodyDataLayer.setConfigLabelAccumulator(aggregrateConfigLabelAccumulator);
    ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
    ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
    aggregrateConfigLabelAccumulator.add(columnLabelAccumulator);
    aggregrateConfigLabelAccumulator.add(bodyLabelAccumulator);
    // Add a label for the highlighted column
    // We will add a style for this label to the config registry in a bit
    bodyLabelAccumulator.registerColumnOverrides(2, BODY_LABEL_1);
    columnLabelAccumulator.registerColumnOverrides(2, COLUMN_LABEL_1);
    // Register a command handler for the StyleEditorDialog
    DisplayColumnStyleEditorCommandHandler styleChooserCommandHandler = new DisplayColumnStyleEditorCommandHandler(gridLayer.getBodyLayer().getSelectionLayer(), columnLabelAccumulator, natTable.getConfigRegistry());
    DefaultBodyLayerStack bodyLayer = gridLayer.getBodyLayer();
    bodyLayer.registerCommandHandler(styleChooserCommandHandler);
    // Register the style editor as persistable
    // This will persist the style applied to the columns when
    // NatTable#saveState is invoked
    bodyLayer.registerPersistable(styleChooserCommandHandler);
    bodyLayer.registerPersistable(columnLabelAccumulator);
    return natTable;
}
Also used : DataLayer(org.eclipse.nebula.widgets.nattable.layer.DataLayer) DummyGridLayerStack(org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack) NatTable(org.eclipse.nebula.widgets.nattable.NatTable) ColumnOverrideLabelAccumulator(org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator) DisplayColumnStyleEditorCommandHandler(org.eclipse.nebula.widgets.nattable.style.editor.command.DisplayColumnStyleEditorCommandHandler) DefaultBodyLayerStack(org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack) AggregateConfigLabelAccumulator(org.eclipse.nebula.widgets.nattable.layer.cell.AggregateConfigLabelAccumulator)

Example 3 with DisplayColumnStyleEditorCommandHandler

use of org.eclipse.nebula.widgets.nattable.style.editor.command.DisplayColumnStyleEditorCommandHandler in project nebula.widgets.nattable by eclipse.

the class NatTableBuilder method configureColumnStyleCustomization.

protected void configureColumnStyleCustomization() {
    if (!tableModel.enableColumnStyleCustomization) {
        return;
    }
    // Register a command handler for the StyleEditorDialog
    DisplayColumnStyleEditorCommandHandler styleChooserCommandHandler = new DisplayColumnStyleEditorCommandHandler(bodyLayer.getSelectionLayer(), columnLabelAccumulator, configRegistry);
    bodyLayer.registerCommandHandler(styleChooserCommandHandler);
    // Register the style editor as persistable
    // This will persist the style applied to the columns when
    // NatTable#saveState is invoked
    bodyLayer.registerPersistable(styleChooserCommandHandler);
    bodyLayer.registerPersistable(columnLabelAccumulator);
}
Also used : DisplayColumnStyleEditorCommandHandler(org.eclipse.nebula.widgets.nattable.style.editor.command.DisplayColumnStyleEditorCommandHandler)

Aggregations

DisplayColumnStyleEditorCommandHandler (org.eclipse.nebula.widgets.nattable.style.editor.command.DisplayColumnStyleEditorCommandHandler)3 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)1 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)1 AggregateConfigLabelAccumulator (org.eclipse.nebula.widgets.nattable.layer.cell.AggregateConfigLabelAccumulator)1 ColumnOverrideLabelAccumulator (org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator)1 DefaultBodyLayerStack (org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack)1 DummyGridLayerStack (org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack)1