Revision 69d856ba
Added by Katja Luther almost 10 years ago
- not running imports and exports deleted from menu
- preferences for concept relations fixed
- open taxon editor with one click in taxon navigator
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/handler/AbstractDynamicConceptRelationMenu.java | ||
---|---|---|
11 | 11 |
import org.eclipse.swt.widgets.MenuItem; |
12 | 12 |
import org.eclipse.ui.handlers.IHandlerService; |
13 | 13 |
|
14 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
|
14 | 15 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
15 | 16 |
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin; |
16 | 17 |
import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer; |
... | ... | |
33 | 34 |
@Override |
34 | 35 |
public void fill(Menu menu, int index){ |
35 | 36 |
final IHandlerService handlerService = (IHandlerService) TaxeditorEditorPlugin.getDefault().getWorkbench().getService(IHandlerService.class); |
36 |
|
|
37 |
/* |
|
37 | 38 |
for(final TaxonRelationshipTypeInverseContainer container : CdmStore.getTermManager().getPreferredTerms(TaxonRelationshipTypeInverseContainer.class)){ |
38 | 39 |
MenuItem menuItem = new MenuItem(menu, -1); |
39 | 40 |
menuItem.setText(container.getTitleCache()); |
... | ... | |
52 | 53 |
} |
53 | 54 |
} |
54 | 55 |
}); |
56 |
*/ |
|
57 |
for(final TaxonRelationshipType taxonRelationshipType: CdmStore.getTermManager().getPreferredTerms(TaxonRelationshipType.class)){ |
|
58 |
MenuItem menuItem = new MenuItem(menu, -1); |
|
59 |
menuItem.setText(taxonRelationshipType.getTitleCache()); |
|
60 |
menuItem.setData(taxonRelationshipType); |
|
61 |
menuItem.addSelectionListener(new SelectionListener(){ |
|
62 |
|
|
63 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
64 |
|
|
65 |
public void widgetSelected(SelectionEvent ev) { |
|
66 |
Event event = new Event(); |
|
67 |
event.data = taxonRelationshipType; |
|
68 |
try { |
|
69 |
handlerService.executeCommand(getCommandName(), event); |
|
70 |
} catch (Exception e) { |
|
71 |
EditorUtil.error(getClass(), "Error executing command", e); |
|
72 |
} |
|
73 |
} |
|
74 |
}); |
|
55 | 75 |
} |
56 | 76 |
} |
57 | 77 |
|
Also available in: Unified diff