Revision ffa3cdff
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java | ||
---|---|---|
120 | 120 |
} |
121 | 121 |
|
122 | 122 |
Collection<MPart> parts = partService.getParts(); |
123 |
MPart part = null; |
|
124 | 123 |
//check if part is already opened |
125 |
for (MPart mPart : parts) { |
|
126 |
if(mPart.getObject() instanceof TaxonNameEditorE4 |
|
127 |
&& ((TaxonNameEditorE4) mPart.getObject()).getTaxon()!=null |
|
128 |
&& ((TaxonNameEditorE4) mPart.getObject()).getTaxon().equals(input.getTaxon())){ |
|
129 |
part = mPart; |
|
124 |
for (MPart part : parts) { |
|
125 |
if(part.getObject() instanceof TaxonNameEditorE4 |
|
126 |
&& ((TaxonNameEditorE4) part.getObject()).getTaxon()!=null |
|
127 |
&& ((TaxonNameEditorE4) part.getObject()).getTaxon().equals(input.getTaxon())){ |
|
128 |
//close part to invoke refresh for new part |
|
129 |
partService.hidePart(part); |
|
130 | 130 |
break; |
131 | 131 |
} |
132 | 132 |
} |
133 |
if(part==null){ |
|
134 |
part = partService.createPart(NAME_EDITOR_ID); |
|
135 |
|
|
136 |
MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService); |
|
137 |
if(editorAreaPartStack!=null){ |
|
138 |
editorAreaPartStack.getChildren().add(part); |
|
139 |
} |
|
140 |
part = partService.showPart(part, PartState.ACTIVATE); |
|
133 |
MPart part = partService.createPart(NAME_EDITOR_ID); |
|
141 | 134 |
|
142 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject(); |
|
143 |
editor.init(input); |
|
144 |
} |
|
145 |
else{ |
|
146 |
part = partService.showPart(part, PartState.ACTIVATE); |
|
135 |
MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService); |
|
136 |
if(editorAreaPartStack!=null){ |
|
137 |
editorAreaPartStack.getChildren().add(part); |
|
147 | 138 |
} |
139 |
part = partService.showPart(part, PartState.ACTIVATE); |
|
140 |
|
|
141 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject(); |
|
142 |
editor.init(input); |
|
148 | 143 |
} |
149 | 144 |
|
150 | 145 |
/** |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/MoveSynonymToAnotherAcceptedTaxonHandlerE4.java | ||
---|---|---|
51 | 51 |
@Inject |
52 | 52 |
private MApplication application; |
53 | 53 |
|
54 |
@Inject |
|
55 |
private MPart activePart; |
|
56 |
|
|
54 | 57 |
@Execute |
55 | 58 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
56 | 59 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
57 | 60 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, EPartService partService, |
58 | 61 |
UISynchronize sync) { |
59 | 62 |
|
63 |
this.activePart = activePart; |
|
60 | 64 |
this.partService = partService; |
61 | 65 |
|
62 | 66 |
editor = (TaxonNameEditorE4) activePart.getObject(); |
... | ... | |
110 | 114 |
|
111 | 115 |
@Override |
112 | 116 |
public boolean onComplete() { |
117 |
partService.hidePart(activePart); |
|
113 | 118 |
EditorUtil.openTaxonNodeE4(newParentNode.getUuid(), modelService, partService, application); |
114 | 119 |
return true; |
115 | 120 |
} |
Also available in: Unified diff
ref #6595 Another fix for "move synonym to another taxon" handler