Project

General

Profile

Download (1.47 KB) Statistics
| Branch: | Tag: | Revision:
1 88b34876 a.theys
/**
2
* Copyright (C) 2011 EDIT
3 5a35a97d Patric Plitzner
* European Distributed Institute of Taxonomy
4 88b34876 a.theys
* http://www.e-taxonomy.eu
5 5a35a97d Patric Plitzner
*
6 88b34876 a.theys
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9 e6a01da7 a.theys
package eu.etaxonomy.taxeditor.editor;
10
11
import org.eclipse.core.runtime.IProgressMonitor;
12
import org.eclipse.ui.IMemento;
13
14
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
15 41e2f693 Cherian Mathew
import eu.etaxonomy.taxeditor.model.MessagingUtils;
16 e6a01da7 a.theys
import eu.etaxonomy.taxeditor.store.CdmStore;
17 f638efaa Andreas Müller
import eu.etaxonomy.taxeditor.store.UseObjectStore;
18 e6a01da7 a.theys
19 88b34876 a.theys
/**
20 f638efaa Andreas Müller
 * The context listener will call this class when a new context is started.
21
 * It will reset the UseObjectStore to guarantee the static
22
 * content of the store will be refreshed each time we load a new context. 
23 5a35a97d Patric Plitzner
 * @author a.theys
24 f638efaa Andreas Müller
 * @author a.mueller
25 88b34876 a.theys
 * @created mar 13, 2012
26
 */
27 e6a01da7 a.theys
public class UseObjectManager extends ContextListenerAdapter{
28 5a35a97d Patric Plitzner
29 a20b4301 Andreas Müller
	public UseObjectManager() {
30
		CdmStore.getContextManager().addContextListener(this);
31
	}
32
33 5a35a97d Patric Plitzner
34 e6a01da7 a.theys
	@Override
35
	public void contextRefresh(IProgressMonitor monitor) {
36 f638efaa Andreas Müller
		monitor.subTask("Reset usage data");
37
		MessagingUtils.warn(getClass(), "Reset usage data");
38
		UseObjectStore.reset();
39 e6a01da7 a.theys
	}
40 5a35a97d Patric Plitzner
41
42 e6a01da7 a.theys
	@Override
43
	public void contextStart(IMemento memento, IProgressMonitor monitor) {
44 f638efaa Andreas Müller
//		monitor.subTask("Starting the Uses View");
45
//		MessagingUtils.warn(getClass(), "Starting Uses View warn");
46
		UseObjectStore.reset();
47 7ccbcd94 Andreas Müller
	}
48
49
50 e6a01da7 a.theys
}