Revision dbc398cf
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java | ||
---|---|---|
19 | 19 |
import javax.annotation.PreDestroy; |
20 | 20 |
import javax.inject.Inject; |
21 | 21 |
|
22 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
22 | 23 |
import org.eclipse.e4.ui.di.Focus; |
23 | 24 |
import org.eclipse.e4.ui.di.Persist; |
24 | 25 |
import org.eclipse.e4.ui.model.application.ui.MDirtyable; |
26 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
|
25 | 27 |
import org.eclipse.e4.ui.services.EMenuService; |
28 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
|
26 | 29 |
import org.eclipse.e4.ui.workbench.modeling.ESelectionService; |
27 | 30 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
28 | 31 |
import org.eclipse.jface.viewers.IStructuredSelection; |
... | ... | |
34 | 37 |
import org.eclipse.swt.events.SelectionAdapter; |
35 | 38 |
import org.eclipse.swt.events.SelectionEvent; |
36 | 39 |
import org.eclipse.swt.widgets.Composite; |
40 |
import org.eclipse.ui.IMemento; |
|
37 | 41 |
|
38 | 42 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
39 | 43 |
import eu.etaxonomy.cdm.api.service.IFeatureTreeService; |
40 | 44 |
import eu.etaxonomy.cdm.model.description.FeatureNode; |
41 | 45 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
42 | 46 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
47 |
import eu.etaxonomy.taxeditor.model.IContextListener; |
|
43 | 48 |
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails; |
44 | 49 |
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData; |
45 | 50 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
... | ... | |
55 | 60 |
* @date 06.06.2017 |
56 | 61 |
* |
57 | 62 |
*/ |
58 |
public class FeatureTreeEditor implements ICdmEntitySessionEnabled, |
|
59 |
ModifyListener, ISelectionChangedListener, IE4ViewerPart, IPartContentHasDetails, IPartContentHasSupplementalData {
|
|
63 |
public class FeatureTreeEditor implements ICdmEntitySessionEnabled, ModifyListener, ISelectionChangedListener,
|
|
64 |
IE4ViewerPart, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener {
|
|
60 | 65 |
|
61 | 66 |
private ConversationHolder conversation; |
62 | 67 |
|
... | ... | |
70 | 75 |
|
71 | 76 |
private FeatureTreeEditorComposite composite; |
72 | 77 |
|
78 |
@Inject |
|
79 |
private MPart thisPart; |
|
80 |
|
|
73 | 81 |
@Inject |
74 | 82 |
public FeatureTreeEditor() { |
83 |
CdmStore.getContextManager().addContextListener(this); |
|
75 | 84 |
} |
76 | 85 |
|
77 | 86 |
/** {@inheritDoc} */ |
... | ... | |
221 | 230 |
return root; |
222 | 231 |
} |
223 | 232 |
|
233 |
/** |
|
234 |
* {@inheritDoc} |
|
235 |
*/ |
|
236 |
@Override |
|
237 |
public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) { |
|
238 |
} |
|
239 |
|
|
240 |
/** |
|
241 |
* {@inheritDoc} |
|
242 |
*/ |
|
243 |
@Override |
|
244 |
public void contextStop(IMemento memento, IProgressMonitor monitor) { |
|
245 |
//close view when workbench closes |
|
246 |
try{ |
|
247 |
thisPart.getContext().get(EPartService.class).hidePart(thisPart); |
|
248 |
} |
|
249 |
catch(Exception e){ |
|
250 |
//nothing |
|
251 |
} |
|
252 |
} |
|
253 |
|
|
254 |
/** |
|
255 |
* {@inheritDoc} |
|
256 |
*/ |
|
257 |
@Override |
|
258 |
public void contextStart(IMemento memento, IProgressMonitor monitor) { |
|
259 |
} |
|
260 |
|
|
261 |
/** |
|
262 |
* {@inheritDoc} |
|
263 |
*/ |
|
264 |
@Override |
|
265 |
public void contextRefresh(IProgressMonitor monitor) { |
|
266 |
} |
|
267 |
|
|
268 |
/** |
|
269 |
* {@inheritDoc} |
|
270 |
*/ |
|
271 |
@Override |
|
272 |
public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) { |
|
273 |
} |
|
274 |
|
|
224 | 275 |
} |
Also available in: Unified diff
ref #6922, #6925 Close editors when reconnecting