*** empty log message ***
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/PDEPlugin.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/PDEPlugin.java
index ef90321..3712701 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/PDEPlugin.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/PDEPlugin.java
@@ -25,6 +25,7 @@
import org.eclipse.jface.dialogs.*;
import java.net.URL;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.debug.core.model.IProcess;
public class PDEPlugin extends AbstractUIPlugin {
public static final String PLUGIN_ID = "org.eclipse.pde";
@@ -53,6 +54,8 @@
PLUGIN_ID + "." + "WorkbenchDebugLauncher";
public static final String ECLIPSE_HOME_VARIABLE = "ECLIPSE_HOME";
+
+ private static final String KEY_RUNNING = "RunningEclipse.message";
// Shared instance
private static PDEPlugin inst;
@@ -77,6 +80,7 @@
private java.util.Hashtable counters;
private WorkspaceModelManager workspaceModelManager;
private Vector pluginListeners = new Vector();
+ private ILaunch currentLaunch = null;
public PDEPlugin(IPluginDescriptor descriptor) {
super(descriptor);
@@ -317,5 +321,30 @@
return null;
}
}
-
+
+ public void registerLaunch(ILaunch launch) {
+ this.currentLaunch = launch;
+ }
+
+ public IStatus getCurrentLaunchStatus() {
+ if (currentLaunch==null) return null;
+ IProcess [] processes = currentLaunch.getProcesses();
+ boolean terminated = true;
+ for (int i=0; i<processes.length; i++) {
+ IProcess process = processes[i];
+ if (process.isTerminated()==false) {
+ terminated = false;
+ break;
+ }
+ }
+ if (terminated) {
+ currentLaunch = null;
+ return null;
+ }
+ // The run-time workbench is still running
+ String message = getResourceString(KEY_RUNNING);
+ Status status =
+ new Status(IStatus.ERROR, getPluginId(), IStatus.OK, message, null);
+ return status;
+ }
}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherDelegate.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherDelegate.java
index 60a29c9..ef254d8 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherDelegate.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherDelegate.java
@@ -188,6 +188,7 @@
DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
}
});
+ PDEPlugin.getDefault().registerLaunch(launch);
}
private void showErrorDialog(final String message, final IStatus status) {
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherWizardBasicPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherWizardBasicPage.java
index ff9c1dd..0bc297f 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherWizardBasicPage.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherWizardBasicPage.java
@@ -26,22 +26,37 @@
public class WorkbenchLauncherWizardBasicPage extends StatusWizardPage {
private static final String KEY_DESC = "";
- private static final String KEY_WORKSPACE = "WorkbenchLauncherWizardBasicPage.workspace";
- private static final String KEY_BROWSE = "WorkbenchLauncherWizardBasicPage.browse";
- private static final String KEY_CLEAR = "WorkbenchLauncherWizardBasicPage.clear";
+ private static final String KEY_WORKSPACE =
+ "WorkbenchLauncherWizardBasicPage.workspace";
+ private static final String KEY_BROWSE =
+ "WorkbenchLauncherWizardBasicPage.browse";
+ private static final String KEY_CLEAR =
+ "WorkbenchLauncherWizardBasicPage.clear";
private static final String KEY_JRE = "WorkbenchLauncherWizardBasicPage.jre";
- private static final String KEY_VMARGS = "WorkbenchLauncherWizardBasicPage.vmArgs";
- private static final String KEY_PARGS = "WorkbenchLauncherWizardBasicPage.programArgs";
- private static final String KEY_APPNAME = "WorkbenchLauncherWizardBasicPage.appName";
- private static final String KEY_TRACING = "WorkbenchLauncherWizardBasicPage.tracing";
- private static final String KEY_RESTORE = "WorkbenchLauncherWizardBasicPage.restore";
- private static final String KEY_RESTORE_TEXT = "WorkbenchLauncherWizardBasicPage.restoreText";
- private static final String KEY_WTITLE = "WorkbenchLauncherWizardBasicPage.workspace.title";
- private static final String KEY_WMESSAGE = "WorkbenchLauncherWizardBasicPage.workspace.message";
- private static final String KEY_NO_JRE = "WorkbenchLauncherWizardBasicPage.noJRE";
- private static final String KEY_ENTER_WORKSPACE = "WorkbenchLauncherWizardBasicPage.enterWorkspace";
- private static final String KEY_INVALID_WORKSPACE = "WorkbenchLauncherWizardBasicPage.invalidWorkspace";
- private static final String KEY_EXISTING_WORKSPACE = "WorkbenchLauncherWizardBasicPage.workspaceExisting";
+ private static final String KEY_VMARGS =
+ "WorkbenchLauncherWizardBasicPage.vmArgs";
+ private static final String KEY_PARGS =
+ "WorkbenchLauncherWizardBasicPage.programArgs";
+ private static final String KEY_APPNAME =
+ "WorkbenchLauncherWizardBasicPage.appName";
+ private static final String KEY_TRACING =
+ "WorkbenchLauncherWizardBasicPage.tracing";
+ private static final String KEY_RESTORE =
+ "WorkbenchLauncherWizardBasicPage.restore";
+ private static final String KEY_RESTORE_TEXT =
+ "WorkbenchLauncherWizardBasicPage.restoreText";
+ private static final String KEY_WTITLE =
+ "WorkbenchLauncherWizardBasicPage.workspace.title";
+ private static final String KEY_WMESSAGE =
+ "WorkbenchLauncherWizardBasicPage.workspace.message";
+ private static final String KEY_NO_JRE =
+ "WorkbenchLauncherWizardBasicPage.noJRE";
+ private static final String KEY_ENTER_WORKSPACE =
+ "WorkbenchLauncherWizardBasicPage.enterWorkspace";
+ private static final String KEY_INVALID_WORKSPACE =
+ "WorkbenchLauncherWizardBasicPage.invalidWorkspace";
+ private static final String KEY_EXISTING_WORKSPACE =
+ "WorkbenchLauncherWizardBasicPage.workspaceExisting";
private static final String SETTINGS_VMARGS = "vmargs";
private static final String SETTINGS_PROGARGS = "progargs";
@@ -78,6 +93,12 @@
vmInstallations = getAllVMInstances();
}
+
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ IStatus running = PDEPlugin.getDefault().getCurrentLaunchStatus();
+ if (running!=null) updateStatus(running);
+ }
public void createControl(Composite parent) {
initializeDialogUnits(parent);
@@ -127,20 +148,23 @@
applicationNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
fillIntoGrid(applicationNameText, 2, false);
-
+
tracingCheck = new Button(composite, SWT.CHECK);
tracingCheck.setText(PDEPlugin.getResourceString(KEY_TRACING));
fillIntoGrid(tracingCheck, 2, false);
label = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
- fillIntoGrid(label, 3, false);
+ fillIntoGrid(label, 3, false);
defaultsButton = new Button(composite, SWT.PUSH);
defaultsButton.setText(PDEPlugin.getResourceString(KEY_RESTORE));
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- data.widthHint = Math.max(widthHint, defaultsButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
+ data.widthHint =
+ Math.max(
+ widthHint,
+ defaultsButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
defaultsButton.setLayoutData(data);
label = new Label(composite, SWT.NULL);
@@ -176,7 +200,7 @@
boolean tracing = false;
IPreferenceStore pstore = PDEPlugin.getDefault().getPreferenceStore();
-
+
String defaultWorkspace = getDefaultWorkspace(pstore);
if (initialSettings != null) {
@@ -220,9 +244,10 @@
progArgsText.setText(progArgs);
applicationNameText.setText(appName);
workspaceCombo.setItems(workspaceSelectionItems);
- if (workspaceSelectionItems.length>0) workspaceCombo.select(0);
- else
- workspaceCombo.setText(defaultWorkspace);
+ if (workspaceSelectionItems.length > 0)
+ workspaceCombo.select(0);
+ else
+ workspaceCombo.setText(defaultWorkspace);
clearWorkspaceCheck.setSelection(doClear);
tracingCheck.setSelection(tracing);
//validate
@@ -230,18 +255,19 @@
jreSelectionStatus = validateJRESelection();
updateStatus();
}
-
+
private static String getDefaultWorkspace(IPreferenceStore pstore) {
TargetPlatformPreferencePage.initializePlatformPath();
- IPath ppath = new Path(pstore.getString(TargetPlatformPreferencePage.PROP_PLATFORM_PATH));
+ IPath ppath =
+ new Path(pstore.getString(TargetPlatformPreferencePage.PROP_PLATFORM_PATH));
IPath runtimeWorkspace = ppath.append(RT_WORKSPACE);
return runtimeWorkspace.toOSString();
}
-/**
- * Load the stored settings into the provided data object to be
- * used by the headless launcher
- */
+ /**
+ * Load the stored settings into the provided data object to be
+ * used by the headless launcher
+ */
static void setLauncherData(IDialogSettings settings, LauncherData data) {
IVMInstall launcher = null;
int jreSelectionIndex = 0;
@@ -250,7 +276,7 @@
String appName = "org.eclipse.ui.workbench";
String[] workspaceSelectionItems = new String[0];
boolean doClear = false;
- String defaultWorkspace="";
+ String defaultWorkspace = "";
boolean tracing = false;
IPreferenceStore pstore = PDEPlugin.getDefault().getPreferenceStore();
@@ -284,9 +310,8 @@
break;
}
}
- }
- else
- launcher = vmInstallations[0];
+ } else
+ launcher = vmInstallations[0];
//doClear= initialSettings.getBoolean(SETTINGS_DOCLEAR);
}
// Initialize launcher data
@@ -297,7 +322,7 @@
data.setClearWorkspace(doClear);
data.setWorkspaceLocation(new Path(defaultWorkspace));
data.setTracingEnabled(tracing);
- }
+ }
private static boolean isDefault(String value) {
return value.equals(DEFAULT_VALUE);
@@ -317,7 +342,7 @@
clearWorkspaceCheck.setSelection(false);
tracingCheck.setSelection(false);
}
-
+
private void hookListeners() {
browseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -354,7 +379,11 @@
}
private void updateStatus() {
- updateStatus(getMoreSevere(workspaceSelectionStatus, jreSelectionStatus));
+ IStatus running = PDEPlugin.getDefault().getCurrentLaunchStatus();
+ if (running != null)
+ updateStatus(running);
+ else
+ updateStatus(getMoreSevere(workspaceSelectionStatus, jreSelectionStatus));
}
public void storeSettings(boolean finishPressed) {
@@ -406,10 +435,14 @@
private IStatus validateWorkspaceSelection() {
IPath curr = getWorkspaceLocation();
if (curr.segmentCount() == 0) {
- return createStatus(IStatus.ERROR, PDEPlugin.getResourceString(KEY_ENTER_WORKSPACE));
+ return createStatus(
+ IStatus.ERROR,
+ PDEPlugin.getResourceString(KEY_ENTER_WORKSPACE));
}
if (!Path.ROOT.isValidPath(workspaceCombo.getText())) {
- return createStatus(IStatus.ERROR, PDEPlugin.getResourceString(KEY_INVALID_WORKSPACE));
+ return createStatus(
+ IStatus.ERROR,
+ PDEPlugin.getResourceString(KEY_INVALID_WORKSPACE));
}
File file = curr.toFile();
@@ -468,7 +501,7 @@
public String getApplicationName() {
return applicationNameText.getText();
}
-
+
/**
* Returns true if tracing is enabled
*/
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/pderesources.properties b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/pderesources.properties
index 75af46a..dc2bb78 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/pderesources.properties
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/pderesources.properties
@@ -28,6 +28,8 @@
MissingPDENature.keepWarning = &Continue to warn me
MissingPDENature.openWizard = &Take me to the conversion wizard
+RunningEclipse.message = You must close the run-time workbench before proceeding.
+
MultiPageEditor.wrongEditor = Wrong editor for {0}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/imports/PluginImportWizardFirstPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/imports/PluginImportWizardFirstPage.java
index 65071cc..d94f7ff 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/imports/PluginImportWizardFirstPage.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/imports/PluginImportWizardFirstPage.java
@@ -68,6 +68,12 @@
dropLocationStatus = createStatus(IStatus.OK, "");
}
+
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ IStatus running = PDEPlugin.getDefault().getCurrentLaunchStatus();
+ if (running!=null) updateStatus(running);
+ }
/*
* @see IDialogPage#createControl(Composite)
@@ -138,8 +144,7 @@
public void widgetSelected(SelectionEvent e) {
if (runtimeLocationButton.getSelection()) {
setOtherEnabled(false);
- validateDropLocation();
- updateStatus(dropLocationStatus);
+ updateStatus();
}
}
});
@@ -147,8 +152,7 @@
public void widgetSelected(SelectionEvent e) {
if (otherLocationButton.getSelection()) {
setOtherEnabled(true);
- validateDropLocation();
- updateStatus(dropLocationStatus);
+ updateStatus();
}
}
});
@@ -168,18 +172,27 @@
});
dropLocation.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- validateDropLocation();
- updateStatus(dropLocationStatus);
+ updateStatus();
}
});
dropLocation.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- validateDropLocation();
- updateStatus(dropLocationStatus);
+ updateStatus();
}
});
setControl(composite);
}
+
+ private void updateStatus() {
+ IStatus running = PDEPlugin.getDefault().getCurrentLaunchStatus();
+ if (running!=null) {
+ updateStatus(running);
+ }
+ else {
+ validateDropLocation();
+ updateStatus(dropLocationStatus);
+ }
+ }
private GridData fillHorizontal(Control control, int span, boolean grab) {
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);