Project

General

Profile

Download (2.68 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
package eu.etaxonomy.taxeditor.preference;
10

    
11
import org.eclipse.jface.wizard.WizardDialog;
12
import org.eclipse.swt.events.MouseAdapter;
13
import org.eclipse.swt.events.MouseEvent;
14

    
15
import eu.etaxonomy.cdm.model.common.VocabularyEnum;
16
import eu.etaxonomy.cdm.model.description.Feature;
17
import eu.etaxonomy.taxeditor.preference.wizards.VocabularyTermWizard;
18
import eu.etaxonomy.taxeditor.store.StoreUtil;
19
import eu.etaxonomy.taxeditor.store.VocabularyStore;
20

    
21
/**
22
 * @author p.ciardelli
23
 * @created 17.09.2008
24
 * @version 1.0
25
 * @author n.hoffmann
26
 */
27
public class FeatureMenuPreferences extends AbstractMenuPreferences<Feature> {
28

    
29
	public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.preferences.feature";
30
	
31
	public FeatureMenuPreferences() {
32
		super(VocabularyStore.getFeatures(), 
33
				"Feature Preferences", 
34
				"Choose which features you would like to use for descriptive elements.", 
35
				true);
36
	}
37
	
38
	/* (non-Javadoc)
39
	 * @see eu.etaxonomy.taxeditor.preference.AbstractMenuPreferences#addEditButtonListeners()
40
	 * 
41
	 * TODO refactor into superclass
42
	 */
43
	@Override
44
	protected void addNewButtonListeners() {
45
		newButton.addMouseListener(new MouseAdapter(){
46

    
47
			/* (non-Javadoc)
48
			 * @see org.eclipse.swt.events.MouseAdapter#mouseUp(org.eclipse.swt.events.MouseEvent)
49
			 */
50
			@Override
51
			public void mouseUp(MouseEvent e) {
52
				super.mouseUp(e);
53
				VocabularyTermWizard<Feature> wizard = new VocabularyTermWizard<Feature>(VocabularyEnum.Feature); 
54
				
55
				WizardDialog dialog = new WizardDialog(StoreUtil.getShell(), wizard);
56
			    dialog.open();
57
			    
58
			    tableViewer.setInput(VocabularyStore.getFeatures());
59
			}
60
			
61
		});
62
	}
63
	
64
	/* (non-Javadoc)
65
	 * @see eu.etaxonomy.taxeditor.preference.AbstractMenuPreferences#addEditButtonListeners()
66
	 * 
67
	 * TODO refactor into superclass
68
	 */
69
//	@Override
70
//	protected void addDeleteButtonListeners() {
71
//		removeButton.addMouseListener(new MouseAdapter(){
72
//
73
//			/* (non-Javadoc)
74
//			 * @see org.eclipse.swt.events.MouseAdapter#mouseUp(org.eclipse.swt.events.MouseEvent)
75
//			 */
76
//			@Override
77
//			public void mouseUp(MouseEvent e) {
78
//				super.mouseUp(e);
79
//
80
//				Feature selected = (Feature) ((StructuredSelection) tableViewer.getSelection()).getFirstElement();
81
//			    
82
//				VocabularyStore.delete(selected);
83
//				
84
//				
85
//			    tableViewer.setInput(VocabularyStore.getFeatures());
86
//			}
87
//			
88
//		});
89
//	}
90
}
(6-6/19)