Search in sources :

Example 1 with InternalCellClipboard

use of org.eclipse.nebula.widgets.nattable.copy.InternalCellClipboard 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 InternalCellClipboard

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

the class FormulaIntegrationTest method setup.

@Before
public void setup() {
    this.natTable.addConfiguration(new DefaultFormulaConfiguration(this.formulaDataProvider, this.gridLayerStack.getBodyLayer().getSelectionLayer(), new InternalCellClipboard()));
    this.natTable.configure();
    this.natTable.addLayerListener(this.listenerFixture);
    // enable caching
    this.formulaDataProvider.configureCaching(this.gridLayerStack.getBodyDataLayer());
    this.dataProvider.setDataValue(0, 0, "5");
    this.dataProvider.setDataValue(1, 0, "3");
    this.dataProvider.setDataValue(2, 0, "=A1*B1");
    this.dataProvider.setDataValue(0, 2, "5");
    this.dataProvider.setDataValue(0, 3, "5");
    this.dataProvider.setDataValue(0, 4, "=SUM(A3:A4)");
    this.dataProvider.setDataValue(1, 2, "3");
    this.dataProvider.setDataValue(1, 3, "3");
    this.dataProvider.setDataValue(1, 4, "=SUM(B3:B4)");
    this.dataProvider.setDataValue(2, 4, "=SUM(A5;B5)");
}
Also used : InternalCellClipboard(org.eclipse.nebula.widgets.nattable.copy.InternalCellClipboard) DefaultFormulaConfiguration(org.eclipse.nebula.widgets.nattable.formula.config.DefaultFormulaConfiguration) Before(org.junit.Before)

Aggregations

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