Revision 63dd81ea
Added by Katja Luther about 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java | ||
---|---|---|
29 | 29 |
import org.eclipse.jface.viewers.ColumnViewerEditor; |
30 | 30 |
import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; |
31 | 31 |
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy; |
32 |
import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter; |
|
33 | 32 |
import org.eclipse.jface.viewers.ICellModifier; |
34 | 33 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
35 | 34 |
import org.eclipse.jface.viewers.ITableLabelProvider; |
... | ... | |
130 | 129 |
return false; |
131 | 130 |
} |
132 | 131 |
}; |
133 |
TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(viewer, new FocusCellOwnerDrawHighlighter(viewer));
|
|
132 |
TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(viewer, new BulkEditorFocusCellOwnerDrawHighLighter(viewer));
|
|
134 | 133 |
|
135 | 134 |
TableViewerEditor.create(viewer, focusCellManager, activationSupport, ColumnViewerEditor.TABBING_HORIZONTAL | |
136 | 135 |
ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | |
137 | 136 |
ColumnViewerEditor.TABBING_VERTICAL | |
138 |
ColumnViewerEditor.KEYBOARD_ACTIVATION); |
|
137 |
ColumnViewerEditor.KEYBOARD_ACTIVATION );
|
|
139 | 138 |
|
140 | 139 |
CellEditor[] editors = new CellEditor[titles.length]; |
141 | 140 |
for (int i = 0; i < titles.length; i++) { |
... | ... | |
146 | 145 |
column.getColumn().setWidth(bounds[i]); |
147 | 146 |
column.getColumn().setResizable(true); |
148 | 147 |
column.getColumn().setMoveable(true); |
148 |
|
|
149 | 149 |
} |
150 | 150 |
|
151 | 151 |
table.setHeaderVisible(true); |
... | ... | |
206 | 206 |
Composite bottomComposite = new Composite(parent, SWT.NONE); |
207 | 207 |
bottomComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
208 | 208 |
bottomComposite.setLayout(new FillLayout()); |
209 |
viewer = new TableViewer(bottomComposite, SWT.MULTI | SWT.H_SCROLL |
|
210 |
| SWT.V_SCROLL | SWT.FULL_SELECTION); |
|
209 |
viewer = new TableViewer(bottomComposite, SWT.MULTI | SWT.FULL_SELECTION); |
|
211 | 210 |
|
212 | 211 |
// createColumns(viewer); |
213 | 212 |
|
... | ... | |
243 | 242 |
} |
244 | 243 |
input.saveModel(resetMerge); |
245 | 244 |
|
246 |
// commit the conversation and start a new transaction immediately |
|
247 |
conversation.commit(true); |
|
248 |
|
|
249 |
Object object = viewer.getInput(); |
|
250 | 245 |
List<CdmBase> saveCandidates = getEditorInput().getSaveCandidates(); |
251 | 246 |
|
252 | 247 |
if (!saveCandidates.isEmpty()){ |
... | ... | |
254 | 249 |
} |
255 | 250 |
dirty.setDirty(false); |
256 | 251 |
getEditorInput().resetSaveCandidates(); |
252 |
getEditorInput().dispose(); |
|
253 |
getEditorInput().bind(); |
|
254 |
conversation.commit(true); |
|
257 | 255 |
|
258 | 256 |
if (lastQuery != null){ |
259 | 257 |
performSearch(lastQuery); |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorFocusCellOwnerDrawHighLighter.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2018 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.bulkeditor.e4; |
|
11 |
|
|
12 |
import org.eclipse.jface.viewers.ColumnViewer; |
|
13 |
import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter; |
|
14 |
import org.eclipse.jface.viewers.ViewerCell; |
|
15 |
import org.eclipse.swt.SWT; |
|
16 |
import org.eclipse.swt.graphics.Color; |
|
17 |
|
|
18 |
/** |
|
19 |
* @author k.luther |
|
20 |
* @date 02.03.2018 |
|
21 |
* |
|
22 |
*/ |
|
23 |
public class BulkEditorFocusCellOwnerDrawHighLighter extends FocusCellOwnerDrawHighlighter { |
|
24 |
|
|
25 |
/** |
|
26 |
* @param viewer |
|
27 |
*/ |
|
28 |
public BulkEditorFocusCellOwnerDrawHighLighter(ColumnViewer viewer) { |
|
29 |
super(viewer); |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
|
|
34 |
/** |
|
35 |
* The color to use when rendering the background of the selected cell when |
|
36 |
* the control has <b>no</b> input focus |
|
37 |
* |
|
38 |
* @param cell |
|
39 |
* the cell which is colored |
|
40 |
* @return the color or <code>null</code> to use the same used when |
|
41 |
* control has focus |
|
42 |
* @since 3.4 |
|
43 |
*/ |
|
44 |
@Override |
|
45 |
protected Color getSelectedCellBackgroundColorNoFocus(ViewerCell cell) { |
|
46 |
return cell.getItem().getDisplay().getSystemColor( |
|
47 |
SWT.COLOR_LIST_SELECTION); |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* The color to use when rendering the foreground (=text) of the selected |
|
52 |
* cell when the control has <b>no</b> input focus |
|
53 |
* |
|
54 |
* @param cell |
|
55 |
* the cell which is colored |
|
56 |
* @return the color or <code>null</code> to use the same used when |
|
57 |
* control has focus |
|
58 |
* @since 3.4 |
|
59 |
*/ |
|
60 |
@Override |
|
61 |
protected Color getSelectedCellForegroundColorNoFocus(ViewerCell cell) { |
|
62 |
return cell.getItem().getDisplay().getSystemColor( |
|
63 |
SWT.COLOR_LIST_SELECTION_TEXT); |
|
64 |
} |
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
} |
Also available in: Unified diff
fix problems in bulkeditor