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;
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);
EventUtility.postEvent(WorkbenchEventConstants.RECONNECT, null);
+ selService.setSelection(new StructuredSelection());
}
}
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;
public class ShowRemotingLoginWindowHandlerE4 {
@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();
EventUtility.postEvent(WorkbenchEventConstants.RECONNECT, null);
+ selService.setSelection(new StructuredSelection());
}
}
import javax.inject.Named;
import org.apache.log4j.Logger;
+import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.di.PersistState;
-import org.eclipse.e4.ui.di.UIEventTopic;
import org.eclipse.e4.ui.di.UISynchronize;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.services.IServiceConstants;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.editor.IDistributionEditor;
import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
-import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@Inject
protected ESelectionService selService;
+ @Inject
+ protected IEclipseContext context;
+
protected abstract void selectionChanged_internal(Object selection, MPart activePart, MPart thisPart);
@Inject
}
}
- @Inject
- @Optional
- private void clearOnReconnect(@UIEventTopic(WorkbenchEventConstants.RECONNECT)Object o){
- showEmptyPage();
- }
-
public Viewer getViewer() {
return viewer;
}
}
}
- selectionProvidingPart = null;
+ reset();
if(thisPart!=null){
thisPart.setLabel(getViewName());
}
private void dispose() {
}
+ private void reset(){
+ previousSelection = null;
+ selectionProvidingPart = null;
+ delaySelection = null;
+ context.deactivate();
+ }
+
@PersistState
private void persistState(){