Revision 2d8daa57
Added by Patrick Plitzner almost 7 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java | ||
---|---|---|
84 | 84 |
private static final String SPECIMEN_EDITOR = Messages.DerivateView_SPECIMEN_EDITOR; |
85 | 85 |
|
86 | 86 |
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"; //$NON-NLS-1$ |
87 |
public static final String INPUT_ID = ID+".editorInput"; //$NON-NLS-1$ |
|
87 | 88 |
|
88 | 89 |
public static final String YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION = Messages.DerivateView_YOU_NEED_TO_SAVE; |
89 | 90 |
public static final String VIEW_HAS_UNSAVED_CHANGES = Messages.DerivateView_UNSAVED_CHANGES; |
... | ... | |
155 | 156 |
public DerivateView() { |
156 | 157 |
} |
157 | 158 |
|
158 |
|
|
159 | 159 |
/** |
160 | 160 |
* {@inheritDoc} |
161 | 161 |
*/ |
162 |
private void init(){
|
|
162 |
public void init(DerivateViewEditorInput editorInput){
|
|
163 | 163 |
this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>(); |
164 | 164 |
this.rootElements = new HashSet<SpecimenOrObservationBase<?>>(); |
165 | 165 |
|
166 |
//init tree |
|
167 |
Collection<UUID> derivativeUuids = editorInput.getDerivativeUuids(); |
|
168 |
checkWarnThreshold(derivativeUuids); |
|
169 |
updateRootEntities(derivativeUuids); |
|
170 |
//set taxon filter |
|
171 |
derivateSearchCompositeController.setTaxonFilter(editorInput.getTaxonUuid()); |
|
172 |
//reset status bar |
|
173 |
//TODO e4 |
|
174 |
// getEditorSite().getActionBars().getStatusLineManager().setMessage(""); //$NON-NLS-1$ |
|
175 |
} |
|
176 |
|
|
177 |
@PostConstruct |
|
178 |
public void createPartControl(Composite parent, EMenuService menuService) { |
|
166 | 179 |
if (CdmStore.isActive() && conversation == null) { |
167 | 180 |
conversation = CdmStore.createConversation(); |
168 | 181 |
} |
... | ... | |
171 | 184 |
} |
172 | 185 |
//listen to context changes |
173 | 186 |
CdmStore.getContextManager().addContextListener(this); |
174 |
} |
|
175 |
|
|
176 |
@PostConstruct |
|
177 |
public void createPartControl(Composite parent, EMenuService menuService) { |
|
178 |
init(); |
|
179 | 187 |
|
180 | 188 |
parent.setLayout(new GridLayout()); |
181 | 189 |
|
... | ... | |
211 | 219 |
|
212 | 220 |
//create context menu |
213 | 221 |
menuService.registerContextMenu(viewer.getControl(), "eu.etaxonomy.taxeditor.editor.popupmenu.specimeneditor"); |
214 |
// MenuManager menuManager = new MenuManager(); |
|
215 |
// menuManager.setRemoveAllWhenShown(true); |
|
216 |
// getSite().registerContextMenu(menuManager, viewer); |
|
217 |
// Control control = viewer.getControl(); |
|
218 |
// Menu menu = menuManager.createContextMenu(control); |
|
219 |
// control.setMenu(menu); |
|
220 |
|
|
221 |
//init tree |
|
222 |
//TODO e4 |
|
223 |
// Collection<UUID> derivativeUuids = ((DerivateViewEditorInput)getEditorInput()).getDerivativeUuids(); |
|
224 |
// checkWarnThreshold(derivativeUuids); |
|
225 |
// updateRootEntities(derivativeUuids); |
|
226 |
// set taxon filter |
|
227 |
//TODO e4 |
|
228 |
// derivateSearchCompositeController.setTaxonFilter(((DerivateViewEditorInput) getEditorInput()).getTaxonUuid()); |
|
229 |
//reset status bar |
|
230 |
//TODO e4 |
|
231 |
// getEditorSite().getActionBars().getStatusLineManager().setMessage(""); //$NON-NLS-1$ |
|
232 | 222 |
|
233 | 223 |
//add drag'n'drop support |
234 | 224 |
Transfer[] transfers = new Transfer[] {LocalSelectionTransfer.getTransfer(),}; |
... | ... | |
342 | 332 |
refreshTree(); |
343 | 333 |
} |
344 | 334 |
|
345 |
// @Override |
|
346 |
// public String getTitleToolTip() { |
|
347 |
//TODO e4 |
|
348 |
// return Messages.DerivateView_DERIVATIVE_EDITOR; |
|
349 |
// } |
|
350 |
|
|
351 | 335 |
/** |
352 | 336 |
* @param isDirty the isDirty to set |
353 | 337 |
*/ |
Also available in: Unified diff
ref #6566 Migrate "Open in" context menu for specimen editor