Search in sources :

Example 1 with InternalCopyDataCommandHandler

use of org.eclipse.nebula.widgets.nattable.copy.command.InternalCopyDataCommandHandler in project nebula.widgets.nattable by eclipse.

the class FormulaFillHandlePasteTest method setup.

@Before
public void setup() {
    InternalCellClipboard clipboard = new InternalCellClipboard();
    this.selectionLayer.registerCommandHandler(new InternalCopyDataCommandHandler(this.selectionLayer, clipboard));
    this.selectionLayer.registerCommandHandler(new FormulaFillHandlePasteCommandHandler(this.selectionLayer, clipboard, this.formulaDataProvider));
    this.natTable.addConfiguration(new DefaultFormulaConfiguration(this.formulaDataProvider, this.selectionLayer, clipboard));
    this.natTable.addConfiguration(new AbstractRegistryConfiguration() {

        @Override
        public void configureRegistry(IConfigRegistry configRegistry) {
            configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, EditableRule.ALWAYS_EDITABLE);
        }
    });
    this.natTable.configure();
}
Also used : InternalCellClipboard(org.eclipse.nebula.widgets.nattable.copy.InternalCellClipboard) DefaultFormulaConfiguration(org.eclipse.nebula.widgets.nattable.formula.config.DefaultFormulaConfiguration) AbstractRegistryConfiguration(org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration) FormulaFillHandlePasteCommandHandler(org.eclipse.nebula.widgets.nattable.formula.command.FormulaFillHandlePasteCommandHandler) IConfigRegistry(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry) InternalCopyDataCommandHandler(org.eclipse.nebula.widgets.nattable.copy.command.InternalCopyDataCommandHandler) Before(org.junit.Before)

Example 2 with InternalCopyDataCommandHandler

use of org.eclipse.nebula.widgets.nattable.copy.command.InternalCopyDataCommandHandler in project nebula.widgets.nattable by eclipse.

the class FillHandleConfiguration method configureTypedLayer.

@Override
public void configureTypedLayer(NatTable natTable) {
    // initialization works here because configureLayer() is executed before
    // configureUiBindings()
    this.clipboard = natTable.getInternalCellClipboard();
    this.painter = new FillHandleLayerPainter();
    this.selectionLayer.setLayerPainter(this.painter);
    this.selectionLayer.addLayerListener(new FillHandleMarkupListener(this.selectionLayer));
    this.selectionLayer.registerCommandHandler(new InternalCopyDataCommandHandler(this.selectionLayer, this.clipboard));
    this.selectionLayer.registerCommandHandler(new FillHandlePasteCommandHandler(this.selectionLayer, this.clipboard));
}
Also used : FillHandleLayerPainter(org.eclipse.nebula.widgets.nattable.fillhandle.FillHandleLayerPainter) FillHandleMarkupListener(org.eclipse.nebula.widgets.nattable.fillhandle.event.FillHandleMarkupListener) FillHandlePasteCommandHandler(org.eclipse.nebula.widgets.nattable.fillhandle.command.FillHandlePasteCommandHandler) InternalCopyDataCommandHandler(org.eclipse.nebula.widgets.nattable.copy.command.InternalCopyDataCommandHandler)

Aggregations

InternalCopyDataCommandHandler (org.eclipse.nebula.widgets.nattable.copy.command.InternalCopyDataCommandHandler)2 AbstractRegistryConfiguration (org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration)1 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)1 InternalCellClipboard (org.eclipse.nebula.widgets.nattable.copy.InternalCellClipboard)1 FillHandleLayerPainter (org.eclipse.nebula.widgets.nattable.fillhandle.FillHandleLayerPainter)1 FillHandlePasteCommandHandler (org.eclipse.nebula.widgets.nattable.fillhandle.command.FillHandlePasteCommandHandler)1 FillHandleMarkupListener (org.eclipse.nebula.widgets.nattable.fillhandle.event.FillHandleMarkupListener)1 FormulaFillHandlePasteCommandHandler (org.eclipse.nebula.widgets.nattable.formula.command.FormulaFillHandlePasteCommandHandler)1 DefaultFormulaConfiguration (org.eclipse.nebula.widgets.nattable.formula.config.DefaultFormulaConfiguration)1 Before (org.junit.Before)1