Project

General

Profile

« Previous | Next » 

Revision d17343e9

Added by Patrick Plitzner about 5 years ago

ref #6597 Propagate selection of details view

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsPartE4.java
16 16
import org.eclipse.e4.core.di.annotations.Optional;
17 17
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
18 18
import org.eclipse.e4.ui.services.IServiceConstants;
19
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
20
import org.eclipse.jface.viewers.ISelectionChangedListener;
19 21
import org.eclipse.jface.viewers.IStructuredSelection;
20 22
import org.eclipse.swt.widgets.Composite;
21 23

  
22 24
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
23 25
import eu.etaxonomy.cdm.model.description.Feature;
24 26
import eu.etaxonomy.taxeditor.l10n.Messages;
27
import eu.etaxonomy.taxeditor.model.AbstractUtility;
25 28
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
26 29
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
27 30
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
......
34 37
 */
35 38
public class DetailsPartE4 extends AbstractCdmEditorPartE4{
36 39

  
40
    private ISelectionChangedListener selectionChangedListener;
41

  
42
    @Inject
43
    private ESelectionService selService;
44

  
37 45
    @Inject
38 46
    public DetailsPartE4() {
39 47
    }
......
41 49
    @PostConstruct
42 50
    public void create(Composite parent) {
43 51
        viewer = new DetailsViewerE4(parent, this);
52

  
53
        // Propagate selection from viewer
54
        selectionChangedListener = (event -> selService.setSelection(AbstractUtility.getElementsFromSelectionChangedEvent(event)));
55
        viewer.addSelectionChangedListener(selectionChangedListener);
44 56
    }
45 57

  
46 58
    @Inject

Also available in: Unified diff