1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.taxeditor.bulkeditor.e4;
|
11
|
|
12
|
import java.io.Serializable;
|
13
|
import java.util.ArrayList;
|
14
|
import java.util.HashMap;
|
15
|
import java.util.List;
|
16
|
import java.util.Map;
|
17
|
|
18
|
import javax.inject.Inject;
|
19
|
|
20
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
21
|
import org.eclipse.e4.ui.services.EMenuService;
|
22
|
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
|
23
|
import org.eclipse.jface.dialogs.MessageDialog;
|
24
|
import org.eclipse.jface.layout.GridDataFactory;
|
25
|
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
26
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
27
|
import org.eclipse.jface.viewers.StructuredSelection;
|
28
|
import org.eclipse.nebula.widgets.nattable.NatTable;
|
29
|
import org.eclipse.nebula.widgets.nattable.command.VisualRefreshCommand;
|
30
|
import org.eclipse.nebula.widgets.nattable.command.VisualRefreshCommandHandler;
|
31
|
import org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration;
|
32
|
import org.eclipse.nebula.widgets.nattable.config.AbstractUiBindingConfiguration;
|
33
|
import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
|
34
|
import org.eclipse.nebula.widgets.nattable.config.ConfigRegistry;
|
35
|
import org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration;
|
36
|
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
|
37
|
import org.eclipse.nebula.widgets.nattable.config.IEditableRule;
|
38
|
import org.eclipse.nebula.widgets.nattable.data.IRowIdAccessor;
|
39
|
import org.eclipse.nebula.widgets.nattable.data.ListDataProvider;
|
40
|
import org.eclipse.nebula.widgets.nattable.data.convert.DefaultBooleanDisplayConverter;
|
41
|
import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes;
|
42
|
import org.eclipse.nebula.widgets.nattable.edit.action.MouseEditAction;
|
43
|
import org.eclipse.nebula.widgets.nattable.edit.config.DefaultEditConfiguration;
|
44
|
import org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor;
|
45
|
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsEventLayer;
|
46
|
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsSortModel;
|
47
|
import org.eclipse.nebula.widgets.nattable.grid.GridRegion;
|
48
|
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider;
|
49
|
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider;
|
50
|
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider;
|
51
|
import org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer;
|
52
|
import org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer;
|
53
|
import org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer;
|
54
|
import org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer;
|
55
|
import org.eclipse.nebula.widgets.nattable.layer.AbstractLayer;
|
56
|
import org.eclipse.nebula.widgets.nattable.layer.DataLayer;
|
57
|
import org.eclipse.nebula.widgets.nattable.layer.stack.DefaultBodyLayerStack;
|
58
|
import org.eclipse.nebula.widgets.nattable.painter.cell.CheckBoxPainter;
|
59
|
import org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter;
|
60
|
import org.eclipse.nebula.widgets.nattable.selection.RowSelectionModel;
|
61
|
import org.eclipse.nebula.widgets.nattable.selection.RowSelectionProvider;
|
62
|
import org.eclipse.nebula.widgets.nattable.sort.SortHeaderLayer;
|
63
|
import org.eclipse.nebula.widgets.nattable.sort.config.SingleClickSortConfiguration;
|
64
|
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
|
65
|
import org.eclipse.nebula.widgets.nattable.style.theme.ModernNatTableThemeConfiguration;
|
66
|
import org.eclipse.nebula.widgets.nattable.ui.binding.UiBindingRegistry;
|
67
|
import org.eclipse.nebula.widgets.nattable.ui.matcher.CellEditorMouseEventMatcher;
|
68
|
import org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher;
|
69
|
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuAction;
|
70
|
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder;
|
71
|
import org.eclipse.swt.SWT;
|
72
|
import org.eclipse.swt.dnd.Clipboard;
|
73
|
import org.eclipse.swt.dnd.TextTransfer;
|
74
|
import org.eclipse.swt.dnd.Transfer;
|
75
|
import org.eclipse.swt.layout.GridData;
|
76
|
import org.eclipse.swt.layout.GridLayout;
|
77
|
import org.eclipse.swt.widgets.Composite;
|
78
|
import org.eclipse.swt.widgets.Display;
|
79
|
import org.eclipse.swt.widgets.Menu;
|
80
|
|
81
|
import ca.odell.glazedlists.SortedList;
|
82
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
83
|
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
|
84
|
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery;
|
85
|
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
|
86
|
import eu.etaxonomy.taxeditor.l10n.Messages;
|
87
|
import eu.etaxonomy.taxeditor.model.ImageResources;
|
88
|
|
89
|
/**
|
90
|
*
|
91
|
* @author pplitzner
|
92
|
* @since Sep 8, 2017
|
93
|
*
|
94
|
*/
|
95
|
public class BulkEditorE4Composite extends Composite {
|
96
|
|
97
|
public static final String LABEL_CANDIDATE = "LABEL_CANDIDATE"; //$NON-NLS-1$
|
98
|
public static final String LABEL_CANDIDATE_ICON = "LABEL_CANDIDATE_ICON"; //$NON-NLS-1$
|
99
|
|
100
|
public static final String LABEL_TARGET = "LABEL_TARGET"; //$NON-NLS-1$
|
101
|
public static final String LABEL_TARGET_ICON = "LABEL_TARGET_ICON"; //$NON-NLS-1$
|
102
|
|
103
|
private final List<String> columnList = new ArrayList<>();
|
104
|
|
105
|
private Composite topComposite;
|
106
|
|
107
|
@Inject
|
108
|
private ESelectionService selService;
|
109
|
|
110
|
private ISelectionChangedListener selectionChangedListener;
|
111
|
|
112
|
private Composite bottomComposite;
|
113
|
|
114
|
@Inject
|
115
|
private EMenuService menuService;
|
116
|
|
117
|
private NatTable natTable;
|
118
|
|
119
|
private DefaultBodyLayerStack bodyLayer;
|
120
|
|
121
|
private ListDataProvider<CdmBase> bodyDataProvider;
|
122
|
|
123
|
private BulkEditorE4 bulkEditor;
|
124
|
private BulkEditorSearchE4 bulkEditorSearch;
|
125
|
|
126
|
|
127
|
public BulkEditorE4Composite(BulkEditorE4 bulkEditor, Composite parent, int style) {
|
128
|
super(parent, style);
|
129
|
parent.setLayout(new GridLayout());
|
130
|
this.bulkEditor = bulkEditor;
|
131
|
|
132
|
this.setLayout(new GridLayout());
|
133
|
|
134
|
topComposite = new Composite(parent, SWT.NONE);
|
135
|
topComposite.setLayout(new GridLayout());
|
136
|
|
137
|
GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
|
138
|
topComposite.setLayoutData(gridData);
|
139
|
|
140
|
bottomComposite = new Composite(parent, SWT.NONE);
|
141
|
bottomComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
142
|
bottomComposite.setLayout(new GridLayout());
|
143
|
}
|
144
|
|
145
|
@SuppressWarnings("unused")
|
146
|
public void init(AbstractBulkEditorInput<?> input){
|
147
|
|
148
|
input.getPropertyKeys().forEach(key->columnList.add(key));
|
149
|
|
150
|
bulkEditorSearch = new BulkEditorSearchE4(this, topComposite, SWT.NONE);
|
151
|
//layout needed because the search bar is added after @PostConstuct method
|
152
|
topComposite.getParent().layout();
|
153
|
|
154
|
if(input.getEntityUuid()!=null){
|
155
|
performSearch(new BulkEditorQuery(input.getEntityUuid().toString()));
|
156
|
}
|
157
|
|
158
|
createTable();
|
159
|
|
160
|
configureTable();
|
161
|
|
162
|
styleTable();
|
163
|
|
164
|
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
|
165
|
|
166
|
//propagate selection
|
167
|
selectionChangedListener = (event -> selService.setSelection(getSelection()));
|
168
|
RowSelectionProvider<CdmBase> selectionProvider = new RowSelectionProvider<CdmBase>(bodyLayer.getSelectionLayer(), bodyDataProvider, true);
|
169
|
selectionProvider.addSelectionChangedListener(selectionChangedListener);
|
170
|
|
171
|
bottomComposite.layout();
|
172
|
|
173
|
}
|
174
|
|
175
|
private void createTable(){
|
176
|
ConfigRegistry configRegistry = new ConfigRegistry();
|
177
|
//property map
|
178
|
Map<String, String> propertyToLabels = new HashMap<>();
|
179
|
columnList.forEach(columnLabel->propertyToLabels.put(columnLabel, columnLabel));
|
180
|
|
181
|
String[] propertyNames = columnList.toArray(columnList.toArray(new String[columnList.size()]));
|
182
|
//sorted list
|
183
|
SortedList<CdmBase> sortedList = new SortedList<>(bulkEditor.getEditorInput().getModel(), bulkEditor.getEditorInput().getTitleComparator());
|
184
|
//data provider
|
185
|
BulkEditorPropertyAccessor columnPropertyAccessor = new BulkEditorPropertyAccessor(this, bulkEditor.getEditorInput());
|
186
|
bodyDataProvider = new ListDataProvider<CdmBase>(sortedList,
|
187
|
columnPropertyAccessor);
|
188
|
DefaultColumnHeaderDataProvider colHeaderDataProvider = new DefaultColumnHeaderDataProvider(
|
189
|
propertyNames, propertyToLabels);
|
190
|
DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
|
191
|
bodyDataProvider);
|
192
|
//body
|
193
|
DataLayer dataLayer = new DataLayer(bodyDataProvider);
|
194
|
dataLayer.registerCommandHandler(new VisualRefreshCommandHandler());
|
195
|
GlazedListsEventLayer<CdmBase> eventLayer = new GlazedListsEventLayer<>(dataLayer, bulkEditor.getEditorInput().getModel());
|
196
|
bodyLayer = new DefaultBodyLayerStack(eventLayer);
|
197
|
|
198
|
dataLayer.setColumnPercentageSizing(0, true);
|
199
|
dataLayer.setColumnWidthPercentageByPosition(0, 45);
|
200
|
for(int i=1;i<columnList.size();i++){
|
201
|
if(bulkEditor.getEditorInput().isCacheProperty(columnList.get(i))){
|
202
|
dataLayer.setColumnWidthByPosition(i, 16);
|
203
|
}
|
204
|
else{
|
205
|
dataLayer.setColumnWidthByPosition(i, 100);
|
206
|
}
|
207
|
}
|
208
|
|
209
|
//column
|
210
|
DataLayer columnHeaderDataLayer = new DataLayer(colHeaderDataProvider);
|
211
|
ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(
|
212
|
columnHeaderDataLayer,
|
213
|
bodyLayer, bodyLayer.getSelectionLayer());
|
214
|
// add the SortHeaderLayer to the column header layer stack
|
215
|
// as we use GlazedLists, we use the GlazedListsSortModel which
|
216
|
// delegates the sorting to the SortedList
|
217
|
final SortHeaderLayer<SpecimenDescription> sortHeaderLayer = new SortHeaderLayer<>(
|
218
|
columnHeaderLayer,
|
219
|
new GlazedListsSortModel<>(
|
220
|
sortedList,
|
221
|
columnPropertyAccessor,
|
222
|
configRegistry,
|
223
|
columnHeaderDataLayer));
|
224
|
columnHeaderDataLayer.setConfigLabelAccumulator(
|
225
|
new BulkEditorConfigLabelAccumulatorHeader(colHeaderDataProvider, bulkEditor.getEditorInput()));
|
226
|
//row
|
227
|
DataLayer rowHeaderDataLayer = new DataLayer(rowHeaderDataProvider);
|
228
|
RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
|
229
|
bodyLayer, bodyLayer.getSelectionLayer());
|
230
|
rowHeaderDataLayer.setColumnWidthByPosition(0, 50);
|
231
|
|
232
|
//corner
|
233
|
DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
|
234
|
colHeaderDataProvider, rowHeaderDataProvider);
|
235
|
DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
|
236
|
CornerLayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer, sortHeaderLayer);
|
237
|
//grid
|
238
|
GridLayer gridLayer = new GridLayer(bodyLayer, sortHeaderLayer,
|
239
|
rowHeaderLayer, cornerLayer, false);//set autoconfigure to false to get rid of the single click editing
|
240
|
natTable = new NatTable(bottomComposite, gridLayer, false);
|
241
|
|
242
|
//full row selection
|
243
|
bodyLayer.getSelectionLayer().setSelectionModel(new RowSelectionModel<CdmBase>(bodyLayer.getSelectionLayer(), bodyDataProvider, new IRowIdAccessor<CdmBase>() {
|
244
|
@Override
|
245
|
public Serializable getRowId(CdmBase rowObject) {
|
246
|
return bulkEditor.getEditorInput().getModel().indexOf(rowObject);
|
247
|
}
|
248
|
}));
|
249
|
|
250
|
dataLayer.setConfigLabelAccumulator(new BulkEditorConfigLabelAccumulator(bodyDataProvider, colHeaderDataProvider,
|
251
|
bulkEditor.getEditorInput()));
|
252
|
|
253
|
natTable.setConfigRegistry(configRegistry);
|
254
|
|
255
|
//add tooltip to table
|
256
|
new BulkEditorTooltip(natTable, colHeaderDataProvider);
|
257
|
}
|
258
|
|
259
|
private void configureTable(){
|
260
|
|
261
|
//this configuration enables cell to be editable in general
|
262
|
//necessary because we disabled this beforehand by setting autoconfigure=false
|
263
|
//in the GridLayer constructor
|
264
|
((AbstractLayer) natTable.getLayer()).addConfiguration(new DefaultEditConfiguration());
|
265
|
|
266
|
natTable.addConfiguration(new AbstractUiBindingConfiguration() {
|
267
|
@Override
|
268
|
public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
|
269
|
uiBindingRegistry.registerFirstDoubleClickBinding(new CellEditorMouseEventMatcher(GridRegion.BODY),
|
270
|
new MouseEditAction());
|
271
|
}
|
272
|
});
|
273
|
|
274
|
//make cells editable to allow selecting the text
|
275
|
natTable.addConfiguration(new AbstractRegistryConfiguration() {
|
276
|
@Override
|
277
|
public void configureRegistry(IConfigRegistry configRegistry) {
|
278
|
//make cell editable
|
279
|
configRegistry.registerConfigAttribute(
|
280
|
EditConfigAttributes.CELL_EDITABLE_RULE,
|
281
|
IEditableRule.ALWAYS_EDITABLE,
|
282
|
DisplayMode.EDIT);
|
283
|
//register editor
|
284
|
TextCellEditor editor = new TextCellEditor();
|
285
|
editor.setEditable(false);
|
286
|
configRegistry.registerConfigAttribute(
|
287
|
EditConfigAttributes.CELL_EDITOR,
|
288
|
editor,
|
289
|
DisplayMode.NORMAL);
|
290
|
}
|
291
|
});
|
292
|
|
293
|
//+++CONTEXT MENU+++
|
294
|
menuService.registerContextMenu(natTable, "eu.etaxonomy.taxeditor.bulkeditor.popupmenu.bulkeditor"); //$NON-NLS-1$
|
295
|
// get the menu registered by EMenuService
|
296
|
final Menu e4Menu = natTable.getMenu();
|
297
|
// remove the menu reference from NatTable instance
|
298
|
natTable.setMenu(null);
|
299
|
natTable.addConfiguration(
|
300
|
new AbstractUiBindingConfiguration() {
|
301
|
@Override
|
302
|
public void configureUiBindings(
|
303
|
UiBindingRegistry uiBindingRegistry) {
|
304
|
// add e4 menu to NatTable
|
305
|
new PopupMenuBuilder(natTable, e4Menu)
|
306
|
.withHideColumnMenuItem()
|
307
|
.withShowAllColumnsMenuItem()
|
308
|
.build();
|
309
|
|
310
|
// register the UI binding for header, corner and body region
|
311
|
uiBindingRegistry.registerMouseDownBinding(
|
312
|
new MouseEventMatcher(
|
313
|
SWT.NONE,
|
314
|
null,
|
315
|
MouseEventMatcher.RIGHT_BUTTON),
|
316
|
new PopupMenuAction(e4Menu));
|
317
|
}
|
318
|
});
|
319
|
|
320
|
|
321
|
//enable sorting
|
322
|
natTable.addConfiguration(new SingleClickSortConfiguration());
|
323
|
|
324
|
// Custom style for deduplication labels
|
325
|
natTable.addConfiguration(new BulkEditorLabelStyleConfiguration());
|
326
|
|
327
|
//add default configuration because autoconfigure is set to false in constructor
|
328
|
natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
|
329
|
|
330
|
//show boolean values as check boxes
|
331
|
natTable.addConfiguration(new AbstractRegistryConfiguration() {
|
332
|
@Override
|
333
|
public void configureRegistry(IConfigRegistry configRegistry) {
|
334
|
configRegistry.registerConfigAttribute(
|
335
|
CellConfigAttributes.CELL_PAINTER,
|
336
|
new CheckBoxPainter(),
|
337
|
DisplayMode.NORMAL,
|
338
|
BulkEditorConfigLabelAccumulatorHeader.BOOLEAN_COLUMN);
|
339
|
|
340
|
configRegistry.registerConfigAttribute(
|
341
|
CellConfigAttributes.DISPLAY_CONVERTER,
|
342
|
new DefaultBooleanDisplayConverter(),
|
343
|
DisplayMode.NORMAL,
|
344
|
BulkEditorConfigLabelAccumulatorHeader.BOOLEAN_COLUMN);
|
345
|
}
|
346
|
});
|
347
|
|
348
|
natTable.addConfiguration(new AbstractRegistryConfiguration() {
|
349
|
@Override
|
350
|
public void configureRegistry(IConfigRegistry configRegistry) {
|
351
|
configRegistry.registerConfigAttribute(
|
352
|
CellConfigAttributes.CELL_PAINTER,
|
353
|
new ImagePainter(ImageResources.getImage(ImageResources.LOCK_ICON)),
|
354
|
DisplayMode.NORMAL,
|
355
|
BulkEditorConfigLabelAccumulatorHeader.CACHE_COLUMN);
|
356
|
}
|
357
|
});
|
358
|
|
359
|
//register handler for view configuration menu
|
360
|
natTable.registerCommandHandler(bulkEditorSearch.getDisplayPersistenceDialogCommandHandler());
|
361
|
|
362
|
natTable.configure();
|
363
|
}
|
364
|
|
365
|
private void styleTable(){
|
366
|
natTable.setTheme(new ModernNatTableThemeConfiguration());
|
367
|
}
|
368
|
|
369
|
public void performSearch(BulkEditorQuery query) {
|
370
|
performSearch(query, null);
|
371
|
}
|
372
|
|
373
|
/** {@inheritDoc}
|
374
|
* @param selection */
|
375
|
public void performSearch(BulkEditorQuery query, IStructuredSelection selection) {
|
376
|
if (query != null) {
|
377
|
if (bulkEditor.isDirty()) {
|
378
|
String[] labels = {Messages.BulkEditorE4_SAVE_AND_SEARCH, Messages.BulkEditorE4_DONT_SAVE,Messages.BulkEditorE4_CANCEL};
|
379
|
MessageDialog dialog =new MessageDialog(topComposite.getShell(), Messages.BulkEditorE4_SAVE_CHANGES_TITLE, null, Messages.BulkEditorE4_SAVE_CHANGES_MESSAGE, MessageDialog.QUESTION,labels, 0);
|
380
|
int result = dialog.open();
|
381
|
if (result == 0) {
|
382
|
bulkEditor.save(new NullProgressMonitor());
|
383
|
} else if (result == 2){
|
384
|
return;
|
385
|
}
|
386
|
}
|
387
|
bulkEditor.setDirty(false);
|
388
|
bulkEditor.getEditorInput().performSearch(query, selection);
|
389
|
bulkEditor.setLastQuery(query);
|
390
|
}
|
391
|
}
|
392
|
|
393
|
public void refresh(){
|
394
|
natTable.doCommand(new VisualRefreshCommand());
|
395
|
}
|
396
|
|
397
|
public List<String> getColumnList() {
|
398
|
return columnList;
|
399
|
}
|
400
|
|
401
|
public IStructuredSelection getSelection(){
|
402
|
List<CdmBase> selection = new ArrayList<>();
|
403
|
int[] fullySelectedRowPositions = bodyLayer.getSelectionLayer().getFullySelectedRowPositions();
|
404
|
for (int i : fullySelectedRowPositions) {
|
405
|
if(i<0){
|
406
|
continue;
|
407
|
}
|
408
|
Object rowObject = bodyDataProvider.getRowObject(i);
|
409
|
if(rowObject instanceof CdmBase){
|
410
|
selection.add((CdmBase) rowObject);
|
411
|
}
|
412
|
}
|
413
|
return new StructuredSelection(selection);
|
414
|
}
|
415
|
|
416
|
public void setSelection(IStructuredSelection selection){
|
417
|
Object[] objects = selection.toArray();
|
418
|
for (Object object : objects) {
|
419
|
|
420
|
if(object instanceof CdmBase && bulkEditor.getEditorInput().getModel().contains(object)){
|
421
|
bodyLayer.getSelectionLayer().selectRow(0, bodyDataProvider.indexOfRowObject((CdmBase) object), false, false);
|
422
|
}
|
423
|
}
|
424
|
}
|
425
|
|
426
|
public void copyDataToClipboard() {
|
427
|
String textData = ""; //$NON-NLS-1$
|
428
|
IStructuredSelection selection = getSelection();
|
429
|
Object[] objects = selection.toArray();
|
430
|
for (Object object : objects) {
|
431
|
if(object instanceof CdmBase){
|
432
|
textData += bulkEditor.getEditorInput().getText((CdmBase)object);
|
433
|
}
|
434
|
}
|
435
|
final TextTransfer textTransfer = TextTransfer.getInstance();
|
436
|
final Clipboard clipboard = new Clipboard(Display.getDefault());
|
437
|
try {
|
438
|
clipboard.setContents(new Object[] { textData.toString() },
|
439
|
new Transfer[] { textTransfer });
|
440
|
} finally {
|
441
|
clipboard.dispose();
|
442
|
}
|
443
|
}
|
444
|
|
445
|
NatTable getNatTable() {
|
446
|
return natTable;
|
447
|
}
|
448
|
|
449
|
}
|