Project

General

Profile

Revision 4d98dfd9

ID4d98dfd97a353d6e1ad7d3297e7ae64c00064a15
Parent f716539d
Child f08ae629

Added by Patrick Plitzner about 3 years ago

ref #6694 Implement selection propagation in feature tree editor

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java
16 16
import javax.inject.Named;
17 17

  
18 18
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.e4.ui.di.Focus;
19 20
import org.eclipse.e4.ui.di.Persist;
20 21
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
21 22
import org.eclipse.e4.ui.services.IServiceConstants;
23
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
22 24
import org.eclipse.jface.viewers.ISelectionChangedListener;
23 25
import org.eclipse.jface.viewers.IStructuredSelection;
24 26
import org.eclipse.jface.viewers.SelectionChangedEvent;
......
81 83
    private Button btnOpenFeatureTree;
82 84

  
83 85
    private ConversationHolder conversation;
86

  
87
    @Inject
88
    private ESelectionService selService;
89

  
84 90
    @Inject
85 91
    private MDirtyable dirty;
86 92

  
......
207 213

  
208 214
		button_add.setEnabled(selection.size() <= 1);
209 215
		button_remove.setEnabled(selection.size() > 0);
216
		//propagate selection
217
		IStructuredSelection isel = (IStructuredSelection) event.getSelection();
218
		selService.setSelection((isel.size() == 1 ? isel.getFirstElement() : isel.toArray()));
219
	}
220

  
221
	@Focus
222
	public void focus(){
223
	    viewer.getControl().setFocus();
224
        if(conversation!=null && !conversation.isBound()){
225
            conversation.bind();
226
        }
210 227
	}
211 228

  
212 229
	@Persist

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)