+ @Override
+ protected Control createToolbar() {
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+
+ if(taxonChoosable){
+ //choose name
+ Action chooseTaxonAction = new Action("Choose Taxon", IAction.AS_PUSH_BUTTON){
+ @Override
+ public void run() {
+ Taxon taxon = TaxonBaseSelectionDialog.selectTaxon(getShell(), //getConversationHolder(),
+ getEntity().getFromTaxon());
+ if(taxon!=null){
+ taxon = HibernateProxyHelper.deproxy(taxon);
+ name = taxon.getName();
+ TaxonRelationship rel = getEntity();
+ rel.setFromTaxon(taxon);
+ taxon.addTaxonRelation(rel);
+ setEntity(rel);
+ setTaxonBase(taxon);
+// firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
+ detailElement.firePropertyChangeEvent(new CdmPropertyChangeEvent(detailElement, null));
+ EventUtility.postEvent(WorkbenchEventConstants.REFRESH_DETAILS, true);
+ EventUtility.postEvent(WorkbenchEventConstants.REFRESH_SUPPLEMENTAL, true);
+ EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAME_EDITOR, rel.getToTaxon());
+ ((TaxonRelationshipDetailElement)detailElement).getTaxonElement().setSelected(true);;
+
+
+ }
+ }
+ };
+ chooseTaxonAction.setToolTipText("Choose taxon for this Relationship");
+ chooseTaxonAction.setImageDescriptor(ImageResources.getImageDescriptor(ImageResources.BROWSE_ICON));
+
+ toolBarManager.add(chooseTaxonAction);
+ }
+ return toolBarManager.createControl(this);
+ }
+
+
+