import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PartInitException;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToAcceptedTaxonOperation;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
// Open new unsaved editor with existing taxon's parent as temporary parent
TaxonNode newNode = (TaxonNode) objectAffectedByOperation;
-// TaxonNode newNode = parentNode.addChild(newTaxon);
-
-// try {
- // FIXME E4 this throws an exception
-// EditorUtil.openTaxonNodeE4(newNode.getUuid());
-//
-// } catch (PartInitException e) {
-// e.printStackTrace();
-// } catch (Exception e) {
-// MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonHandler_CREATE_FAILURE, this, e.getMessage());
-// }
+
+ try {
+ EditorUtil.openTaxonNodeE4(newNode.getUuid());
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ } catch (Exception e) {
+ MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonHandler_CREATE_FAILURE, this, e.getMessage());
+ }
}
return true;
}
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
import eu.etaxonomy.taxeditor.editor.view.concept.ConceptContentProvider;
import eu.etaxonomy.taxeditor.editor.view.concept.ConceptLabelProvider;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.model.LineSelection;
-import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
-import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart;
+import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
+import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
/**
*
Object partObject = createPartObject(activePart);
- if (partObject instanceof DetailsViewPart || partObject instanceof SupplementalDataViewPart) {
+ if (partObject instanceof DetailsPartE4 || partObject instanceof SupplementalDataPartE4) {
// do not show empty page as these views are also used to edit the
// description selected in this view
return;
else if(partObject instanceof AbstractGraphKeyEditor){
showEmptyPage();
}
- else if(partObject instanceof MultiPageTaxonEditor){
+ else if(partObject instanceof TaxonNameEditorE4){
IEditorInput input = ((IEditorPart) partObject).getEditorInput();
showViewer(new StructuredSelection(input), activePart, viewer);
}
}
- //FIXME E4 implement
-// @Override
-// protected String createPartTitle(Object selectedObject) {
-// if(selectedObject instanceof TaxonEditorInput){
-// return super.createPartTitle(((TaxonEditorInput) selectedObject).getTaxon());
-// }
-// return super.createPartTitle(selectedObject);
-// }
-
@PostConstruct
- public void create(Composite parent, EMenuService menuService) {
+ public void create(Composite parent, EMenuService menuService, MPart thisPart) {
+
+ this.thisPart = thisPart;
ConceptRelationViewer conceptViewer = new ConceptRelationViewer(parent);
private ESelectionService selService;
@PostConstruct
- public void create(Composite parent, EMenuService menuService) {
+ public void create(Composite parent, EMenuService menuService, MPart thisPart) {
+ this.thisPart = thisPart;
TreeViewer treeViewer = new TreeViewer(new Tree(parent, SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION));
protected Viewer viewer;
+ protected MPart thisPart;
+
protected MPart selectionProvidingPart;
/** {@inheritDoc} */
}
}
}
+ if(object!=null){
+ createPartTitle(object);
+ }
+ }
+
+ protected void createPartTitle(Object selectedObject){
+ if(thisPart!=null){
+ if(selectedObject!=null){
+ thisPart.setLabel(getViewName()+": "+selectedObject); //$NON-NLS-1$
+ }
+ else{
+ thisPart.setLabel(getViewName());
+ }
+ }
}
public Viewer getViewer() {
}
viewer.setInput(element);
+ createPartTitle(element);
}
selectionProvidingPart = activePart;
}
@PostConstruct
- public void create(Composite parent) {
+ public void create(Composite parent, MPart thisPart) {
+
+ this.thisPart = thisPart;
+
viewer = new DetailsViewerE4(parent, this);
// Propagate selection from viewer
}
@PostConstruct
- public void create(Composite parent) {
- viewer = new SupplementalDataViewerE4(parent, this);
+ public void create(Composite parent, MPart thisPart) {
+
+ this.thisPart = thisPart;
+
+ viewer = new SupplementalDataViewerE4(parent, this);
}
@Inject