Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2006-10-17 20:09:20 +0000
committercvs2svn2006-10-17 20:09:20 +0000
commit49cdb5c1b3eeec778480ec4f00acf9f62e37e007 (patch)
tree0e610325e8675b6e7c022c5aad04a9d7ffbe34b6
parent526b27b762f5e52f11a7e33fffbf2e51bb108be1 (diff)
downloadeclipse.platform.debug-49cdb5c1b3eeec778480ec4f00acf9f62e37e007.tar.gz
eclipse.platform.debug-49cdb5c1b3eeec778480ec4f00acf9f62e37e007.tar.xz
eclipse.platform.debug-49cdb5c1b3eeec778480ec4f00acf9f62e37e007.zip
This commit was manufactured by cvs2svn to create branch
'viewer_rework_3_3'. Cherrypick from master 2006-10-17 20:09:19 UTC Darin Wright <darin> 'Bug 157059 [launching] extensible launch options': org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java org.eclipse.debug.ui/schema/launchConfigurationTabs.exsd org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java118
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java190
-rw-r--r--org.eclipse.debug.ui/schema/launchConfigurationTabs.exsd137
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java128
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java164
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java90
9 files changed, 1016 insertions, 0 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java
new file mode 100644
index 000000000..f7aca3889
--- /dev/null
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.core;
+
+/**
+ * This interface provides a repository for the names of <code>IConfigurationElement</code> child node ids.
+ * @since 3.3
+ */
+public interface IConfigurationElementConstants {
+
+ /**
+ * The id node name for a configuration element
+ */
+ public static final String ID = "id"; //$NON-NLS-1$
+
+ /**
+ * the name node name for a configuration element
+ */
+ public static final String NAME = "name"; //$NON-NLS-1$
+
+ /**
+ * the category node name for a configuration element
+ */
+ public static final String CATEGORY = "category"; //$NON-NLS-1$
+
+ /**
+ * the launchMode node name for a configuration element
+ */
+ public static final String LAUNCH_MODE = "launchMode"; //$NON-NLS-1$
+
+ /**
+ * the label node name for a configuration element
+ */
+ public static final String LABEL = "label"; //$NON-NLS-1$
+
+ /**
+ * the description node name for a configuration element
+ */
+ public static final String DESCRIPTION = "description"; //$NON-NLS-1$
+
+ /**
+ * the helpContextId node name for a configuration element
+ */
+ public static final String HELP_CONTEXT_ID = "helpContextId"; //$NON-NLS-1$
+
+ /**
+ * the icon node name for a configuration element
+ */
+ public static final String ICON = "icon"; //$NON-NLS-1$
+
+ /**
+ * the public node name for a configuration element
+ */
+ public static final String PUBLIC = "public"; //$NON-NLS-1$
+
+ /**
+ * the perspective node name for a configuration element
+ */
+ public static final String PERSPECTIVE = "perspective"; //$NON-NLS-1$
+
+ /**
+ * the modes node name for a configuration element
+ */
+ public static final String MODES = "modes"; //$NON-NLS-1$
+
+ /**
+ * the mode node name for a configuration element
+ */
+ public static final String MODE = "mode"; //$NON-NLS-1$
+
+ /**
+ * the type node name for a configuration element
+ */
+ public static final String TYPE = "type"; //$NON-NLS-1$
+
+ /**
+ * the option node name for a configuration element
+ */
+ public static final String OPTIONS = "options"; //$NON-NLS-1$
+
+ /**
+ * the delegate node name for a configuration element
+ */
+ public static final String DELEGATE = "delegate"; //$NON-NLS-1$
+
+ /**
+ * the group node name for a configuration element
+ */
+ public static final String GROUP = "group"; //$NON-NLS-1$
+
+ /**
+ * the class node name for a configuration element
+ */
+ public static final String CLASS = "class"; //$NON-NLS-1$
+
+ /**
+ * the sourcePathComputerId node name for a configuration element
+ */
+ public static final String SOURCE_PATH_COMPUTER = "sourcePathComputerId"; //$NON-NLS-1$
+
+ /**
+ * the sourceLocatorId node name for a configuration element
+ */
+ public static final String SOURCE_LOCATOR = "sourceLocatorId"; //$NON-NLS-1$
+
+ /**
+ * the migrationDelegate node name for a configuration element
+ */
+ public static final String MIGRATION_DELEGATE = "migrationDelegate"; //$NON-NLS-1$
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java
new file mode 100644
index 000000000..c9cd7081c
--- /dev/null
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.core;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
+
+import com.ibm.icu.text.MessageFormat;
+
+/**
+ * Proxy to a launch delegate extension
+ * Clients can contribute launch delegates through the <code>launchDelegates</code> extension point
+ *
+ * Example contribution of the local java launch delegate
+ * <pre>
+ * <extension point="org.eclipse.debug.core.launchDelegates">
+ <launchDelegate
+ delegate="org.eclipse.jdt.launching.JavaLaunchDelegate"
+ id="org.eclipse.jdt.launching.localJavaApplicationDelegate"
+ modes="run, debug"
+ name="%localJavaApplication"
+ type="org.eclipse.jdt.launching.localJavaApplication">
+ </launchDelegate>
+ * </pre>
+ *
+ * Clients are NOT intended to subclass this class
+ *
+ * @since 3.3
+ */
+public final class LaunchDelegate {
+
+ /**
+ * The configuration element for this delegate
+ */
+ private IConfigurationElement fElement = null;
+
+ /**
+ * The cached delegate. Remains null until asked for, then persisted
+ */
+ private ILaunchConfigurationDelegate fDelegate = null;
+
+ //lists of cached entries
+ private HashSet fModes = null;
+ private HashSet fOptions = null;
+ private String fType = null;
+
+ /**
+ * Constructor
+ * @param element the configuration element to associate with this launch delegate
+ */
+ public LaunchDelegate(IConfigurationElement element) {
+ fElement = element;
+ }
+
+ /**
+ * Returns the actual instance of the launch delegate specified
+ * @return the launch delegate
+ */
+ public ILaunchConfigurationDelegate getDelegate() throws CoreException {
+ if(fDelegate == null) {
+ Object obj = fElement.createExecutableExtension(IConfigurationElementConstants.DELEGATE);
+ if(obj instanceof ILaunchConfigurationDelegate) {
+ return (ILaunchConfigurationDelegate)obj;
+ }
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_Launch_delegate_for__0__does_not_implement_required_interface_ILaunchConfigurationDelegate__1, new String[]{getIdentifier()}), null));
+ }
+ return fDelegate;
+ }
+
+ /**
+ * @return returns the unique id of the delegate
+ */
+ public String getIdentifier() {
+ return fElement.getAttribute(IConfigurationElementConstants.ID);
+ }
+
+ /**
+ * Returns the id of the associated <code>ILaunchConfigurationType</code> or <code>null</code> if none provided
+ * @return the id of the <code>ILaunchConfigurationType</code> associated with this delegate
+ */
+ public String getLaunchConfigurationType() {
+ if(fType == null) {
+ //fall back to single association if no appliesTo
+ fType = fElement.getAttribute(IConfigurationElementConstants.TYPE);
+ if(fType == null) {
+ //the case when we have passed a launch configuration type to the launch delegate
+ fType = fElement.getAttribute(IConfigurationElementConstants.ID);
+ }
+ }
+ return fType;
+ }
+
+ /**
+ * Returns the set of options provided to by this delegate
+ * @return the options associated with this delegate. If no options are specified an empty set is
+ * returned, never <code>null</code>.
+ */
+ public Set getOptions() {
+ if(fOptions == null) {
+ fOptions = new HashSet();
+ String option = fElement.getAttribute(IConfigurationElementConstants.OPTIONS);
+ if(option != null) {
+ String[] options = option.split(","); //$NON-NLS-1$
+ for(int i = 0; i < options.length; i++) {
+ fOptions.add(options[i].trim());
+ }
+ }
+ }
+ return fOptions;
+ }
+
+ /**
+ * This method is provided as a backward compatibility measure to allow access to modes, if mode-based
+ * launching is still being used.
+ *
+ * @return a set of modes for this delegate or the empty set if none are found, never <code>null</code>.
+ */
+ public Set getModes() {
+ if (fModes == null) {
+ fModes = new HashSet();
+ String modes = fElement.getAttribute(IConfigurationElementConstants.MODES);
+ if (modes != null) {
+ String[] strings = modes.split(","); //$NON-NLS-1$
+ for (int i = 0; i < strings.length; i++) {
+ fModes.add(strings[i].trim());
+ }
+ }
+ }
+ return fModes;
+ }
+
+ /**
+ * Returns the human readable name for this launch delegate
+ * @return the human readable name for this launch delegate, or <code>null</code> if none
+ */
+ public String getName() {
+ return fElement.getAttribute(IConfigurationElementConstants.NAME);
+ }
+
+ /**
+ * Returns the associated source locator id or <code>null</code>
+ * @return the associated source locator id or <code>null</code> if not provided
+ */
+ public String getSourceLocatorId() {
+ return fElement.getAttribute(IConfigurationElementConstants.SOURCE_LOCATOR);
+ }
+
+ /**
+ * Returns the associated source path computer id or <code>null</code>
+ * @return the associated source path computer id or <code>null</code> if not provided
+ */
+ public String getSourcePathComputerId() {
+ return fElement.getAttribute(IConfigurationElementConstants.SOURCE_PATH_COMPUTER);
+ }
+
+ /**
+ * Determines if the delegate applies to the specified launch configuration type via its id only (no expression evaluation is done)
+ * @param configtypeId the id of the <code>ILaunchConfigurationType</code>.
+ * @return true if the delegate applies to the associated config type, false otherwise
+ */
+ public boolean appliesTo(String configtypeId) {
+ return getLaunchConfigurationType().equals(configtypeId);
+ }
+
+ /**
+ * Determines if the delegate applies to the specified launch configuration type via its id and mode (no expression evaluation is done)
+ * @param configtypeId the id of the <code>ILaunchConfigurationType</code>.
+ * @param mode the mode
+ * @return true if the delegate applies to the associated config type, false otherwise
+ */
+ public boolean appliesTo(String configtypeId, String mode) {
+ return getLaunchConfigurationType().equals(configtypeId) & getModes().contains(mode);
+ }
+
+}
diff --git a/org.eclipse.debug.ui/schema/launchConfigurationTabs.exsd b/org.eclipse.debug.ui/schema/launchConfigurationTabs.exsd
new file mode 100644
index 000000000..94f030609
--- /dev/null
+++ b/org.eclipse.debug.ui/schema/launchConfigurationTabs.exsd
@@ -0,0 +1,137 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.debug.ui">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.debug.ui" id="launchConfigurationTabs" name="Launch Configuration Tabs"/>
+ </appInfo>
+ <documentation>
+ This extension point is to contribute launch configuration tabs (one or more) to an existing launch configuration tab group.
+
+
+&lt;p&gt;&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This extension point has been added as
+part of a work in progress. There is no guarantee that this API will
+remain unchanged during the 3.3 release cycle. Please do not use this API
+without consulting with the Platform/Debug team.&lt;/p&gt;
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="tab"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="tab">
+ <annotation>
+ <documentation>
+ describes an individual launch configuration tab contribution
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ the unique id of this contributed tab
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="group" type="string" use="required">
+ <annotation>
+ <documentation>
+ the string id of the &lt;code&gt;ILaunchConfigurationTabGroup&lt;/code&gt; that this tab should be contributed to
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ a human readable name for this tab. The provided name does not have to be the name that appears on the tab itself, but should sufficiently describe the tab.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ fully qualified name of the java class that implemnents &lt;code&gt;ILaunchConfigurationTab&lt;/code&gt;.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.debug.ui.ILaunchConfigurationTab"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 3.3
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ The following example adds the tab &quot;FooTab&quot; to the local java application launch tab group.
+
+&lt;p&gt;
+&lt;pre&gt;
+&lt;extension point=&quot;org.eclipse.debug.ui.launchConfigurationTabs&quot;&gt;
+ &lt;tab
+ class=&quot;org.eclipse.jdt.debug.ui.launchConfigurations.FooTab&quot;
+ group=&quot;org.eclipse.jdt.debug.ui.launchConfigurationTabGroup.localJavaApplication&quot;
+ id=&quot;org.eclipse.jdt.debug.ui.fooTab&quot;
+ name=&quot;Foo Tab&quot;&gt;
+ &lt;/tab&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ The debug platform provides two abstract classes that clients should subclass when implementing launch tabs. See &lt;code&gt;AbstractLaunchConfigurationTab&lt;/code&gt; and &lt;code&gt;AbstractOptionLaunchConfigurationTab&lt;/code&gt; in package &lt;code&gt;org.eclipse.debug.ui&lt;/code&gt;.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2006 IBM Corporation and others.&lt;br&gt;
+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
+&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
new file mode 100644
index 000000000..f84112dc8
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.debug.internal.core.IConfigurationElementConstants;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+
+/**
+ * Provides a proxy to a launchConfigurationTabs extension point
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+public final class LaunchConfigurationTabExtension {
+
+ /**
+ * The configuration element backing this proxy
+ */
+ IConfigurationElement fElement = null;
+
+ /**
+ * Constructor
+ * @param element the <code>IConfigurationElement</code> for this proxy
+ */
+ public LaunchConfigurationTabExtension(IConfigurationElement element) {
+ fElement = element;
+ }
+
+ /**
+ * Returns the unique id ofthe tab
+ * @return the unique id of the tab
+ */
+ public String getIdentifier() {
+ return fElement.getAttribute(IConfigurationElementConstants.ID);
+ }
+
+ /**
+ * Returns the human readable name for the tab, not to be confused with the name that appears on the tab itself
+ * @return the name of the tab
+ */
+ public String getName() {
+ return fElement.getAttribute(IConfigurationElementConstants.NAME);
+ }
+
+ /**
+ * Returns the instantiated class of this tab
+ * @return the instantiated class of this tab
+ */
+ public ILaunchConfigurationTab getTab() {
+ try {
+ Object object = fElement.createExecutableExtension(IConfigurationElementConstants.CLASS);
+ if(object instanceof ILaunchConfigurationTab) {
+ return (ILaunchConfigurationTab) object;
+ }
+ } catch (CoreException e) {DebugUIPlugin.log(e);}
+ return null;
+ }
+
+ /**
+ * Returns the unique id of the <code>ILaunchConfigurationTabGroup</code> that this tab contributes to
+ * @return the id of the <code>ILaunchConfigurationTabGroup</code> this tab conributes to
+ */
+ public String getTabGroupId() {
+ return fElement.getAttribute(IConfigurationElementConstants.GROUP);
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java
new file mode 100644
index 000000000..30c88872d
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * This class is used to construct a launch configuraityon dialog used to edit a launch configuration and continue,
+ * not allowing a launch to occur.
+ *
+ * @since 3.3
+ *
+ * EXPERIMENTAL
+ */
+public class LaunchConfigurationEditDialog extends LaunchConfigurationDialog {
+
+ public LaunchConfigurationEditDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group) {
+ super(shell, launchConfiguration, group);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getTitleAreaTitle()
+ */
+ protected String getTitleAreaTitle() {
+ return LaunchConfigurationsMessages.LaunchConfigurationEditDialog_0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, ID_CLOSE_BUTTON, LaunchConfigurationsMessages.LaunchConfigurationEditDialog_1, true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#updateButtons()
+ */
+ public void updateButtons() {
+ getTabViewer().refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getDialogSettingsSectionName()
+ */
+ protected String getDialogSettingsSectionName() {
+ return IDebugUIConstants.PLUGIN_ID + ".LAUNCH_CONFIGURATION_EDIT_DIALOG_SECTION"; //$NON-NLS-1$
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java
new file mode 100644
index 000000000..266941e0a
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java
@@ -0,0 +1,128 @@
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
+
+/**
+ * This class is used to wrap a contributed <code>ILaunchConfigurationTabGroup</code> with any contributed tabs
+ * for that group (from a <code>launchConfigurationTabs</code> extension point).
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This class has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationTabGroup {
+
+ private ILaunchConfigurationTabGroup fGroup = null;
+ private String fGroupId = null;
+ private ILaunchConfigurationTab[] fContributedTabs = null;
+
+ /**
+ * Constructor
+ * @param group the existing group to wrapper
+ */
+ public LaunchConfigurationTabGroupWrapper(ILaunchConfigurationTabGroup group, String groupId) {
+ fGroup = group;
+ fGroupId = groupId;
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
+ */
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ if(fGroup != null) {
+ fGroup.createTabs(dialog, mode);
+ }
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#dispose()
+ */
+ public void dispose() {
+ if(fGroup != null) {
+ fGroup.dispose();
+ }
+ if(fContributedTabs != null) {
+ for(int i = 0; i < fContributedTabs.length; i++) {
+ fContributedTabs[i].dispose();
+ }
+ }
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#getTabs()
+ */
+ public ILaunchConfigurationTab[] getTabs() {
+ if(fContributedTabs == null) {
+ fContributedTabs = LaunchConfigurationPresentationManager.getDefault().createContributedTabs(fGroupId);
+ }
+ ILaunchConfigurationTab[] grouptabs = fGroup.getTabs();
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[grouptabs.length + fContributedTabs.length];
+ System.arraycopy(grouptabs, 0, tabs, 0, grouptabs.length);
+ System.arraycopy(fContributedTabs, 0, tabs, grouptabs.length, fContributedTabs.length);
+ return tabs;
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ if(fGroup != null) {
+ fGroup.initializeFrom(configuration);
+ }
+ if(fContributedTabs == null) {
+ getTabs();
+ }
+ for(int i = 0; i < fContributedTabs.length; i++) {
+ fContributedTabs[i].initializeFrom(configuration);
+ }
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#launched(org.eclipse.debug.core.ILaunch)
+ */
+ public void launched(ILaunch launch) {
+ if(fGroup != null) {
+ fGroup.launched(launch);
+ }
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ if(fGroup != null) {
+ fGroup.performApply(configuration);
+ if(fContributedTabs == null) {
+ getTabs();
+ }
+ for(int i = 0; i < fContributedTabs.length; i++) {
+ fContributedTabs[i].performApply(configuration);
+ }
+ }
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ if(fGroup != null) {
+ fGroup.setDefaults(configuration);
+ if(fContributedTabs == null) {
+ getTabs();
+ }
+ for(int i = 0; i < fContributedTabs.length; i++) {
+ fContributedTabs[i].setDefaults(configuration);
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
new file mode 100644
index 000000000..b099d8ff4
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.IStatusHandler;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.ui.DebugUITools;
+
+/**
+ * This class provides a mechanism to prompt users in the UI thread from debug.core in the case where
+ * a launch delegate has gone missing and a new choice needs to be made in the launch dialog.
+ *
+ * @since 3.3
+ *
+ * EXPERIMENTAL
+ */
+public class LaunchDelegateNotAvailableHandler implements IStatusHandler {
+
+ /**
+ * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
+ */
+ public Object handleStatus(IStatus status, Object source) throws CoreException {
+ if(source instanceof Object[]) {
+ Object[] infos = (Object[]) source;
+ if(infos.length == 2) {
+ ILaunchConfiguration config = (ILaunchConfiguration) infos[0];
+ String mode = (String) infos[1];
+ DebugUITools.openLaunchConfigurationEditDialog(DebugUIPlugin.getShell(),
+ config,
+ DebugUITools.getLaunchGroup(config, mode).getIdentifier(),
+ null);
+ }
+ }
+ return Status.OK_STATUS;
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java
new file mode 100644
index 000000000..c025d932f
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+import java.util.Set;
+
+import org.eclipse.debug.internal.core.LaunchDelegate;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.SWTUtil;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.SelectionDialog;
+
+/**
+ * This class provides a dialog to present the user with a list of of viable launch options in the event
+ * the plugin that provides either a launch option or a contributed launch delegate is no longer available.
+ * The user can select one of the launch mode/option configuration sform this dialog and repair the option
+ * configuration state of the the current launch configuration
+ *
+ * @since 3.3
+ *
+ * EXPERIMENTAL
+ */
+public class SelectLaunchOptionsDialog extends SelectionDialog {
+
+ /**
+ * Builds labels for list control of the form: Mode + (no options) | [optionslist]
+ */
+ class OptionsLabelProvider implements ILabelProvider {
+ public Image getImage(Object element) {return null;}
+ public String getText(Object element) {
+ LaunchDelegate del = (LaunchDelegate) element;
+ Set set = del.getOptions();
+ return del.getName() + LaunchConfigurationsMessages.SelectLaunchOptionsDialog_5 + fMode + (set.isEmpty() ? LaunchConfigurationsMessages.SelectLaunchOptionsDialog_0 : LaunchConfigurationsMessages.SelectLaunchOptionsDialog_1 + set);
+ }
+ public void addListener(ILabelProviderListener listener) {}
+ public void dispose() {}
+ public boolean isLabelProperty(Object element, String property) {return false;}
+ public void removeListener(ILabelProviderListener listener) {}
+ }
+
+ private static final String SETTINGS_ID = IDebugUIConstants.PLUGIN_ID + ".SELECT_LAUNCH_OPTIONS_DIALOG"; //$NON-NLS-1$
+
+ private LaunchDelegate[] fDelegates = null;
+ private String fMode = null;
+ private Object[] fResult = null;
+ private CheckboxTableViewer fTableViewer = null;
+ private Table fTable = null;
+
+ /**
+ * Constructor
+ * @param parentShell the parent shell
+ * @param message the message for the dialog
+ * @param options the listing of arrays of options (each entry in the list must be an <code>Set</code> of options)
+ */
+ public SelectLaunchOptionsDialog(Shell parentShell, String mode, LaunchDelegate[] delegates) {
+ super(parentShell);
+ super.setMessage(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_2);
+ super.setTitle(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_3);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ fDelegates = delegates;
+ fMode = mode;
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ initializeDialogUnits(parent);
+ Composite comp = (Composite) super.createDialogArea(parent);
+ SWTUtil.createLabel(comp, LaunchConfigurationsMessages.SelectLaunchOptionsDialog_4, 1);
+ fTable = new Table(comp, SWT.BORDER | SWT.SINGLE | SWT.CHECK);
+ fTable.setLayoutData(new GridData(GridData.FILL_BOTH));
+ fTableViewer = new CheckboxTableViewer(fTable);
+ fTableViewer.setLabelProvider(new OptionsLabelProvider());
+ fTableViewer.setContentProvider(new ArrayContentProvider());
+ fTableViewer.setInput(fDelegates);
+ fTableViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ fTableViewer.setAllChecked(false);
+ fTableViewer.setChecked(event.getElement(), true);
+ }
+ });
+ Dialog.applyDialogFont(comp);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IDebugHelpContextIds.SELECT_LAUNCH_OPTIONS_DIALOG);
+ return comp;
+ }
+
+ /**
+ * @see org.eclipse.ui.dialogs.SelectionDialog#getResult()
+ */
+ public Object[] getResult() {
+ return fResult;
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ */
+ protected void okPressed() {
+ Object[] o = fTableViewer.getCheckedElements();
+ if(o.length > 0) {
+ fResult = ((LaunchDelegate)o[0]).getOptions().toArray();
+ }
+ super.okPressed();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.SelectionDialog#getDialogBoundsSettings()
+ */
+ protected IDialogSettings getDialogBoundsSettings() {
+ IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
+ IDialogSettings section = settings.getSection(SETTINGS_ID);
+ if (section == null) {
+ section = settings.addNewSection(SETTINGS_ID);
+ }
+ return section;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#getInitialSize()
+ */
+ protected Point getInitialSize() {
+ IDialogSettings settings = getDialogBoundsSettings();
+ if(settings != null) {
+ try {
+ int width = settings.getInt("DIALOG_WIDTH"); //$NON-NLS-1$
+ int height = settings.getInt("DIALOG_HEIGHT"); //$NON-NLS-1$
+ if(width > 0 & height > 0) {
+ return new Point(width, height);
+ }
+ }
+ catch (NumberFormatException nfe) {
+ return new Point(350, 400);
+ }
+ }
+ return new Point(350, 400);
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java
new file mode 100644
index 000000000..7256fb953
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.ui;
+
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationListener;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Common function for a launch tab that edits a launch option.
+ * <p>
+ * This class is intended to be subclassed by clients contributing launch tabs
+ * that modify launch options.
+ * </p>
+ * @since 3.3
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This class has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ */
+public abstract class AbstractOptionLaunchConfigurationTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationListener {
+
+ /**
+ * Returns the set of the options this tab modifies.
+ *
+ * @return set of the options this tab modifies
+ */
+ public abstract Set getOptions();
+
+ /**
+ * Updates the controls associated with this tab's launch options.
+ * Called when a launch configuration has changed, which can occur when a tab
+ * is de-activated, or if an option is modified outside of the tabs' control.
+ *
+ * @param options the current set of options specified by the working copy being edited
+ */
+ public abstract void updateOptionControls(Set options);
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this);
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
+ */
+ public void dispose() {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this);
+ super.dispose();
+ }
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ public void launchConfigurationAdded(ILaunchConfiguration configuration) {}
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ public void launchConfigurationRemoved(ILaunchConfiguration configuration) {}
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ public void launchConfigurationChanged(ILaunchConfiguration configuration) {
+ try {
+ updateOptionControls(configuration.getOptions());
+ }
+ catch (CoreException e) {DebugUIPlugin.log(e);}
+ }
+
+}

Back to the top