import eu.etaxonomy.cdm.model.taxon.TaxonNodeByNameComparator;
import eu.etaxonomy.cdm.model.taxon.TaxonNodeByRankAndNameComparator;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.DataChangeBridge;
import eu.etaxonomy.taxeditor.model.IContextListener;
import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
viewer.setLabelProvider(new TaxonNavigatorLabelProviderE4());
//propagate selection
- selectionChangedListener = (event -> selService.setSelection(AbstractUtility.getElementsFromSelectionChangedEvent(event)));
+ selectionChangedListener = (event -> selService.setSelection(event.getSelection()));
viewer.addSelectionChangedListener(selectionChangedListener);
//create context menu
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
public class NewClassificationHandlerE4 {
@Execute
- public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) {
+ public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell,
+ @Named(IServiceConstants.ACTIVE_SELECTION)ITreeSelection selection) {
NewClassificationWizard wizard = new NewClassificationWizard();
- wizard.init(null, null);
+ wizard.init(null, selection);
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.open();
}
import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
public class NewTaxonNodeHandlerE4 {
@Execute
- public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) throws Exception {
+ public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell,
+ @Named(IServiceConstants.ACTIVE_SELECTION)ITreeSelection selection) throws Exception {
final NewTaxonNodeWizard wizard = new NewTaxonNodeWizard();
- wizard.init(null, null);
+ wizard.init(null, selection);
final WizardDialog dialog = new WizardDialog(shell, wizard);
wizard.addWizardPageListener(new IWizardPageListener() {
@Override