Project

General

Profile

Download (1.61 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 150b624d Patrick Plitzner
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
15 e6a01da7 a.theys
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
16 41e2f693 Cherian Mathew
import eu.etaxonomy.taxeditor.model.MessagingUtils;
17 e6a01da7 a.theys
import eu.etaxonomy.taxeditor.store.CdmStore;
18 f638efaa Andreas Müller
import eu.etaxonomy.taxeditor.store.UseObjectStore;
19 e6a01da7 a.theys
20 88b34876 a.theys
/**
21 f638efaa Andreas Müller
 * The context listener will call this class when a new context is started.
22
 * It will reset the UseObjectStore to guarantee the static
23 ae137b34 Patrick Plitzner
 * content of the store will be refreshed each time we load a new context.
24 5a35a97d Patric Plitzner
 * @author a.theys
25 f638efaa Andreas Müller
 * @author a.mueller
26 88b34876 a.theys
 * @created mar 13, 2012
27
 */
28 e6a01da7 a.theys
public class UseObjectManager extends ContextListenerAdapter{
29 5a35a97d Patric Plitzner
30 ae137b34 Patrick Plitzner
    private static final String RESET_USAGE_DATA = Messages.UseObjectManager_RESET_DATA;
31
32
33
    public UseObjectManager() {
34 a20b4301 Andreas Müller
		CdmStore.getContextManager().addContextListener(this);
35
	}
36
37 5a35a97d Patric Plitzner
38 e6a01da7 a.theys
	@Override
39
	public void contextRefresh(IProgressMonitor monitor) {
40 ae137b34 Patrick Plitzner
		monitor.subTask(RESET_USAGE_DATA);
41
		MessagingUtils.warn(getClass(), RESET_USAGE_DATA);
42 f638efaa Andreas Müller
		UseObjectStore.reset();
43 e6a01da7 a.theys
	}
44 5a35a97d Patric Plitzner
45
46 e6a01da7 a.theys
	@Override
47
	public void contextStart(IMemento memento, IProgressMonitor monitor) {
48 f638efaa Andreas Müller
//		monitor.subTask("Starting the Uses View");
49
//		MessagingUtils.warn(getClass(), "Starting Uses View warn");
50
		UseObjectStore.reset();
51 7ccbcd94 Andreas Müller
	}
52
53
54 e6a01da7 a.theys
}