Project

General

Profile

Revision 35c85fae

ID35c85fae4094553c6c0bc7cb2f4031131337798b
Parent eb759485
Child a8459c2d

Added by Patrick Plitzner about 3 years ago

ref #6909 Propagate TreeSelection

View differences:

eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorE4.java
52 52
import eu.etaxonomy.cdm.model.taxon.TaxonNodeByNameComparator;
53 53
import eu.etaxonomy.cdm.model.taxon.TaxonNodeByRankAndNameComparator;
54 54
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
55
import eu.etaxonomy.taxeditor.model.AbstractUtility;
56 55
import eu.etaxonomy.taxeditor.model.DataChangeBridge;
57 56
import eu.etaxonomy.taxeditor.model.IContextListener;
58 57
import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
......
124 123
        viewer.setLabelProvider(new TaxonNavigatorLabelProviderE4());
125 124

  
126 125
        //propagate selection
127
        selectionChangedListener = (event -> selService.setSelection(AbstractUtility.getElementsFromSelectionChangedEvent(event)));
126
        selectionChangedListener = (event -> selService.setSelection(event.getSelection()));
128 127
        viewer.addSelectionChangedListener(selectionChangedListener);
129 128

  
130 129
        //create context menu
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewClassificationHandlerE4.java
13 13

  
14 14
import org.eclipse.e4.core.di.annotations.Execute;
15 15
import org.eclipse.e4.ui.services.IServiceConstants;
16
import org.eclipse.jface.viewers.ITreeSelection;
16 17
import org.eclipse.jface.wizard.WizardDialog;
17 18
import org.eclipse.swt.widgets.Shell;
18 19

  
......
27 28
public class NewClassificationHandlerE4 {
28 29

  
29 30
    @Execute
30
    public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) {
31
    public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell,
32
            @Named(IServiceConstants.ACTIVE_SELECTION)ITreeSelection selection) {
31 33
		NewClassificationWizard wizard = new NewClassificationWizard();
32
		wizard.init(null, null);
34
		wizard.init(null, selection);
33 35
		WizardDialog dialog = new WizardDialog(shell, wizard);
34 36
		dialog.open();
35 37
	}
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewTaxonNodeHandlerE4.java
15 15
import org.eclipse.e4.core.di.annotations.CanExecute;
16 16
import org.eclipse.e4.core.di.annotations.Execute;
17 17
import org.eclipse.e4.ui.services.IServiceConstants;
18
import org.eclipse.jface.viewers.ITreeSelection;
18 19
import org.eclipse.jface.viewers.TreeSelection;
19 20
import org.eclipse.jface.wizard.WizardDialog;
20 21
import org.eclipse.swt.widgets.Shell;
......
32 33
public class NewTaxonNodeHandlerE4 {
33 34

  
34 35
    @Execute
35
    public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) throws Exception {
36
    public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell,
37
            @Named(IServiceConstants.ACTIVE_SELECTION)ITreeSelection selection) throws Exception {
36 38

  
37 39
		final NewTaxonNodeWizard wizard = new NewTaxonNodeWizard();
38
		wizard.init(null, null);
40
		wizard.init(null, selection);
39 41
		final WizardDialog dialog = new WizardDialog(shell, wizard);
40 42
		wizard.addWizardPageListener(new IWizardPageListener() {
41 43
		    @Override

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)