Project

General

Profile

Download (1.85 KB) Statistics
| Branch: | Tag: | Revision:
1

    
2
package eu.etaxonomy.taxeditor.navigation;
3

    
4
import org.eclipse.core.runtime.IProgressMonitor;
5
import org.eclipse.ui.IMemento;
6

    
7
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
8

    
9
/**
10
 * @author n.hoffmann
11
 * @created Apr 1, 2010
12
 * @version 1.0
13
 */
14
public class NavigatorStateManager extends ContextListenerAdapter {
15

    
16
	/**
17
	 * {@inheritDoc}
18
	 *
19
	 * Tries to restore the state of the taxon editor and the navigator when a context starts.
20
	 */
21
	@Override
22
	public void contextStart(IMemento memento, IProgressMonitor monitor) {
23
//		TaxonNavigatorE4 navigator = NavigationUtil.getNavigator(true);
24
//		if(navigator != null){
25
//			navigator.init();
26
//			if (PreferencesUtil.isStoreNavigatorState()){
27
//				navigator.restore(memento, monitor);
28
//			} else {
29
//				navigator.restore(null, monitor);
30
//			}
31
//
32
//		}
33
	}
34

    
35
	@Override
36
	public void contextRefresh(IProgressMonitor monitor) {
37
//		TaxonNavigatorE4 navigator = NavigationUtil.getNavigator(true);
38
//		if(navigator != null){
39
//			navigator.refresh();
40
//		}
41
	}
42

    
43
	/**
44
	 * {@inheritDoc}
45
	 *
46
	 * If the context
47
	 */
48
	@Override
49
	public void contextStop(IMemento memento, IProgressMonitor monitor) {
50
//		saveNavigatorState(memento, monitor);
51
//		clearNavigator();
52
	}
53

    
54
	/** {@inheritDoc} */
55
	@Override
56
	public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
57
//		saveNavigatorState(memento, monitor);
58

    
59
	}
60

    
61
	/**
62
	 * @param memento
63
	 */
64
	private void saveNavigatorState(IMemento memento, IProgressMonitor monitor) {
65
//		TaxonNavigatorE4 navigator = NavigationUtil.getNavigator(false);
66
//		if(navigator != null){
67
//		    //FIXME E4 migrate or delete
68
////			navigator.save(memento, monitor);
69
//		}
70
	}
71

    
72
	/**
73
	 * Removes all content form the TaxonNavigator
74
	 */
75
	private void clearNavigator() {
76
//		TaxonNavigatorE4 navigator = NavigationUtil.getNavigator(false);
77
//		if(navigator != null){
78
//			navigator.clear();
79
//		}
80
	}
81

    
82
}
(3-3/5)