import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
-import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
+import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.dialog.RemotingLoginDialog;
/**
- *
* @author pplitzner
* @date 10.10.2017
- *
*/
public class ReconnectHandlerE4 {
@Execute
- public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) {
+ public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, ESelectionService selService) {
RemotingLoginDialog loginDialog = new RemotingLoginDialog(shell,
SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
- loginDialog.open((CdmRemoteSource) CdmStore.getActiveCdmSource(), true, true);
+ loginDialog.open((ICdmRemoteSource) CdmStore.getActiveCdmSource(), true, true);
+ EventUtility.postEvent(WorkbenchEventConstants.RECONNECT, null);
+ selService.setSelection(new StructuredSelection());
}
}