* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
* @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
* @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
* @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
* @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
super(formFactory, conversation, parentElement, selectionProvider, style);
super(formFactory, conversation, parentElement, selectionProvider, style);
- ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
-
- //choose name
- Action chooseNameAction = new Action("Choose Name", IAction.AS_PUSH_BUTTON){
- @Override
- public void run() {
- TaxonNameBase taxonName = NameSelectionDialog.select(getShell(), getConversationHolder(), null);
- if(taxonName!=null){
- if(taxonName.isInstanceOf(NonViralName.class)){
- CdmStore.getService(ITaxonNodeService.class).list(TaxonNode.class, null, null, null, null);
- NonViralName nonViralName = HibernateProxyHelper.deproxy(taxonName, NonViralName.class);
- taxonBase.setName(nonViralName);
- // taxonBase.getTitleCache();
- setEntity(nonViralName);
- firePropertyChangeEvent(NonViralNameDetailSection.this);
- }
- else{
- MessagingUtils.warningDialog("Invalid name", this, "The selected name can not be used for this taxon.");
- }
- }
- }
- };
- chooseNameAction.setToolTipText("Choose name for this taxon");
- chooseNameAction.setImageDescriptor(ImageResources.getImageDescriptor(ImageResources.BROWSE_ICON));
-
- toolBarManager.add(chooseNameAction);
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+
+ if(nameChoosable){
+ //choose name
+ Action chooseNameAction = new Action("Choose Name", IAction.AS_PUSH_BUTTON){
+ @Override
+ public void run() {
+ TaxonNameBase taxonName = NameSelectionDialog.select(getShell(), getConversationHolder(), null);
+ if(taxonName!=null){
+ if(taxonName.isInstanceOf(NonViralName.class)){
+ CdmStore.getService(ITaxonNodeService.class).list(TaxonNode.class, null, null, null, null);
+ NonViralName nonViralName = HibernateProxyHelper.deproxy(taxonName, NonViralName.class);
+ taxonBase.setName(nonViralName);
+ // taxonBase.getTitleCache();
+ setEntity(nonViralName);
+ firePropertyChangeEvent(NonViralNameDetailSection.this);
+ }
+ else{
+ MessagingUtils.warningDialog("Invalid name", this, "The selected name can not be used for this taxon.");
+ }
+ }
+ }
+ };
+ chooseNameAction.setToolTipText("Choose name for this taxon");
+ chooseNameAction.setImageDescriptor(ImageResources.getImageDescriptor(ImageResources.BROWSE_ICON));
+
+ toolBarManager.add(chooseNameAction);
+ }