Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java')
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java47
1 files changed, 45 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java
index c45a4b1f7b..006aa871c3 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java
@@ -1,4 +1,12 @@
-/**
+/*
+ * Copyright (c) 2013 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
*/
package org.eclipse.emf.cdo.releng.setup.impl;
@@ -23,6 +31,8 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
@@ -265,7 +275,8 @@ public class WorkingSetTaskImpl extends SetupTaskImpl implements WorkingSetTask
private static void initPackageExplorer()
{
final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getWorkbenchWindows()[0];
- workbenchWindow.getShell().getDisplay().asyncExec(new Runnable()
+ final Display display = workbenchWindow.getShell().getDisplay();
+ display.asyncExec(new Runnable()
{
public void run()
{
@@ -275,6 +286,38 @@ public class WorkingSetTaskImpl extends SetupTaskImpl implements WorkingSetTask
IWorkbenchPage.VIEW_CREATE);
if (view != null)
{
+ // Dismiss the WorkingSetConfigurationDialog that comes up the very first time the root mode changes in
+ // a new workspace just as if the OK button was pressed.
+ display.asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ Shell finalActiveShell = display.getActiveShell();
+ if (finalActiveShell != null)
+ {
+ Object data = finalActiveShell.getData();
+ if (data != null)
+ {
+ Class<? extends Object> workingSetConfigurationDialogClass = data.getClass();
+ if (workingSetConfigurationDialogClass.getName().equals(
+ "org.eclipse.jdt.internal.ui.workingsets.WorkingSetConfigurationDialog"))
+ {
+ try
+ {
+ Method method = workingSetConfigurationDialogClass.getDeclaredMethod("okPressed");
+ method.setAccessible(true);
+ method.invoke(data);
+ }
+ catch (Exception ex)
+ {
+ Activator.log(ex);
+ }
+ }
+ }
+ }
+ }
+ });
+
Method method = view.getClass().getMethod("rootModeChanged", int.class);
method.invoke(view, 2);
}

Back to the top