diff options
author | Mike Rennie | 2013-08-19 16:37:06 +0000 |
---|---|---|
committer | Mike Rennie | 2013-08-19 16:37:06 +0000 |
commit | 779bd79172850c4a8bb5cc170b763cde5c62457d (patch) | |
tree | 35d9807ba97490ce999816c1fc494002f9660d29 | |
parent | 254b1f9da2073a6be0a0d38bc0925b49c53259c0 (diff) | |
download | eclipse.platform.debug-779bd79172850c4a8bb5cc170b763cde5c62457d.tar.gz eclipse.platform.debug-779bd79172850c4a8bb5cc170b763cde5c62457d.tar.xz eclipse.platform.debug-779bd79172850c4a8bb5cc170b763cde5c62457d.zip |
Bug 415350 - Remove JDT Debug requirement from mixedmode example
11 files changed, 130 insertions, 342 deletions
diff --git a/org.eclipse.debug.examples.mixedmode/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.mixedmode/META-INF/MANIFEST.MF index e8da569b9..05d14d851 100755 --- a/org.eclipse.debug.examples.mixedmode/META-INF/MANIFEST.MF +++ b/org.eclipse.debug.examples.mixedmode/META-INF/MANIFEST.MF @@ -9,8 +9,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.debug.core;bundle-version="3.9.0", org.eclipse.debug.ui;bundle-version="3.10.0", - org.eclipse.jdt.launching;bundle-version="3.7.100", - org.eclipse.jdt.debug.ui;bundle-version="3.6.300", org.eclipse.ui.workbench.texteditor Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.debug.internal.examples.mixedmode;x-internal:=true diff --git a/org.eclipse.debug.examples.mixedmode/OSGI-INF/l10n/bundle.properties b/org.eclipse.debug.examples.mixedmode/OSGI-INF/l10n/bundle.properties index d64a01bff..b29c9ac59 100644 --- a/org.eclipse.debug.examples.mixedmode/OSGI-INF/l10n/bundle.properties +++ b/org.eclipse.debug.examples.mixedmode/OSGI-INF/l10n/bundle.properties @@ -11,11 +11,15 @@ #Properties file for org.eclipse.debug.examples.mixedmode Bundle-Vendor = Eclipse.org Bundle-Name = Mixed-mode Launching Example -launchDelegate.name = Foo Launch Delegate -launchDelegate.name.0 = Profile Your Foo Delegate -launchMode.label = Foo Applet Mode -launchMode.launchAsLabel = Foo Applet +launchDelegate.name = DoNothing Redirect Delegate +launchDelegate.name.0 = DoNothing Profile Redirect Delegate +launchMode.label = DoNothing Launch Mode +launchMode.launchAsLabel = DoNothing actionSet.label = Clear Preferred Delegates menu.label = Preferred Delegates -action.label = Clear AllInformation -action.tooltip = This action is used for testing purposes only and clears all preferred delegate information from your workspace
\ No newline at end of file +action.label = Clear Preferred Delegates +action.tooltip = This command is used for testing purposes only and clears all preferred delegate information from your workspace +antExtraTab.name = Ant Extra +doNothingMainTab.name = DoNothing Main +doNothingProfileTab.name = DoNothing Profile +menu.label.0 = Preferred Delegates
\ No newline at end of file diff --git a/org.eclipse.debug.examples.mixedmode/plugin.xml b/org.eclipse.debug.examples.mixedmode/plugin.xml index d39078d9c..22ed23b29 100755 --- a/org.eclipse.debug.examples.mixedmode/plugin.xml +++ b/org.eclipse.debug.examples.mixedmode/plugin.xml @@ -4,17 +4,17 @@ <extension point="org.eclipse.debug.core.launchDelegates"> <launchDelegate - delegate="org.eclipse.jdt.internal.launching.JavaAppletLaunchConfigurationDelegate" - delegateDescription="This launch tooling redirects the default java launch delegate to a java applet launch delegate instead" - id="org.foo.testing" + delegate="org.eclipse.debug.internal.examples.mixedmode.DoNothingLaunchConfigurationDelegate" + delegateDescription="This launch tooling redirects the default Java launch delegate to a DoNothing delegate" + id="org.eclipse.debug.examples.mixedmode.donothing.redirect" modes="run, debug" name="%launchDelegate.name" type="org.eclipse.jdt.launching.localJavaApplication"> </launchDelegate> <launchDelegate - delegate="org.eclipse.debug.internal.examples.mixedmode.ProfileLaunchConfigurationDelegate" - delegateDescription="This delegate performs profiling in debug, profile mode" - id="test.launch.options.profileLaunchDelegate" + delegate="org.eclipse.debug.internal.examples.mixedmode.DoNothingLaunchConfigurationDelegate" + delegateDescription="This delegate redirects a profile launch in run, debug, profile mode to a DoNothing delegate" + id="org.eclipse.debug.examples.mixedmode.profile" modes="run, debug" name="%launchDelegate.name.0" type="org.eclipse.jdt.launching.localJavaApplication"> @@ -26,32 +26,32 @@ <extension point="org.eclipse.debug.ui.launchConfigurationTabs"> <tab - class="org.eclipse.debug.internal.examples.mixedmode.FooTab" + class="org.eclipse.debug.internal.examples.mixedmode.DoNothingMainTab" group="org.eclipse.jdt.debug.ui.launchConfigurationTabGroup.localJavaApplication" - id="org.eclipse.jdt.debug.ui.fooTab" - name="Foo Tab"> + id="org.eclipse.debug.examples.mixedmode.main.tab" + name="%doNothingMainTab.name"> <placement after="org.eclipse.jdt.debug.ui.javaMainTab"></placement> <associatedDelegate - delegate="org.foo.testing"> + delegate="org.eclipse.debug.examples.mixedmode.donothing.redirect"> </associatedDelegate> </tab> <tab - class="org.eclipse.debug.internal.examples.mixedmode.FooPiggyBackTab" + class="org.eclipse.debug.internal.examples.mixedmode.AntExtraTab" group="org.eclipse.ant.ui.launchConfigurationTabGroup.ant" - id="test.launching.options.ant.footab" - name="Foo Ant Piggyback"> + id="org.eclipse.debug.examples.mixedmode.ant.tab" + name="%antExtraTab.name"> </tab> <tab - class="org.eclipse.debug.internal.examples.mixedmode.FooDuplicateTab" + class="org.eclipse.debug.internal.examples.mixedmode.DoNothingMainTab" group="org.eclipse.jdt.debug.ui.launchConfigurationTabGroup.localJavaApplication" - id="test.launch.options.profileFooTab" - name="Profile"> + id="org.eclipse.debug.examples.mixedmode.profile.tab" + name="%doNothingProfileTab.name"> <placement after="org.eclipse.jdt.debug.ui.javaMainTab"> </placement> <associatedDelegate - delegate="test.launch.options.profileLaunchDelegate"> + delegate="org.eclipse.debug.examples.mixedmode.profile"> </associatedDelegate> </tab> </extension> @@ -60,32 +60,31 @@ <launchMode label="%launchMode.label" launchAsLabel="%launchMode.launchAsLabel" - mode="test.launch.options.fooApplet"> + mode="org.eclipse.debug.examples.mixedmode.launchmode"> </launchMode> </extension> <extension - point="org.eclipse.ui.actionSets"> - <actionSet - id="test.launch.options.actionSet.clearDebugPrefs" - label="%actionSet.label" - visible="true"> + point="org.eclipse.ui.menus"> + <menuContribution + allPopups="false" + locationURI="menu:org.eclipse.ui.main.menu?after=org.eclipse.ui.run"> <menu - id="test.launch.options.pdi" - label="%menu.label" - path="additions"> - <groupMarker - name="tlordi"> - </groupMarker> + label="%menu.label.0"> + <command + commandId="org.eclipse.debug.examples.mixedmode.clear.delegates" + style="push"> + </command> </menu> - <action - class="org.eclipse.debug.internal.examples.mixedmode.ClearAllDelegateInformationAction" - id="test.launch.options.action1" - label="%action.label" - menubarPath="test.launch.options.pdi/tlordi" - style="push" - tooltip="%action.tooltip"> - </action> - </actionSet> + </menuContribution> + </extension> + <extension + point="org.eclipse.ui.commands"> + <command + defaultHandler="org.eclipse.debug.internal.examples.mixedmode.ClearPreferredDelegatesHandler" + description="%action.tooltip" + id="org.eclipse.debug.examples.mixedmode.clear.delegates" + name="%action.label"> + </command> </extension> </plugin> diff --git a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/FooPiggyBackTab.java b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/AntExtraTab.java index cf6711282..a3edf3978 100755 --- a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/FooPiggyBackTab.java +++ b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/AntExtraTab.java @@ -13,22 +13,22 @@ package org.eclipse.debug.internal.examples.mixedmode; import java.util.HashSet; import java.util.Set; -public class FooPiggyBackTab extends FooTab { +public class AntExtraTab extends DoNothingMainTab { /** - * @see org.eclipse.debug.internal.examples.mixedmode.FooTab#getName() + * @see org.eclipse.debug.internal.examples.mixedmode.DoNothingMainTab#getName() */ @Override public String getName() { - return Messages.FooPiggyBackTab_0; + return Messages.AntExtraTab_0; } /** - * @see org.eclipse.debug.internal.examples.mixedmode.FooTab#getId() + * @see org.eclipse.debug.internal.examples.mixedmode.DoNothingMainTab#getId() */ @Override public String getId() { - return Messages.FooPiggyBackTab_1; + return "org.eclipse.debug.examples.mixedmode.ant.tab"; //$NON-NLS-1$ } /** @@ -38,8 +38,8 @@ public class FooPiggyBackTab extends FooTab { public Set<String> getModes() { if (fOptions == null) { fOptions = new HashSet<String>(); - fOptions.add(Messages.FooPiggyBackTab_2); - fOptions.add(Messages.FooPiggyBackTab_3); + fOptions.add("ant"); //$NON-NLS-1$ + fOptions.add("test"); //$NON-NLS-1$ } return fOptions; } diff --git a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearAllDelegateInformationAction.java b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearAllDelegateInformationAction.java deleted file mode 100755 index 8947a7ca5..000000000 --- a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearAllDelegateInformationAction.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.examples.mixedmode; - -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.internal.ui.DebugUIPlugin; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; - -/** - * Class defines an action used to clear all of the preferred launch delegate - * information from the launch configuration types and from the debug - * preferences - */ -public class ClearAllDelegateInformationAction implements IWorkbenchWindowActionDelegate { - - /** - * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() - */ - @Override - public void dispose() { - } - - /** - * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow) - */ - @Override - public void init(IWorkbenchWindow window) { - } - - /** - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public void run(IAction action) { - Runnable runner = new Runnable() { - @Override - public void run() { - try { - ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager(); - ILaunchConfigurationType[] types = lm.getLaunchConfigurationTypes(); - Set<Set<String>> modes = null; - Set<String> mode = null; - for (int i = 0; i < types.length; i++) { - modes = types[i].getSupportedModeCombinations(); - for (Iterator<Set<String>> iter = modes.iterator(); iter.hasNext();) { - mode = iter.next(); - types[i].setPreferredDelegate(mode, null); - } - } - } catch (CoreException ce) { - DebugPlugin.log(ce); - } - } - }; - DebugUIPlugin.getStandardDisplay().asyncExec(runner); - } - - /** - * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, - * org.eclipse.jface.viewers.ISelection) - */ - @Override - public void selectionChanged(IAction action, ISelection selection) { - } - -} diff --git a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearPreferredDelegatesHandler.java b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearPreferredDelegatesHandler.java new file mode 100644 index 000000000..fdef5de75 --- /dev/null +++ b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearPreferredDelegatesHandler.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) Aug 19, 2013 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.examples.mixedmode; + +import java.util.Iterator; +import java.util.Set; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchManager; + +/** + * Handler for the Clear Preferred Delegates command + */ +public class ClearPreferredDelegatesHandler extends AbstractHandler { + + /* (non-Javadoc) + * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager(); + ILaunchConfigurationType[] types = lm.getLaunchConfigurationTypes(); + Set<Set<String>> modes = null; + Set<String> mode = null; + for (int i = 0; i < types.length; i++) { + modes = types[i].getSupportedModeCombinations(); + for (Iterator<Set<String>> iter = modes.iterator(); iter.hasNext();) { + mode = iter.next(); + try { + types[i].setPreferredDelegate(mode, null); + } catch (CoreException ce) { + // /do nothing + } + } + } + return null; + } +} diff --git a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ProfileLaunchConfigurationDelegate.java b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/DoNothingLaunchConfigurationDelegate.java index c62fc6797..73dabeae5 100644 --- a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ProfileLaunchConfigurationDelegate.java +++ b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/DoNothingLaunchConfigurationDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) Aug 13, 2013 IBM Corporation and others. + * Copyright (c) Aug 19, 2013 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 @@ -17,14 +17,14 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; /** - * + * A launch delegate that does nothing */ -public class ProfileLaunchConfigurationDelegate implements ILaunchConfigurationDelegate { +public class DoNothingLaunchConfigurationDelegate implements ILaunchConfigurationDelegate { /** * */ - public ProfileLaunchConfigurationDelegate() { + public DoNothingLaunchConfigurationDelegate() { } /* (non-Javadoc) @@ -33,6 +33,7 @@ public class ProfileLaunchConfigurationDelegate implements ILaunchConfigurationD @Override public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { // do nothing + System.out.println("The 'DoNothing' delegate launched successfully"); //$NON-NLS-1$ } } diff --git a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/FooTab.java b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/DoNothingMainTab.java index daafdb6d7..dbcabf4eb 100755 --- a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/FooTab.java +++ b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/DoNothingMainTab.java @@ -29,9 +29,9 @@ import org.eclipse.swt.widgets.Composite; /** * */ -public class FooTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationListener { +public class DoNothingMainTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationListener { - protected Button fButt = null; + protected Button fButton = null; protected Set<String> fOptions = null; /** @@ -40,8 +40,8 @@ public class FooTab extends AbstractLaunchConfigurationTab implements ILaunchCon @Override public void createControl(Composite parent) { Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_BOTH); - fButt = SWTFactory.createCheckButton(comp, Messages.FooTab_0, null, false, 1); - fButt.addSelectionListener(new SelectionListener() { + fButton = SWTFactory.createCheckButton(comp, Messages.DoNothingMainTab_0, null, false, 1); + fButton.addSelectionListener(new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent e) { } @@ -61,7 +61,7 @@ public class FooTab extends AbstractLaunchConfigurationTab implements ILaunchCon */ @Override public String getName() { - return Messages.FooTab_1; + return Messages.DoNothingMainTab_1; } /** @@ -69,7 +69,7 @@ public class FooTab extends AbstractLaunchConfigurationTab implements ILaunchCon */ protected Set<String> getModes() { Set<String> set = new HashSet<String>(); - set.add(Messages.FooTab_2); + set.add("profile"); //$NON-NLS-1$ return set; } @@ -91,9 +91,9 @@ public class FooTab extends AbstractLaunchConfigurationTab implements ILaunchCon Set<String> modes = configuration.getModes(); if (modes != null) { modes.add(getLaunchConfigurationDialog().getMode()); - fButt.setSelection(getModes().containsAll(modes)); + fButton.setSelection(getModes().containsAll(modes)); } else { - fButt.setSelection(false); + fButton.setSelection(false); } } catch (CoreException ce) { } @@ -104,7 +104,7 @@ public class FooTab extends AbstractLaunchConfigurationTab implements ILaunchCon */ @Override public void performApply(ILaunchConfigurationWorkingCopy configuration) { - if (fButt.getSelection()) { + if (fButton.getSelection()) { configuration.addModes(getModes()); } else { configuration.removeModes(getModes()); @@ -123,7 +123,7 @@ public class FooTab extends AbstractLaunchConfigurationTab implements ILaunchCon */ @Override public String getId() { - return Messages.FooTab_3; + return "org.eclipse.debug.examples.mixedmode.main.tab"; //$NON-NLS-1$ } /** @@ -134,12 +134,12 @@ public class FooTab extends AbstractLaunchConfigurationTab implements ILaunchCon try { Set<String> modes = configuration.getModes(); modes.add(getLaunchConfigurationDialog().getMode()); - if (!fButt.isDisposed()) { - boolean sel = fButt.getSelection(); + if (!fButton.isDisposed()) { + boolean sel = fButton.getSelection(); if (!sel & modes.containsAll(getModes())) { - fButt.setSelection(true); + fButton.setSelection(true); } else if (sel & !modes.containsAll(getModes())) { - fButt.setSelection(false); + fButton.setSelection(false); } } } catch (CoreException ce) { diff --git a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/FooDuplicateTab.java b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/FooDuplicateTab.java deleted file mode 100755 index 2b7e111c4..000000000 --- a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/FooDuplicateTab.java +++ /dev/null @@ -1,164 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.examples.mixedmode; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationListener; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.internal.core.LaunchConfiguration; -import org.eclipse.debug.internal.ui.DebugUIPlugin; -import org.eclipse.debug.internal.ui.SWTFactory; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - -public class FooDuplicateTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationListener { - - protected Button fButt = null; - protected Set<String> fOptions = null; - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() - */ - @Override - public String getName() { - return Messages.FooDuplicateTab_0; - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) - */ - @Override - public void createControl(Composite parent) { - Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_BOTH); - fButt = SWTFactory.createCheckButton(comp, Messages.FooDuplicateTab_1, null, false, 1); - fButt.addSelectionListener(new SelectionListener() { - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - - @Override - public void widgetSelected(SelectionEvent e) { - updateLaunchConfigurationDialog(); - } - - }); - setControl(comp); - getLaunchManager().addLaunchConfigurationListener(this); - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) - */ - @Override - public void initializeFrom(ILaunchConfiguration configuration) { - try { - Set<?> options = configuration.getAttribute(LaunchConfiguration.ATTR_LAUNCH_MODES, (Set<String>) null); - if (options != null) { - fButt.setSelection(options.containsAll(getModes())); - } else { - fButt.setSelection(false); - } - } catch (CoreException ce) { - } - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - @Override - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - if (isDirty()) { - if (fButt.getSelection()) { - configuration.addModes(getModes()); - } else { - configuration.removeModes(getModes()); - } - } - } - - /** - * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#dispose() - */ - @Override - public void dispose() { - getLaunchManager().removeLaunchConfigurationListener(this); - super.dispose(); - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - @Override - public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { - } - - /** - * @return the set modes this tab works with - */ - protected Set<String> getModes() { - if (fOptions == null) { - fOptions = new HashSet<String>(); - fOptions.add(Messages.FooDuplicateTab_2); - } - return fOptions; - } - - /** - * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId() - */ - @Override - public String getId() { - return Messages.FooDuplicateTab_3; - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration) - */ - @Override - public void launchConfigurationChanged(ILaunchConfiguration configuration) { - try { - Set<?> modes = configuration.getModes(); - if (!fButt.isDisposed()) { - boolean sel = fButt.getSelection(); - if (sel & !modes.containsAll(getModes())) { - fButt.setSelection(false); - } else if (!sel & modes.containsAll(getModes())) { - fButt.setSelection(true); - } - } - } catch (CoreException ce) { - DebugUIPlugin.log(ce); - } - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration) - */ - @Override - public void launchConfigurationAdded(ILaunchConfiguration configuration) { - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration) - */ - @Override - public void launchConfigurationRemoved(ILaunchConfiguration configuration) { - } -} diff --git a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/Messages.java b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/Messages.java index 669969475..ce1be9580 100644 --- a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/Messages.java +++ b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/Messages.java @@ -14,18 +14,9 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.debug.internal.examples.mixedmode.messages"; //$NON-NLS-1$ - public static String FooDuplicateTab_0; - public static String FooDuplicateTab_1; - public static String FooDuplicateTab_2; - public static String FooDuplicateTab_3; - public static String FooPiggyBackTab_0; - public static String FooPiggyBackTab_1; - public static String FooPiggyBackTab_2; - public static String FooPiggyBackTab_3; - public static String FooTab_0; - public static String FooTab_1; - public static String FooTab_2; - public static String FooTab_3; + public static String AntExtraTab_0; + public static String DoNothingMainTab_0; + public static String DoNothingMainTab_1; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/messages.properties b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/messages.properties index 5ef662509..8ac74cd57 100644 --- a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/messages.properties +++ b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/messages.properties @@ -8,15 +8,6 @@ # Contributors: # IBM Corporation - initial API and implementation ############################################################################### -FooDuplicateTab_0=Foo Duplicate Tab -FooDuplicateTab_1=Check me to retarget the launch delegate. -FooDuplicateTab_2=foodupe -FooDuplicateTab_3=test.launch.options.fooduplicatetab -FooPiggyBackTab_0=Foo Piggyback Tab -FooPiggyBackTab_1=test.launch.options.anttab -FooPiggyBackTab_2=ant -FooPiggyBackTab_3=test -FooTab_0=Check me to retarget the launch delegate. -FooTab_1=Foo Tab -FooTab_2=footab -FooTab_3=test.launch.options.footab +AntExtraTab_0=Ant Extra Tab +DoNothingMainTab_0=Check to retarget the launch delegate. +DoNothingMainTab_1=DoNothing Main |