Revision 598e33b7
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrix.java | ||
---|---|---|
41 | 41 |
import org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration; |
42 | 42 |
import org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate; |
43 | 43 |
import org.eclipse.nebula.widgets.nattable.coordinate.Range; |
44 |
import org.eclipse.nebula.widgets.nattable.copy.command.InternalCopyDataCommandHandler; |
|
45 |
import org.eclipse.nebula.widgets.nattable.copy.command.InternalPasteDataCommandHandler; |
|
44 | 46 |
import org.eclipse.nebula.widgets.nattable.data.IDataProvider; |
45 | 47 |
import org.eclipse.nebula.widgets.nattable.data.ListDataProvider; |
48 |
import org.eclipse.nebula.widgets.nattable.edit.command.UpdateDataCommandHandler; |
|
46 | 49 |
import org.eclipse.nebula.widgets.nattable.export.command.ExportCommandHandler; |
47 | 50 |
import org.eclipse.nebula.widgets.nattable.extension.e4.selection.E4SelectionListener; |
48 | 51 |
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsEventLayer; |
... | ... | |
185 | 188 |
|
186 | 189 |
private boolean isShowTooltips = true; |
187 | 190 |
|
191 |
private DataLayer bodyDataLayer; |
|
192 |
|
|
188 | 193 |
public CharacterMatrix(Composite parent, CharacterMatrixPart part) { |
189 | 194 |
super(parent, SWT.NONE); |
190 | 195 |
this.part = part; |
... | ... | |
352 | 357 |
* |
353 | 358 |
|
354 | 359 |
*/ |
355 |
DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
|
|
360 |
bodyDataLayer = new DataLayer(bodyDataProvider); |
|
356 | 361 |
|
357 | 362 |
//register labels |
358 | 363 |
CharacterMatrixConfigLabelAccumulator labelAccumulator = new CharacterMatrixConfigLabelAccumulator(this); |
... | ... | |
461 | 466 |
|
462 | 467 |
//register handler for view configuration menu |
463 | 468 |
natTable.registerCommandHandler(toolbar.getDisplayPersistenceDialogCommandHandler()); |
469 |
|
|
470 |
//register handlers for copy&paste |
|
471 |
natTable.registerCommandHandler( |
|
472 |
new InternalPasteDataCommandHandler(bodyLayer.getSelectionLayer(), natTable.getInternalCellClipboard())); |
|
473 |
natTable.registerCommandHandler( |
|
474 |
new InternalCopyDataCommandHandler(bodyLayer.getSelectionLayer(), natTable.getInternalCellClipboard())); |
|
475 |
natTable.registerCommandHandler(new UpdateDataCommandHandler(bodyDataLayer)); |
|
464 | 476 |
} |
465 | 477 |
|
466 | 478 |
private void configureNatTable(boolean treeView, |
... | ... | |
477 | 489 |
//add default configuration because autoconfigure is set to false in constructor |
478 | 490 |
natTable.addConfiguration(new DefaultNatTableStyleConfiguration()); |
479 | 491 |
|
480 |
//FIXME: this is for DEBUG ONLY
|
|
492 |
// this is for DEBUG ONLY |
|
481 | 493 |
// natTable.addConfiguration(new DebugMenuConfiguration(natTable)); |
482 | 494 |
|
483 | 495 |
// override the default sort configuration and change the mouse bindings |
... | ... | |
498 | 510 |
//register aggregation configuration |
499 | 511 |
summaryRowLayer.addConfiguration(new AggregationConfiguration(this)); |
500 | 512 |
|
513 |
//copy&paste configuration |
|
514 |
natTable.addConfiguration(new CopyPasteEditBindings(bodyLayer.getSelectionLayer(), natTable.getInternalCellClipboard())); |
|
515 |
|
|
501 | 516 |
//+++CONTEXT MENU+++ |
502 | 517 |
menuService.registerContextMenu(natTable, "eu.etaxonomy.taxeditor.editor.popupmenu.charactermatrix"); //$NON-NLS-1$ |
503 | 518 |
// get the menu registered by EMenuService |
Also available in: Unified diff
ref #7580 Add copy&paste configuration (not yet actually working)