1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 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.editor.definedterm.handler;
|
11
|
|
12
|
import java.util.HashMap;
|
13
|
import java.util.Map;
|
14
|
|
15
|
import org.eclipse.jface.action.IContributionItem;
|
16
|
import org.eclipse.swt.SWT;
|
17
|
import org.eclipse.ui.PlatformUI;
|
18
|
import org.eclipse.ui.actions.CompoundContributionItem;
|
19
|
import org.eclipse.ui.menus.CommandContributionItem;
|
20
|
import org.eclipse.ui.menus.CommandContributionItemParameter;
|
21
|
|
22
|
/**
|
23
|
* @author l.morris
|
24
|
* @date 4 Jan 2012
|
25
|
*
|
26
|
*/
|
27
|
public class OpenDefinedTermMenu extends CompoundContributionItem {
|
28
|
|
29
|
/**
|
30
|
*
|
31
|
*/
|
32
|
public OpenDefinedTermMenu() {
|
33
|
// TODO Auto-generated constructor stub
|
34
|
}
|
35
|
|
36
|
/**
|
37
|
* @param id
|
38
|
*/
|
39
|
public OpenDefinedTermMenu(String id) {
|
40
|
super(id);
|
41
|
// TODO Auto-generated constructor stub
|
42
|
}
|
43
|
|
44
|
/* (non-Javadoc)
|
45
|
* @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
|
46
|
*/
|
47
|
@Override
|
48
|
protected IContributionItem[] getContributionItems() {
|
49
|
// TODO Auto-generated method stub
|
50
|
return null;
|
51
|
}
|
52
|
|
53
|
/**
|
54
|
* @param key
|
55
|
* @param object
|
56
|
* @return
|
57
|
*/
|
58
|
private IContributionItem createContributionItem(String label,
|
59
|
String inputType) {
|
60
|
CommandContributionItemParameter parameter = new CommandContributionItemParameter(
|
61
|
PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null,
|
62
|
"eu.etaxonomy.taxeditor.store.definedterm.menu.open", SWT.NONE);
|
63
|
|
64
|
parameter.label = label;
|
65
|
|
66
|
Map parameters = new HashMap();
|
67
|
parameters.put("eu.etaxonomy.taxeditor.store.definedterm.menu.open", inputType);
|
68
|
parameter.parameters = parameters;
|
69
|
|
70
|
return new CommandContributionItem(parameter);
|
71
|
}
|
72
|
|
73
|
}
|