Revision 30189b61
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewClassificationHandlerE4.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import javax.inject.Named; |
13 | 13 |
|
14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
|
14 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
15 | 16 |
import org.eclipse.e4.core.di.annotations.Optional; |
17 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
|
16 | 18 |
import org.eclipse.e4.ui.services.IServiceConstants; |
17 | 19 |
import org.eclipse.jface.viewers.ITreeSelection; |
18 | 20 |
import org.eclipse.jface.wizard.WizardDialog; |
19 | 21 |
import org.eclipse.swt.widgets.Shell; |
20 | 22 |
|
23 |
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodePropertyTester; |
|
21 | 24 |
import eu.etaxonomy.taxeditor.newWizard.NewClassificationWizard; |
25 |
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys; |
|
26 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
|
22 | 27 |
|
23 | 28 |
/** |
24 | 29 |
* |
... | ... | |
37 | 42 |
dialog.open(); |
38 | 43 |
|
39 | 44 |
} |
45 |
|
|
46 |
@CanExecute |
|
47 |
private boolean canExecute(MHandledMenuItem menuItem){ |
|
48 |
boolean canExecute = false; |
|
49 |
|
|
50 |
canExecute = TaxonNodePropertyTester.noClassifiactionExists() || !PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISABLE_MULTI_CLASSIFICATION); |
|
51 |
menuItem.setVisible(canExecute); |
|
52 |
return canExecute; |
|
53 |
} |
|
40 | 54 |
} |
Also available in: Unified diff
ref #7793: add cdm preference to disable multi classification functionality