Revision 3f09ac44
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/PolytomousKeyListEditorE4.java | ||
---|---|---|
45 | 45 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
46 | 46 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
47 | 47 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
48 |
import eu.etaxonomy.taxeditor.editor.key.KeyEditor; |
|
48 |
import eu.etaxonomy.taxeditor.editor.key.KeyEditorDataChangeBehaviour;
|
|
49 | 49 |
import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage; |
50 | 50 |
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput; |
51 | 51 |
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListContentProvider; |
52 | 52 |
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListLabelProvider; |
53 | 53 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
54 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
|
55 | 54 |
import eu.etaxonomy.taxeditor.model.IDirtyMarkable; |
55 |
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails; |
|
56 | 56 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
57 | 57 |
|
58 | 58 |
/** |
... | ... | |
62 | 62 |
* |
63 | 63 |
*/ |
64 | 64 |
public class PolytomousKeyListEditorE4 implements |
65 |
IConversationEnabled, IDirtyMarkable, |
|
65 |
IConversationEnabled, IDirtyMarkable, IPartContentHasDetails,
|
|
66 | 66 |
IPolytomousKeyEditorPage { |
67 | 67 |
|
68 | 68 |
private class LinkListener extends MouseAdapter { |
... | ... | |
140 | 140 |
|
141 | 141 |
private TableViewer viewer; |
142 | 142 |
|
143 |
private ConversationHolder conversation; |
|
144 |
|
|
145 |
private KeyEditorDataChangeBehaviour dataChangeBehavior; |
|
146 |
|
|
143 | 147 |
private PolytomousKeyEditorInput input; |
144 | 148 |
|
145 | 149 |
@Inject |
... | ... | |
169 | 173 |
|
170 | 174 |
@Persist |
171 | 175 |
public void doSave(IProgressMonitor monitor) { |
172 |
} |
|
176 |
try { |
|
177 |
monitor.beginTask(Messages.KeyEditor_SAVING, 1); |
|
178 |
getConversationHolder().bind(); |
|
179 |
getConversationHolder().commit(true); |
|
180 |
input.merge(); |
|
181 |
dirty.setDirty(false); |
|
182 |
monitor.worked(1); |
|
183 |
} finally { |
|
184 |
monitor.done(); |
|
185 |
} |
|
186 |
} |
|
173 | 187 |
|
174 | 188 |
public void init(PolytomousKeyEditorInput input) { |
175 | 189 |
this.input = input; |
... | ... | |
203 | 217 |
viewer.setContentProvider(new PolytomousKeyListContentProvider()); |
204 | 218 |
viewer.setLabelProvider(new PolytomousKeyListLabelProvider()); |
205 | 219 |
|
206 |
//propagate selection
|
|
207 |
selectionChangedListener = (event -> selService.setSelection(AbstractUtility.getElementsFromSelectionChangedEvent(event)));
|
|
220 |
//propagate selection |
|
221 |
selectionChangedListener = (event -> selService.setSelection(event.getSelection()));
|
|
208 | 222 |
viewer.addSelectionChangedListener(selectionChangedListener); |
209 | 223 |
|
210 | 224 |
//create context menu |
... | ... | |
245 | 259 |
if(viewer!=null && viewer.getControl()!=null){ |
246 | 260 |
viewer.getControl().setFocus(); |
247 | 261 |
} |
262 |
if(input!=null){ |
|
263 |
input.bind(); |
|
264 |
} |
|
248 | 265 |
} |
249 | 266 |
|
250 | 267 |
@Override |
... | ... | |
261 | 278 |
viewer.update(child, null); |
262 | 279 |
} |
263 | 280 |
} |
264 |
|
|
281 |
dirty.setDirty(true); |
|
265 | 282 |
viewer.refresh(); |
266 | 283 |
|
267 | 284 |
} |
Also available in: Unified diff
ref #6908 Migrate polytomous key list and graph editor