Revision 8faa9f3b
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeSynonymToAcceptedTaxonHandlerE4.java | ||
---|---|---|
22 | 22 |
import org.eclipse.jface.viewers.IStructuredSelection; |
23 | 23 |
import org.eclipse.swt.widgets.Shell; |
24 | 24 |
import org.eclipse.ui.IEditorInput; |
25 |
import org.eclipse.ui.PartInitException; |
|
25 | 26 |
|
26 | 27 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
27 | 28 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
... | ... | |
36 | 37 |
import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester; |
37 | 38 |
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToAcceptedTaxonOperation; |
38 | 39 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
40 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
39 | 41 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
40 | 42 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog; |
41 | 43 |
|
... | ... | |
112 | 114 |
|
113 | 115 |
// Open new unsaved editor with existing taxon's parent as temporary parent |
114 | 116 |
TaxonNode newNode = (TaxonNode) objectAffectedByOperation; |
115 |
// TaxonNode newNode = parentNode.addChild(newTaxon); |
|
116 |
|
|
117 |
// try { |
|
118 |
// FIXME E4 this throws an exception |
|
119 |
// EditorUtil.openTaxonNodeE4(newNode.getUuid()); |
|
120 |
// |
|
121 |
// } catch (PartInitException e) { |
|
122 |
// e.printStackTrace(); |
|
123 |
// } catch (Exception e) { |
|
124 |
// MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonHandler_CREATE_FAILURE, this, e.getMessage()); |
|
125 |
// } |
|
117 |
|
|
118 |
try { |
|
119 |
EditorUtil.openTaxonNodeE4(newNode.getUuid()); |
|
120 |
} catch (PartInitException e) { |
|
121 |
e.printStackTrace(); |
|
122 |
} catch (Exception e) { |
|
123 |
MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonHandler_CREATE_FAILURE, this, e.getMessage()); |
|
124 |
} |
|
126 | 125 |
} |
127 | 126 |
return true; |
128 | 127 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java | ||
---|---|---|
33 | 33 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
34 | 34 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; |
35 | 35 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; |
36 |
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor; |
|
37 | 36 |
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor; |
38 | 37 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
38 |
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4; |
|
39 | 39 |
import eu.etaxonomy.taxeditor.editor.view.concept.ConceptContentProvider; |
40 | 40 |
import eu.etaxonomy.taxeditor.editor.view.concept.ConceptLabelProvider; |
41 | 41 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
42 | 42 |
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails; |
43 | 43 |
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData; |
44 | 44 |
import eu.etaxonomy.taxeditor.model.LineSelection; |
45 |
import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart; |
|
46 | 45 |
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4; |
47 |
import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart; |
|
46 |
import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4; |
|
47 |
import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4; |
|
48 | 48 |
|
49 | 49 |
/** |
50 | 50 |
* |
... | ... | |
72 | 72 |
|
73 | 73 |
Object partObject = createPartObject(activePart); |
74 | 74 |
|
75 |
if (partObject instanceof DetailsViewPart || partObject instanceof SupplementalDataViewPart) {
|
|
75 |
if (partObject instanceof DetailsPartE4 || partObject instanceof SupplementalDataPartE4) {
|
|
76 | 76 |
// do not show empty page as these views are also used to edit the |
77 | 77 |
// description selected in this view |
78 | 78 |
return; |
... | ... | |
89 | 89 |
else if(partObject instanceof AbstractGraphKeyEditor){ |
90 | 90 |
showEmptyPage(); |
91 | 91 |
} |
92 |
else if(partObject instanceof MultiPageTaxonEditor){
|
|
92 |
else if(partObject instanceof TaxonNameEditorE4){
|
|
93 | 93 |
IEditorInput input = ((IEditorPart) partObject).getEditorInput(); |
94 | 94 |
showViewer(new StructuredSelection(input), activePart, viewer); |
95 | 95 |
} |
... | ... | |
99 | 99 |
|
100 | 100 |
} |
101 | 101 |
|
102 |
//FIXME E4 implement |
|
103 |
// @Override |
|
104 |
// protected String createPartTitle(Object selectedObject) { |
|
105 |
// if(selectedObject instanceof TaxonEditorInput){ |
|
106 |
// return super.createPartTitle(((TaxonEditorInput) selectedObject).getTaxon()); |
|
107 |
// } |
|
108 |
// return super.createPartTitle(selectedObject); |
|
109 |
// } |
|
110 |
|
|
111 | 102 |
@PostConstruct |
112 |
public void create(Composite parent, EMenuService menuService) { |
|
103 |
public void create(Composite parent, EMenuService menuService, MPart thisPart) { |
|
104 |
|
|
105 |
this.thisPart = thisPart; |
|
113 | 106 |
|
114 | 107 |
ConceptRelationViewer conceptViewer = new ConceptRelationViewer(parent); |
115 | 108 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/e4/MediaViewPartE4.java | ||
---|---|---|
57 | 57 |
private ESelectionService selService; |
58 | 58 |
|
59 | 59 |
@PostConstruct |
60 |
public void create(Composite parent, EMenuService menuService) { |
|
60 |
public void create(Composite parent, EMenuService menuService, MPart thisPart) {
|
|
61 | 61 |
|
62 |
this.thisPart = thisPart; |
|
62 | 63 |
TreeViewer treeViewer = new TreeViewer(new Tree(parent, SWT.H_SCROLL |
63 | 64 |
| SWT.V_SCROLL | SWT.FULL_SELECTION)); |
64 | 65 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPartE4.java | ||
---|---|---|
44 | 44 |
|
45 | 45 |
protected Viewer viewer; |
46 | 46 |
|
47 |
protected MPart thisPart; |
|
48 |
|
|
47 | 49 |
protected MPart selectionProvidingPart; |
48 | 50 |
|
49 | 51 |
/** {@inheritDoc} */ |
... | ... | |
61 | 63 |
} |
62 | 64 |
} |
63 | 65 |
} |
66 |
if(object!=null){ |
|
67 |
createPartTitle(object); |
|
68 |
} |
|
69 |
} |
|
70 |
|
|
71 |
protected void createPartTitle(Object selectedObject){ |
|
72 |
if(thisPart!=null){ |
|
73 |
if(selectedObject!=null){ |
|
74 |
thisPart.setLabel(getViewName()+": "+selectedObject); //$NON-NLS-1$ |
|
75 |
} |
|
76 |
else{ |
|
77 |
thisPart.setLabel(getViewName()); |
|
78 |
} |
|
79 |
} |
|
64 | 80 |
} |
65 | 81 |
|
66 | 82 |
public Viewer getViewer() { |
... | ... | |
96 | 112 |
} |
97 | 113 |
viewer.setInput(element); |
98 | 114 |
|
115 |
createPartTitle(element); |
|
99 | 116 |
|
100 | 117 |
} |
101 | 118 |
selectionProvidingPart = activePart; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsPartE4.java | ||
---|---|---|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
@PostConstruct |
50 |
public void create(Composite parent) { |
|
50 |
public void create(Composite parent, MPart thisPart) { |
|
51 |
|
|
52 |
this.thisPart = thisPart; |
|
53 |
|
|
51 | 54 |
viewer = new DetailsViewerE4(parent, this); |
52 | 55 |
|
53 | 56 |
// Propagate selection from viewer |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/supplementaldata/SupplementalDataPartE4.java | ||
---|---|---|
48 | 48 |
} |
49 | 49 |
|
50 | 50 |
@PostConstruct |
51 |
public void create(Composite parent) { |
|
52 |
viewer = new SupplementalDataViewerE4(parent, this); |
|
51 |
public void create(Composite parent, MPart thisPart) { |
|
52 |
|
|
53 |
this.thisPart = thisPart; |
|
54 |
|
|
55 |
viewer = new SupplementalDataViewerE4(parent, this); |
|
53 | 56 |
} |
54 | 57 |
|
55 | 58 |
@Inject |
Also available in: Unified diff
ref #6925 Update part titles