use of org.eclipse.nebula.widgets.nattable.formula.command.FormulaPasteDataCommandHandler in project nebula.widgets.nattable by eclipse.
the class DefaultFormulaConfiguration method configureLayer.
@Override
public void configureLayer(ILayer layer) {
// register the command handler for deleting values
layer.registerCommandHandler(new DeleteSelectionCommandHandler(this.selectionLayer));
// register the ExportCommandHandler to the current layer (should be a
// layer on top of the GridLayer to override default GridLayer behavior)
// that exports from the SelectionLayer downwards. This way the column
// and row headers won't be exported.
layer.registerCommandHandler(new ExportCommandHandler(this.selectionLayer));
// register the command handler for enabling/disabling formula
// evaluation
// register on the SelectionLayer so it works on export
this.selectionLayer.registerCommandHandler(new DisableFormulaEvaluationCommandHandler(this.dataProvider));
this.selectionLayer.registerCommandHandler(new EnableFormulaEvaluationCommandHandler(this.dataProvider));
// add a layer listener that clears the internal clipboard on structural
// changes
this.selectionLayer.addLayerListener(new InternalClipboardStructuralChangeListener(this.clipboard));
// add the layer painter that renders a border around copied cells
if (!(this.selectionLayer.getLayerPainter() instanceof FillHandleLayerPainter)) {
this.selectionLayer.setLayerPainter(new FillHandleLayerPainter(this.clipboard));
} else {
// ensure the clipboard is set
((FillHandleLayerPainter) this.selectionLayer.getLayerPainter()).setClipboard(this.clipboard);
}
// register special copy+paste command handlers
layer.registerCommandHandler(new FormulaCopyDataCommandHandler(this.selectionLayer, this.clipboard));
layer.registerCommandHandler(new FormulaPasteDataCommandHandler(this.selectionLayer, this.clipboard, this.dataProvider));
layer.registerCommandHandler(new FormulaFillHandlePasteCommandHandler(this.selectionLayer, this.clipboard, this.dataProvider));
}
Aggregations