Revision 60dffe1d
Added by Andreas Müller over 7 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java | ||
---|---|---|
29 | 29 |
*/ |
30 | 30 |
public class OpenParentHandler extends AbstractHandler implements IHandler { |
31 | 31 |
|
32 |
/* (non-Javadoc) |
|
33 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
34 |
*/ |
|
35 | 32 |
/** {@inheritDoc} */ |
36 | 33 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
37 |
Taxon parent = EditorUtil.getActiveMultiPageTaxonEditor().getTaxon().getTaxonomicParent(); |
|
38 |
|
|
39 |
if(parent != null){ |
|
40 |
try { |
|
41 |
EditorUtil.openTaxonNode(parent.getUuid()); |
|
42 |
} catch (PartInitException e) { |
|
43 |
throw new RuntimeException("Error opening parent taxon", e); |
|
44 |
} catch (Exception e) { |
|
45 |
MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage()); |
|
46 |
} |
|
47 |
} |
|
48 |
|
|
49 |
return null; |
|
34 |
throw new RuntimeException("Open parent not supported anymore"); |
|
35 |
// Taxon parent = EditorUtil.getActiveMultiPageTaxonEditor().getTaxon().getTaxonomicParent(); |
|
36 |
// |
|
37 |
// if(parent != null){ |
|
38 |
// try { |
|
39 |
// EditorUtil.openTaxonNode(parent.getUuid()); |
|
40 |
// } catch (PartInitException e) { |
|
41 |
// throw new RuntimeException("Error opening parent taxon", e); |
|
42 |
// } catch (Exception e) { |
|
43 |
// MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage()); |
|
44 |
// } |
|
45 |
// } |
|
46 |
// |
|
47 |
// return null; |
|
50 | 48 |
} |
51 | 49 |
} |
Also available in: Unified diff
ref #6089 Fix not compiling operation