Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java90
1 files changed, 90 insertions, 0 deletions
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