Revision 20dd6f72
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF | ||
---|---|---|
26 | 26 |
org.eclipse.e4.core.di.annotations;bundle-version="1.5.0", |
27 | 27 |
org.eclipse.e4.ui.services, |
28 | 28 |
org.eclipse.e4.ui.di, |
29 |
org.eclipse.e4.core.contexts |
|
29 |
org.eclipse.e4.core.contexts, |
|
30 |
org.eclipse.e4.core.services |
|
30 | 31 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 |
31 | 32 |
Import-Package: eu.etaxonomy.taxeditor.editor, |
32 | 33 |
org.eclipse.core.runtime, |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java | ||
---|---|---|
18 | 18 |
|
19 | 19 |
import org.eclipse.core.runtime.IProgressMonitor; |
20 | 20 |
import org.eclipse.core.runtime.NullProgressMonitor; |
21 |
import org.eclipse.e4.core.services.events.IEventBroker; |
|
22 |
import org.eclipse.e4.ui.di.Focus; |
|
21 | 23 |
import org.eclipse.e4.ui.di.Persist; |
22 | 24 |
import org.eclipse.e4.ui.model.application.ui.MDirtyable; |
23 | 25 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
... | ... | |
30 | 32 |
import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; |
31 | 33 |
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy; |
32 | 34 |
import org.eclipse.jface.viewers.ICellModifier; |
35 |
import org.eclipse.jface.viewers.ISelection; |
|
33 | 36 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
37 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
34 | 38 |
import org.eclipse.jface.viewers.ITableLabelProvider; |
35 | 39 |
import org.eclipse.jface.viewers.TableViewer; |
36 | 40 |
import org.eclipse.jface.viewers.TableViewerColumn; |
... | ... | |
48 | 52 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
49 | 53 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
50 | 54 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
55 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
|
51 | 56 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
52 | 57 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery; |
53 | 58 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput; |
59 |
import eu.etaxonomy.taxeditor.editor.ITaxonEditor; |
|
60 |
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants; |
|
54 | 61 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
55 | 62 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
56 | 63 |
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart; |
... | ... | |
71 | 78 |
*/ |
72 | 79 |
public class BulkEditorE4 implements IPartContentHasDetails, IConversationEnabled, IPostOperationEnabled, |
73 | 80 |
IDirtyMarkable, IDerivedUnitFacadePart, IPartContentHasFactualData, |
74 |
IPartContentHasSupplementalData, IPartContentHasMedia, IE4SavablePart { |
|
81 |
IPartContentHasSupplementalData, IPartContentHasMedia, IE4SavablePart, ITaxonEditor {
|
|
75 | 82 |
|
76 | 83 |
@Inject |
77 | 84 |
private MDirtyable dirty; |
... | ... | |
87 | 94 |
@Inject |
88 | 95 |
private ESelectionService selService; |
89 | 96 |
|
97 |
@Inject |
|
98 |
private IEventBroker eventBroker; |
|
99 |
|
|
90 | 100 |
private ISelectionChangedListener selectionChangedListener; |
91 | 101 |
|
92 | 102 |
@Inject |
... | ... | |
225 | 235 |
save(monitor, true); |
226 | 236 |
} |
227 | 237 |
|
238 |
@Focus |
|
239 |
public void setFocus() { |
|
240 |
//make sure to bind again if maybe in another view the conversation was unbound |
|
241 |
eventBroker.post(WorkbenchEventConstants.CURRENT_ACTIVE_EDITOR, this); |
|
242 |
} |
|
243 |
|
|
228 | 244 |
@PreDestroy |
229 | 245 |
public void dispose() { |
230 | 246 |
if(conversation!=null){ |
... | ... | |
386 | 402 |
|
387 | 403 |
} |
388 | 404 |
|
405 |
/** |
|
406 |
* {@inheritDoc} |
|
407 |
*/ |
|
408 |
@Override |
|
409 |
public Taxon getTaxon() { |
|
410 |
ISelection selection = viewer.getSelection(); |
|
411 |
if(selection instanceof IStructuredSelection |
|
412 |
&& ((IStructuredSelection) selection).size()==1) { |
|
413 |
Object object = ((IStructuredSelection) selection).iterator().next(); |
|
414 |
if(object instanceof Taxon){ |
|
415 |
return (Taxon) object; |
|
416 |
} |
|
417 |
} |
|
418 |
return null; |
|
419 |
} |
|
420 |
|
|
389 | 421 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
26 | 26 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; |
27 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; |
|
28 | 27 |
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor; |
29 | 28 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
30 |
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4; |
|
31 | 29 |
import eu.etaxonomy.taxeditor.editor.view.concept.ConceptContentProvider; |
32 | 30 |
import eu.etaxonomy.taxeditor.editor.view.concept.ConceptLabelProvider; |
33 | 31 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4; |
... | ... | |
35 | 33 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
36 | 34 |
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails; |
37 | 35 |
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData; |
38 |
import eu.etaxonomy.taxeditor.model.LineSelection; |
|
39 | 36 |
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4; |
40 | 37 |
import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4; |
41 | 38 |
import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4; |
... | ... | |
58 | 55 |
viewer.getControl().setEnabled(true); |
59 | 56 |
} |
60 | 57 |
Object partObject = createPartObject(activePart); |
58 |
IStructuredSelection structuredSelection = createSelection(selection); |
|
61 | 59 |
|
62 | 60 |
if (partObject instanceof DetailsPartE4 || partObject instanceof SupplementalDataPartE4 |
63 | 61 |
|| partObject instanceof FactualDataPartE4|| partObject instanceof MediaViewPartE4) { |
... | ... | |
65 | 63 |
// description selected in this view |
66 | 64 |
return; |
67 | 65 |
} |
68 |
else if(partObject instanceof BulkEditor && selection instanceof LineSelection){ |
|
69 |
if(((LineSelection) selection).getFirstElement() instanceof Taxon){ |
|
70 |
showViewer((LineSelection) selection, activePart, viewer); |
|
71 |
} |
|
72 |
else{ |
|
73 |
showEmptyPage(); |
|
74 |
} |
|
75 |
return; |
|
76 |
} |
|
77 | 66 |
else if(partObject instanceof AbstractGraphKeyEditor){ |
78 | 67 |
showEmptyPage(); |
79 | 68 |
} |
80 |
else if(partObject instanceof TaxonNameEditorE4){ |
|
81 |
Taxon taxon = ((TaxonNameEditorE4) partObject).getTaxon(); |
|
82 |
if(taxon!=null){ |
|
83 |
showViewer(new StructuredSelection(taxon), activePart, viewer); |
|
84 |
} |
|
69 |
else if(selection!=null){ |
|
70 |
showViewer(structuredSelection, activePart, viewer); |
|
85 | 71 |
} |
86 | 72 |
else { |
87 | 73 |
showEmptyPage(); |
Also available in: Unified diff
Fix concept relation view for bulk editor