Project

General

Profile

Download (2.22 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* 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

    
10
package eu.etaxonomy.taxeditor.navigation.key.polytomous.handler;
11

    
12
import org.eclipse.core.commands.AbstractHandler;
13
import org.eclipse.core.commands.ExecutionEvent;
14
import org.eclipse.core.commands.ExecutionException;
15
import org.eclipse.core.commands.IHandler;
16

    
17
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
18

    
19

    
20
/**
21
 * <p>RefreshPolytomousKeyNodesHandler class, which refreshes each key node in the polytomous key navigation view</p>
22
 *
23
 * @author c.mathew
24
 * @created Jan 17 2013
25
 * @version 1.0
26
 */
27
public class RefreshPolytomousKeyNodesHandler extends AbstractHandler implements IHandler {
28

    
29
    private static final String REFRESHING_POLYTOMOUS_KEY_NODES = Messages.RefreshPolytomousKeyNodesHandler_REFRESHING;
30

    
31
    @Override
32
	public Object execute(ExecutionEvent event) throws ExecutionException {
33
//		final PolytomousKeyViewPart view = (PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false);
34
//		final List<PolytomousKey> keys = view.getKeys();
35
//
36
//		final String label = Messages.RefreshPolytomousKeyNodesHandler_REFRESH;
37
//
38
//		final IUndoContext undoContext = NavigationUtil.getUndoContext();
39
//		if (keys.size() > 0) {
40
//			Job job = new Job(REFRESHING_POLYTOMOUS_KEY_NODES){
41
//
42
//					@Override
43
//					protected IStatus run(IProgressMonitor monitor) {
44
//						monitor.beginTask(REFRESHING_POLYTOMOUS_KEY_NODES, keys.size());
45
//
46
//
47
//							for (final PolytomousKey key : keys) {
48
//								if(key.getRoot() != null) {
49
//
50
//									Display.getDefault().asyncExec(new Runnable(){
51
//
52
//										@Override
53
//										public void run() {
54
//											AbstractPostOperation operation = new RefreshNodesOperation(label, undoContext, key, view);
55
//											NavigationUtil.executeOperation(operation);
56
//										}
57
//
58
//									});
59
//									monitor.worked(1);
60
//								}
61
//							}
62
//							monitor.done();
63
//							return Status.OK_STATUS;
64
//						}
65
//
66
//					};
67
//
68
//					job.setPriority(Job.SHORT);
69
//					job.schedule();
70
//
71
//				}
72
				return null;
73
			}
74
		}
75

    
(5-5/8)