1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2017 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;
|
11
|
|
12
|
import java.util.Arrays;
|
13
|
import java.util.List;
|
14
|
|
15
|
import org.eclipse.e4.ui.model.application.MApplication;
|
16
|
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
17
|
import org.eclipse.e4.ui.workbench.lifecycle.PostContextCreate;
|
18
|
import org.eclipse.e4.ui.workbench.lifecycle.PreSave;
|
19
|
import org.eclipse.e4.ui.workbench.lifecycle.ProcessAdditions;
|
20
|
import org.eclipse.e4.ui.workbench.lifecycle.ProcessRemovals;
|
21
|
import org.eclipse.e4.ui.workbench.modeling.EModelService;
|
22
|
|
23
|
/**
|
24
|
* @author pplitzner
|
25
|
* @date 05.07.2017
|
26
|
*
|
27
|
*/
|
28
|
public class LifeCycleManager {
|
29
|
|
30
|
private static final String NON_RESTORE = "nonRestore";
|
31
|
|
32
|
@PostContextCreate
|
33
|
private void postContextCreate() {
|
34
|
}
|
35
|
|
36
|
@ProcessAdditions
|
37
|
private void processAdditions() {
|
38
|
}
|
39
|
|
40
|
@ProcessRemovals
|
41
|
private void processRemovals() {
|
42
|
}
|
43
|
|
44
|
@PreSave
|
45
|
private void preSave(EModelService modelService, MApplication application){
|
46
|
List<MPart> elements = modelService.findElements(application, null, MPart.class, Arrays.asList(NON_RESTORE));
|
47
|
for (MPart part : elements) {
|
48
|
part.setToBeRendered(false);
|
49
|
}
|
50
|
}
|
51
|
|
52
|
}
|