2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.preference
;
11 import org
.eclipse
.jface
.viewers
.StructuredSelection
;
12 import org
.eclipse
.jface
.wizard
.WizardDialog
;
13 import org
.eclipse
.swt
.events
.MouseAdapter
;
14 import org
.eclipse
.swt
.events
.MouseEvent
;
16 import eu
.etaxonomy
.cdm
.model
.common
.VocabularyEnum
;
17 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
18 import eu
.etaxonomy
.taxeditor
.preference
.wizards
.VocabularyTermWizard
;
19 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
20 import eu
.etaxonomy
.taxeditor
.store
.VocabularyStore
;
28 public class FeatureMenuPreferences
extends AbstractMenuPreferences
<Feature
> {
30 public static final String PLUGIN_ID
= "eu.etaxonomy.taxeditor.preferences.feature";
32 public FeatureMenuPreferences() {
33 super(VocabularyStore
.getFeatures(),
34 "Feature Preferences",
35 "Choose which features you would like to use for descriptive elements.",
40 * @see eu.etaxonomy.taxeditor.preference.AbstractMenuPreferences#addEditButtonListeners()
42 * TODO refactor into superclass
45 protected void addNewButtonListeners() {
46 newButton
.addMouseListener(new MouseAdapter(){
49 * @see org.eclipse.swt.events.MouseAdapter#mouseUp(org.eclipse.swt.events.MouseEvent)
52 public void mouseUp(MouseEvent e
) {
54 VocabularyTermWizard
<Feature
> wizard
= new VocabularyTermWizard
<Feature
>(VocabularyEnum
.Feature
);
56 WizardDialog dialog
= new WizardDialog(StoreUtil
.getShell(), wizard
);
59 tableViewer
.setInput(VocabularyStore
.getFeatures());
66 * @see eu.etaxonomy.taxeditor.preference.AbstractMenuPreferences#addEditButtonListeners()
68 * TODO refactor into superclass
71 // protected void addDeleteButtonListeners() {
72 // removeButton.addMouseListener(new MouseAdapter(){
75 // * @see org.eclipse.swt.events.MouseAdapter#mouseUp(org.eclipse.swt.events.MouseEvent)
78 // public void mouseUp(MouseEvent e) {
81 // Feature selected = (Feature) ((StructuredSelection) tableViewer.getSelection()).getFirstElement();
83 // VocabularyStore.delete(selected);
86 // tableViewer.setInput(VocabularyStore.getFeatures());