Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java123
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java998
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java445
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java115
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java935
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java71
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java215
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java895
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java685
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java154
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointTypeCategory.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugEditorPresentation.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java143
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentationExtension.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java1266
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java177
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane.java97
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane2.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java90
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java238
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java158
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchGroup.java102
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut.java153
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut2.java93
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java357
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java487
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java245
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java476
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java504
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java91
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java345
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java324
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java343
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java279
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java219
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryBlocksTarget.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryRenderingsTarget.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ILaunchable.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IRunToLineTarget.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTarget.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapterExtension.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java409
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java178
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java310
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java329
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java149
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java106
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java243
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java124
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java201
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java151
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java227
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/package.html17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java98
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java159
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java144
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleColorProvider.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTracker.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTrackerExtension.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/package.html51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/DebugContextEvent.java98
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextListener.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextManager.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextService.java127
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTriggerListener.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/package.html50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java404
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java3814
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java143
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryBlockTablePresentation.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRendering.java176
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsListener.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsProvider.java79
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingContainer.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingManager.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSite.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSynchronizationService.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingType.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingTypeDelegate.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IRepositionableMemoryRendering.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IResettableMemoryRendering.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/MemoryRenderingElement.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/package.html19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java313
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java105
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceContainerBrowser.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceDisplay.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceLookupResult.java61
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java145
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java150
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/package.html21
116 files changed, 0 insertions, 22731 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
deleted file mode 100644
index 438180c23..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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 org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.breakpoints.OtherBreakpointCategory;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-/**
- * Common function for breakpoint organizer delegates.
- * <p>
- * Clients implementing <code>IBreakpointOrganizerDelegate</code> must subclass this class.
- * </p>
- * @since 3.1
- */
-public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpointOrganizerDelegate {
-
- // property change listeners
- private ListenerList fListeners = new ListenerList();
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
- // do noting, not supported by default
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- *
- * Subclasses that override should return super.canAdd(...) when they are not able to add
- * the breakpoint.
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canAdd(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public boolean canAdd(IBreakpoint breakpoint, IAdaptable category) {
- return category instanceof OtherBreakpointCategory;
- }
-
- /* (non-Javadoc)
- *
- * Subclasses that override should return super.canRemove(...) when they are not able to remove
- * the breakpoint.
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canRemove(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public boolean canRemove(IBreakpoint breakpoint, IAdaptable category) {
- return category instanceof OtherBreakpointCategory;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
- */
- public void dispose() {
- fListeners = new ListenerList();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removeBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
- // do nothing, not supported by default
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- fListeners.remove(listener);
- }
-
- /**
- * Fires a property change notification for the given category.
- *
- * @param category category that has changed
- */
- protected void fireCategoryChanged(IAdaptable category) {
- if (fListeners.isEmpty()) {
- return;
- }
- final PropertyChangeEvent event = new PropertyChangeEvent(this, P_CATEGORY_CHANGED, category, null);
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i];
- ISafeRunnable runnable = new ISafeRunnable() {
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- public void run() throws Exception {
- listener.propertyChange(event);
- }
- };
- SafeRunner.run(runnable);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories()
- */
- public IAdaptable[] getCategories() {
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
deleted file mode 100644
index a0eb8f5b5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
+++ /dev/null
@@ -1,998 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 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.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.IPage;
-import org.eclipse.ui.part.MessagePage;
-import org.eclipse.ui.part.Page;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.PageBookView;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Common function for views related to debugging. Clients implementing
- * views for a debugger should subclass this class. Common function
- * includes:
- * <ul>
- * <li>Debug view adapter implementation - <code>IDebugView</code></li>
- * <li>Action registry - actions can be stored in this view
- * with a key. Actions that implement <code>IUpdate</code>
- * are updated when <code>updateActions()</code> is
- * called.</li>
- * <li>Hooks the context menu associated with this view's
- * underlying viewer and registers the menu with this
- * view's site, such that other plug-ins may contribute.</li>
- * <li>Hooks a key press listener, and invokes the
- * <code>REMOVE_ACTION</code> when the delete key
- * is pressed.</li>
- * <li>Hooks a double-click listener, and invokes the
- * <code>DOUBLE_CLICK_ACTION</code> when the mouse
- * is double-clicked.</li>
- * <li>Provides a mechanism for displaying an error message
- * in the view, via the <code>PageBookView</code> mechanism.
- * By default, a page book is created with a page showing
- * this view's viewer. A message page is also created
- * and shown when <code>showMessage(String)</code> is
- * called.</li>
- * <li>Notification when this view becomes visible and becomes
- * hidden via <code>becomesVisible()</code> and <code>becomesHidden()</code>.</li>
- * <li>Linking of a help context id via <code>getHelpContextId().</code></li>
- * </ul>
- * <p>
- * This class may be sub-classed.
- * </p>
- * @since 2.0
- */
-
-public abstract class AbstractDebugView extends PageBookView implements IDebugView, IDoubleClickListener {
-
- /**
- * Underlying viewer that displays the contents of
- * this view.
- */
- private Viewer fViewer = null;
-
- /**
- * This view's message page.
- */
- private MessagePage fMessagePage = null;
-
- /**
- * Map of actions. Keys are strings, values
- * are <code>IAction</code>.
- */
- private Map fActionMap = null;
-
- /**
- * Map of actions. Keys are strings, values
- * are <code>IAction</code>.
- */
- private List fUpdateables = null;
-
- /**
- * The collection of menu managers that are
- * relevant for this view.
- */
- private List fContextMenuManagers;
-
- /**
- * The memento that was used to persist the state of this view.
- * May be <code>null</code>.
- */
- private IMemento fMemento;
-
- /**
- * Whether this view is currently visible.
- */
- private boolean fIsVisible = false;
-
- /**
- * The part listener for this view, used to notify this view when it
- * becomes visible and hidden. Set to <code>null</code> when this view isn't
- * currently listening to part changes.
- */
- private DebugViewPartListener fPartListener= null;
-
- /**
- * A message was requested to be displayed before the view was fully
- * created. The message is cached until it can be properly displayed.
- */
- private String fEarlyMessage= null;
-
- private static Set fgGlobalActionIds;
- static {
- fgGlobalActionIds = new HashSet();
- fgGlobalActionIds.add(SELECT_ALL_ACTION);
- fgGlobalActionIds.add(COPY_ACTION);
- fgGlobalActionIds.add(CUT_ACTION);
- fgGlobalActionIds.add(PASTE_ACTION);
- fgGlobalActionIds.add(FIND_ACTION);
- fgGlobalActionIds.add(ActionFactory.UNDO.getId());
- fgGlobalActionIds.add(ActionFactory.REDO.getId());
- }
-
- /**
- * Part listener that disables updating when the view is not visible and
- * re-enables updating when the view appears.
- */
- private class DebugViewPartListener implements IPartListener2 {
- /**
- *
- * @see org.eclipse.ui.IPartListener2#partVisible(IWorkbenchPartReference)
- */
- public void partVisible(IWorkbenchPartReference ref) {
- IWorkbenchPart part= ref.getPart(false);
- if (part == AbstractDebugView.this) {
- fIsVisible = true;
- becomesVisible();
- }
- }
- /**
- * @see org.eclipse.ui.IPartListener2#partHidden(IWorkbenchPartReference)
- */
- public void partHidden(IWorkbenchPartReference ref) {
- IWorkbenchPart part= ref.getPart(false);
- if (part == AbstractDebugView.this) {
- fIsVisible = false;
- becomesHidden();
- }
- }
- /**
- * @see org.eclipse.ui.IPartListener2#partActivated(IWorkbenchPartReference)
- */
- public void partActivated(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(IWorkbenchPartReference)
- */
- public void partBroughtToTop(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partClosed(IWorkbenchPartReference)
- */
- public void partClosed(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partDeactivated(IWorkbenchPartReference)
- */
- public void partDeactivated(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partOpened(IWorkbenchPartReference)
- */
- public void partOpened(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partInputChanged(IWorkbenchPartReference)
- */
- public void partInputChanged(IWorkbenchPartReference ref){
- }
-
- }
-
- /**
- * Constructs a new debug view.
- */
- public AbstractDebugView() {
- fActionMap = new HashMap(5);
- fUpdateables= new ArrayList(3);
- }
-
- /**
- * Debug views implement the debug view adapter which
- * provides access to a view's underlying viewer and
- * debug model presentation for a specific debug model.
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- * @see IDebugView
- */
- public Object getAdapter(Class adapter) {
- if (adapter == IDebugView.class) {
- return this;
- }
- if (adapter == IDebugModelPresentation.class) {
- StructuredViewer viewer = getStructuredViewer();
- if (viewer != null) {
- IBaseLabelProvider labelProvider = viewer.getLabelProvider();
- if (labelProvider instanceof IDebugModelPresentation) {
- return labelProvider;
- }
- }
- }
- return super.getAdapter(adapter);
- }
-
- /**
- * A page in this view's page book that contains this
- * view's viewer.
- */
- class ViewerPage extends Page {
- /**
- * @see IPage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- Viewer viewer = createViewer(parent);
- setViewer(viewer);
- }
-
- /**
- * @see IPage#getControl()
- */
- public Control getControl() {
- return getDefaultControl();
- }
-
- /**
- * @see IPage#setFocus()
- */
- public void setFocus() {
- Viewer viewer= getViewer();
- if (viewer != null) {
- Control c = viewer.getControl();
- if (!c.isFocusControl()) {
- c.setFocus();
- }
- }
- }
-
-}
-
- /**
- * Creates this view's underlying viewer and actions.
- * Hooks a pop-up menu to the underlying viewer's control,
- * as well as a key listener. When the delete key is pressed,
- * the <code>REMOVE_ACTION</code> is invoked. Hooks help to
- * this view. Subclasses must implement the following methods
- * which are called in the following order when a view is
- * created:<ul>
- * <li><code>createViewer(Composite)</code> - the context
- * menu is hooked to the viewer's control.</li>
- * <li><code>createActions()</code></li>
- * <li><code>configureToolBar(IToolBarManager)</code></li>
- * <li><code>getHelpContextId()</code></li>
- * </ul>
- * @see IWorkbenchPart#createPartControl(Composite)
- * @see AbstractDebugView#createPartControl(Composite)
- * @see AbstractDebugView#createActions()
- * @see AbstractDebugView#configureToolBar(IToolBarManager)
- * @see AbstractDebugView#getHelpContextId()
- * @see AbstractDebugView#fillContextMenu(IMenuManager)
- */
- public void createPartControl(Composite parent) {
- registerPartListener();
- super.createPartControl(parent);
- createActions();
- initializeToolBar();
- Viewer viewer = getViewer();
- if (viewer != null) {
- createContextMenu(viewer.getControl());
- }
- String helpId = getHelpContextId();
- if (helpId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, helpId);
- }
- if (viewer != null) {
- getViewer().getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleKeyPressed(e);
- }
- });
- if (getViewer() instanceof StructuredViewer) {
- ((StructuredViewer)getViewer()).addDoubleClickListener(this);
- }
- }
- // create the message page
- setMessagePage(new MessagePage());
- getMessagePage().createControl(getPageBook());
- initPage(getMessagePage());
-
- if (fEarlyMessage != null) { //bug 28127
- showMessage(fEarlyMessage);
- fEarlyMessage= null;
- }
- }
-
- /**
- * The default page for a debug view is its viewer.
- *
- * @see PageBookView#createDefaultPage(PageBook)
- */
- protected IPage createDefaultPage(PageBook book) {
- ViewerPage page = new ViewerPage();
- page.createControl(book);
- initPage(page);
- return page;
- }
-
- /**
- * Creates and returns this view's underlying viewer.
- * The viewer's control will automatically be hooked
- * to display a pop-up menu that other plug-ins may
- * contribute to. Subclasses must override this method.
- *
- * @param parent the parent control
- */
- protected abstract Viewer createViewer(Composite parent);
-
- /**
- * Creates this view's actions. Subclasses must
- * override this method, which is called after
- * <code>createViewer(Composite)</code>
- */
- protected abstract void createActions();
-
- /**
- * Returns this view's help context id, which is hooked
- * to this view on creation.
- *
- * @return help context id
- */
- protected abstract String getHelpContextId();
-
- /**
- * @see IWorkbenchPart#dispose()
- */
- public void dispose() {
- saveAllCheckedActionStates();
- deregisterPartListener();
- if (getViewer() instanceof StructuredViewer) {
- ((StructuredViewer)getViewer()).removeDoubleClickListener(this);
- }
- setViewer(null);
- fActionMap.clear();
- super.dispose();
- }
-
- /**
- * Saves the checked state for all actions contributed to the toolbar
- * manager that function as a toggle action. The states are saved in
- * the Debug UI plugin's preference store.
- *
- * @since 2.1
- */
- protected void saveAllCheckedActionStates() {
- IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
- IContributionItem[] items= tbm.getItems();
- for (int i = 0; i < items.length; i++) {
- IContributionItem iContributionItem = items[i];
- if (iContributionItem instanceof ActionContributionItem) {
- ActionContributionItem item= (ActionContributionItem)iContributionItem;
- IAction action= item.getAction();
- if (action.getStyle() == IAction.AS_CHECK_BOX && action.isEnabled()) {
- saveCheckedActionState(action);
- }
- }
- }
- }
-
- /**
- * Save the checked state of the specified action in the Debug UI plugin's
- * preference store. The specified action is expected to be enabled and
- * support the style <code>IAction.AS_CHECK_BOX</code>.
- *
- * @param action the enabled, toggle action whose checked state will be
- * saved in preferences
- * @since 2.1
- */
- protected void saveCheckedActionState(IAction action) {
- String prefKey = generatePreferenceKey(action);
- IPreferenceStore prefStore = getPreferenceStore();
- prefStore.setValue(prefKey, action.isChecked());
- }
-
- /**
- * Generate a String that can be used as a key into a preference store based
- * on the specified action. The resulting String will be unique across
- * views.
- *
- * @return a String suitable for use as a preference store key for the given
- * action
- * @since 2.1
- */
- protected String generatePreferenceKey(IAction action) {
- return getViewSite().getId() + '+' + action.getId();
- }
-
- /**
- * Convenience method to return the preference store for the Debug UI
- * plug-in.
- *
- * @return the preference store for the Debug UI plug-in
- * @since 2.1
- */
- protected IPreferenceStore getPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @see IDebugView#getViewer()
- */
- public Viewer getViewer() {
- return fViewer;
- }
-
- /**
- * Returns this view's viewer as a structured viewer,
- * or <code>null</code> if none.
- *
- * @return this view's viewer as a structured viewer
- * or <code>null</code>
- */
- protected StructuredViewer getStructuredViewer() {
- if (getViewer() instanceof StructuredViewer) {
- return (StructuredViewer)getViewer();
- }
- return null;
- }
-
- /**
- * Returns this view's viewer as a text viewer,
- * or <code>null</code> if none.
- *
- * @return this view's viewer as a text viewer
- * or <code>null</code>
- */
- protected TextViewer getTextViewer() {
- if (getViewer() instanceof TextViewer) {
- return (TextViewer)getViewer();
- }
- return null;
- }
-
- /**
- * @see IDebugView#getPresentation(String)
- */
- public IDebugModelPresentation getPresentation(String id) {
- if (getViewer() instanceof StructuredViewer) {
- IBaseLabelProvider lp = ((StructuredViewer)getViewer()).getLabelProvider();
- if (lp instanceof DelegatingModelPresentation) {
- return ((DelegatingModelPresentation)lp).getPresentation(id);
- }
- if (lp instanceof LazyModelPresentation) {
- if (((LazyModelPresentation)lp).getDebugModelIdentifier().equals(id)) {
- return (IDebugModelPresentation)lp;
- }
- }
- }
- return null;
- }
-
- /**
- * Creates a pop-up menu on the given control. The menu
- * is registered with this view's site, such that other
- * plug-ins may contribute to the menu. Subclasses should
- * call this method, specifying the menu control as the
- * control used in their viewer (for example, tree viewer).
- * Subclasses must implement the method
- * <code>#fillContextMenu(IMenuManager)</code> which will
- * be called each time the context menu is realized.
- *
- * @param menuControl the control with which the pop-up
- * menu will be associated with.
- */
- protected void createContextMenu(Control menuControl) {
- MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(mgr);
- }
- });
- Menu menu= menuMgr.createContextMenu(menuControl);
- menuControl.setMenu(menu);
-
- // register the context menu such that other plug-ins may contribute to it
- if (getSite() != null) {
- getSite().registerContextMenu(menuMgr, getViewer());
- }
- addContextMenuManager(menuMgr);
- }
-
- /**
- * @see IDebugView#getContextMenuManager()
- *
- * @deprecated @see AbstractDebugView.getContextMenuManagers()
- */
- public IMenuManager getContextMenuManager() {
- if (fContextMenuManagers != null) {
- fContextMenuManagers.get(fContextMenuManagers.size() - 1);
- }
- return null;
- }
-
- /**
- * Returns the context menu managers relevant to this view.
- *
- * @return the context menu managers relevant to this view
- * @since 2.1
- */
- public List getContextMenuManagers() {
- return fContextMenuManagers;
- }
-
- /**
- * Subclasses must override this method to fill the context
- * menu each time it is realized.
- *
- * @param menu the context menu
- */
- protected abstract void fillContextMenu(IMenuManager menu);
-
- /**
- * Configures this view's toolbar. Subclasses implement
- * <code>#configureToolBar(IToolBarManager)</code> to
- * contribute actions to the toolbar.
- * <p>
- * To properly initialize toggle actions that are contributed
- * to this view, state is restored for toggle actions that have
- * a persisted state in the Debug UI plugin's preferences. As well, any
- * toggle actions that have an initial state of 'checked' are invoked. The
- * actions' states are restored and the actions are invoked in a runnable,
- * after the view is created.
- * </p>
- */
- protected void initializeToolBar() {
- final IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
- configureToolBar(tbm);
- getViewSite().getActionBars().updateActionBars();
-
- // This is done in a runnable to be run after this view's pane
- // is created
- Runnable r = new Runnable() {
- public void run() {
- if (!isAvailable()) {
- return;
- }
- IContributionItem[] items = tbm.getItems();
- if (items != null) {
- for (int i = 0; i < items.length; i++) {
- if (items[i] instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem)items[i]).getAction();
- if (action.getStyle() == IAction.AS_CHECK_BOX) {
- initActionState(action);
- if (action.isChecked()) {
- action.run();
- }
- }
- }
- }
- setMemento(null);
- }
- updateObjects();
- }
- };
- asyncExec(r);
- }
-
- /**
- * Restores the persisted checked state of the specified action that was
- * stored in preferences. If the action is disabled, its persisted state
- * is not restored (because a disabled action cannot be run).
- *
- * @param action the action whose checked state will be restored
- * @since 2.1
- */
- protected void initActionState(IAction action) {
- String id = action.getId();
- if (id != null && action.isEnabled()) {
- String prefKey = generatePreferenceKey(action);
- boolean checked = getPreferenceStore().getBoolean(prefKey);
- action.setChecked(checked);
- }
- }
-
- /**
- * @see IViewPart#init(IViewSite, IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- //store the memento to be used when this view is created.
- setMemento(memento);
- }
-
- /**
- * Sets the viewer for this view.
- *
- * @param viewer viewer
- * @since 3.1
- */
- protected void setViewer(Viewer viewer) {
- fViewer = viewer;
- }
-
- /**
- * Subclasses implement this menu to contribute actions
- * to the toolbar. This method is called after
- * <code>createActions()</code>.
- *
- * @param tbm the tool bar manager for this view's site
- * @see #createViewer(Composite)
- */
- protected abstract void configureToolBar(IToolBarManager tbm);
-
- /**
- * @see IDebugView#setAction(String, IAction)
- */
- public void setAction(String actionID, IAction action) {
- if (action == null) {
- Object removedAction= fActionMap.remove(actionID);
- fUpdateables.remove(removedAction);
- } else {
- fActionMap.put(actionID, action);
- if (action instanceof IUpdate) {
- fUpdateables.add(action);
- }
- }
- if (fgGlobalActionIds.contains(actionID)) {
- IActionBars actionBars = getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(actionID, action);
- }
- }
-
- /**
- * @see IDebugView#getAction(String)
- */
- public IAction getAction(String actionID) {
- return (IAction) fActionMap.get(actionID);
- }
-
- /**
- * Updates all the registered updatables.
- */
- public void updateObjects() {
- Iterator actions = fUpdateables.iterator();
- while (actions.hasNext()) {
- ((IUpdate)actions.next()).update();
- }
- }
-
- /**
- * Handles key events in viewer. Invokes
- * <ol>
- * <li><code>REMOVE_ACTION</code> when the delete
- * key is pressed</li>
- */
- protected void handleKeyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- IAction action = getAction(REMOVE_ACTION);
- if (action != null && action.isEnabled()) {
- action.run();
- }
- }
- }
-
- /**
- * Delegate to the <code>DOUBLE_CLICK_ACTION</code>,
- * if any.
- *
- * @see IDoubleClickListener#doubleClick(DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- IAction action = getAction(DOUBLE_CLICK_ACTION);
- if (action != null && !event.getSelection().isEmpty() && action.isEnabled()) {
- action.run();
- }
- }
-
- /**
- * Registers the given runnable with the display
- * associated with this view's control, if any.
- *
- * @see org.eclipse.swt.widgets.Display#asyncExec(java.lang.Runnable)
- */
- public void asyncExec(Runnable r) {
- if (isAvailable()) {
- getControl().getDisplay().asyncExec(r);
- }
- }
-
- /**
- * Returns the control for this view, or <code>null</code> if none.
- *
- * @return the control for this view, or <code>null</code> if none
- * @since 3.0
- */
- protected Control getControl() {
- return getViewer().getControl();
- }
-
- /**
- * Registers the given runnable with the display
- * associated with this view's control, if any.
- *
- * @see org.eclipse.swt.widgets.Display#syncExec(java.lang.Runnable)
- */
- public void syncExec(Runnable r) {
- if (isAvailable()) {
- getControl().getDisplay().syncExec(r);
- }
- }
-
- /**
- * Returns the memento that contains the persisted state of
- * the view. May be <code>null</code>.
- */
- protected IMemento getMemento() {
- return fMemento;
- }
-
- /**
- * Sets the memento that contains the persisted state of the
- * view.
- */
- protected void setMemento(IMemento memento) {
- fMemento = memento;
- }
-
- /**
- * Returns the specified view in this view's page
- * or <code>null</code> if none.
- *
- * @param id view identifier
- * @return view part
- */
- protected IViewPart findView(String id) {
- IWorkbenchPage page = getSite().getPage();
- IViewPart view = null;
- if (page != null) {
- view = page.findView(id);
- }
- return view;
- }
-
- /**
- * @see PageBookView#isImportant(IWorkbenchPart)
- */
- protected boolean isImportant(IWorkbenchPart part) {
- return false;
- }
-
- /**
- * @see PageBookView#doCreatePage(IWorkbenchPart)
- */
- protected PageRec doCreatePage(IWorkbenchPart part) {
- return null;
- }
-
- /**
- * @see PageBookView#doDestroyPage(org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.part.PageBookView.PageRec)
- */
- protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
- }
-
- /**
- * @see PageBookView#getBootstrapPart()
- */
- protected IWorkbenchPart getBootstrapPart() {
- return null;
- }
-
- /**
- * Returns the default control for this view. By default,
- * this view's viewer's control is returned. Subclasses
- * should override if required - for example, if this
- * view has its viewer nested inside other controls.
- *
- * @return this view's default control.
- */
- protected Control getDefaultControl() {
- Viewer viewer = getViewer();
- if (viewer != null) {
- return viewer.getControl();
- }
- return null;
- }
-
- /**
- * Sets this view's message page
- *
- * @param page message page
- */
- private void setMessagePage(MessagePage page) {
- fMessagePage = page;
- }
-
- /**
- * Returns this view's message page
- *
- * @return message page
- */
- protected MessagePage getMessagePage() {
- return fMessagePage;
- }
-
- /**
- * Shows the given message in this view's message'
- * page. Makes the message page the visible page.
- *
- * @param message the message to display
- */
- public void showMessage(String message) {
- if (getPageBook().isDisposed()) {
- return;
- }
- if (getMessagePage() == null) {
- //not fully created yet
- fEarlyMessage= message;
- return;
- }
- getMessagePage().setMessage(message);
- getPageBook().showPage(getMessagePage().getControl());
- }
-
- /**
- * Shows this view's viewer page.
- */
- public void showViewer() {
- if (getPageBook().isDisposed()) {
- return;
- }
- getPageBook().showPage(getDefaultPage().getControl());
- }
-
- /**
- * Returns whether this view's viewer is
- * currently available.
- *
- * @return whether this view's viewer is
- * currently available
- */
- public boolean isAvailable() {
- return !(getViewer() == null || getViewer().getControl() == null || getViewer().getControl().isDisposed());
- }
- /**
- * @see IDebugView#add(IUpdate)
- */
- public void add(IUpdate updatable) {
- if (!fUpdateables.contains(updatable)) {
- fUpdateables.add(updatable);
- }
- }
-
- /**
- * @see IDebugView#remove(IUpdate)
- */
- public void remove(IUpdate updatable) {
- fUpdateables.remove(updatable);
- }
-
- /**
- * Adds a context menu manager that is relevant to this view.
- * @param contextMenuManager The contextMenuManager to add
- *
- * @since 2.1
- */
- public void addContextMenuManager(IMenuManager contextMenuManager) {
- if (fContextMenuManagers == null) {
- fContextMenuManagers= new ArrayList();
- }
- fContextMenuManagers.add(contextMenuManager);
- }
-
- /**
- * Notification this view is now visible.
- *
- * @since 2.1
- */
- protected void becomesVisible() {
- }
-
- /**
- * Notification this view is now hidden.
- *
- * @since 2.1
- */
- protected void becomesHidden() {
- }
-
- /**
- * Returns whether this view is currently visible.
- *
- * @return whether this view is currently visible
- * @since 2.1
- */
- public boolean isVisible() {
- return fIsVisible;
- }
-
- /**
- * Creates and registers a part listener with this event handler's page,
- * if one does not already exist.
- *
- * @since 2.1
- */
- protected void registerPartListener() {
- if (fPartListener == null) {
- fPartListener= new DebugViewPartListener();
- getSite().getPage().addPartListener(fPartListener);
- }
- }
-
- /**
- * Unregisters and disposes this event handler's part listener.
- *
- * @since 2.1
- */
- protected void deregisterPartListener() {
- if (fPartListener != null) {
- getSite().getPage().removePartListener(fPartListener);
- fPartListener = null;
- }
- }
-
- /**
- * Returns a map of the current attribute settings in the model
- * presentation in this view associated with the given debug model.
- *
- * @return a map of the current attribute settings in the model
- * presentation in this view associated with the given debug model
- * @since 3.0
- */
- public Map getPresentationAttributes(String modelId) {
- IDebugModelPresentation presentation = getPresentation(modelId);
- if (presentation instanceof DelegatingModelPresentation) {
- return ((DelegatingModelPresentation)presentation).getAttributeMap();
- } else if (presentation instanceof LazyModelPresentation) {
- return ((LazyModelPresentation)presentation).getAttributeMap();
- }
- return new HashMap();
- }
-}
-
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java
deleted file mode 100644
index 051ebd3ad..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 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 org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * Common function for launch configuration tabs.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see ILaunchConfigurationTab
- * @since 2.0
- */
-public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigurationTab {
-
- /**
- * The control for this page, or <code>null</code>
- */
- private Control fControl;
-
- /**
- * The launch configuration dialog this tab is
- * contained in.
- */
- private ILaunchConfigurationDialog fLaunchConfigurationDialog;
-
- /**
- * Current error message, or <code>null</code>
- */
- private String fErrorMessage;
-
- /**
- * Current message, or <code>null</code>
- */
- private String fMessage;
-
- /**
- * Whether this tab needs to apply changes. This attribute is initialized to
- * <code>true</code> to be backwards compatible. If clients want to take advantage
- * of such a feature, they should set the flag to false, and check it before
- * applying changes to the launch configuration working copy.
- *
- * @since 2.1
- */
- private boolean fDirty = true;
-
- /**
- * Job to update the tab after a delay. Used to delay updates while
- * the user is typing.
- */
- private Job fRereshJob;
-
- /**
- * Returns the dialog this tab is contained in, or
- * <code>null</code> if not yet set.
- *
- * @return launch configuration dialog, or <code>null</code>
- */
- protected ILaunchConfigurationDialog getLaunchConfigurationDialog() {
- return fLaunchConfigurationDialog;
- }
-
- /**
- * Updates the buttons and message in this page's launch
- * configuration dialog.
- */
- protected void updateLaunchConfigurationDialog() {
- if (getLaunchConfigurationDialog() != null) {
- //order is important here due to the call to
- //refresh the tab viewer in updateButtons()
- //which ensures that the messages are up to date
- getLaunchConfigurationDialog().updateButtons();
- getLaunchConfigurationDialog().updateMessage();
- }
- }
-
- /**
- * @see ILaunchConfigurationTab#getControl()
- */
- public Control getControl() {
- return fControl;
- }
-
- /**
- * Sets the control to be displayed in this tab.
- *
- * @param control the control for this tab
- */
- protected void setControl(Control control) {
- fControl = control;
- }
-
- /**
- * @see ILaunchConfigurationTab#getErrorMessage()
- */
- public String getErrorMessage() {
- return fErrorMessage;
- }
-
- /**
- * @see ILaunchConfigurationTab#getMessage()
- */
- public String getMessage() {
- return fMessage;
- }
-
- /**
- * By default, do nothing.
- *
- * @see ILaunchConfigurationTab#launched(ILaunch)
- * @deprecated
- */
- public void launched(ILaunch launch) {
- }
-
- /**
- * @see ILaunchConfigurationTab#setLaunchConfigurationDialog(ILaunchConfigurationDialog)
- */
- public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) {
- fLaunchConfigurationDialog = dialog;
- }
-
- /**
- * Sets this page's error message, possibly <code>null</code>.
- *
- * @param errorMessage the error message or <code>null</code>
- */
- protected void setErrorMessage(String errorMessage) {
- fErrorMessage = errorMessage;
- }
-
- /**
- * Sets this page's message, possibly <code>null</code>.
- *
- * @param message the message or <code>null</code>
- */
- protected void setMessage(String message) {
- fMessage = message;
- }
-
- /**
- * Convenience method to return the launch manager.
- *
- * @return the launch manager
- */
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * By default, do nothing.
- *
- * @see ILaunchConfigurationTab#dispose()
- */
- public void dispose() {
- }
-
- /**
- * Returns the shell this tab is contained in, or <code>null</code>.
- *
- * @return the shell this tab is contained in, or <code>null</code>
- */
- protected Shell getShell() {
- Control control = getControl();
- if (control != null) {
- return control.getShell();
- }
- return null;
- }
-
- /**
- * Creates and returns a new push button with the given
- * label and/or image.
- *
- * @param parent parent control
- * @param label button label or <code>null</code>
- * @param image image of <code>null</code>
- *
- * @return a new push button
- */
- protected Button createPushButton(Composite parent, String label, Image image) {
- return SWTFactory.createPushButton(parent, label, image);
- }
-
- /**
- * Creates and returns a new radio button with the given
- * label and/or image.
- *
- * @param parent parent control
- * @param label button label or <code>null</code>
- *
- * @return a new radio button
- */
- protected Button createRadioButton(Composite parent, String label) {
- return SWTFactory.createRadioButton(parent, label);
- }
-
- /**
- * Creates and returns a new check button with the given
- * label.
- *
- * @param parent the parent composite
- * @param label the button label
- * @return a new check button
- * @since 3.0
- */
- protected Button createCheckButton(Composite parent, String label) {
- return SWTFactory.createCheckButton(parent, label, null, false, 1);
- }
-
- /**
- * @see ILaunchConfigurationTab#canSave()
- */
- public boolean canSave() {
- return true;
- }
-
- /**
- * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration launchConfig) {
- return true;
- }
-
- /**
- * Creates vertical space in the parent <code>Composite</code>
- * @param comp the parent to add the vertical space to
- * @param colSpan the number of line of vertical space to add
- */
- protected void createVerticalSpacer(Composite comp, int colSpan) {
- SWTFactory.createVerticalSpacer(comp, colSpan);
- }
-
- /**
- * Create a horizontal separator.
- *
- * @param comp parent widget
- * @param colSpan number of columns to span
- * @since 3.0
- */
- protected void createSeparator(Composite comp, int colSpan) {
- Label label = new Label(comp, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = colSpan;
- label.setLayoutData(gd);
- }
-
- /**
- * @see ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return null;
- }
-
- /**
- * Returns this tab's unique identifier or <code>null</code> if none.
- * By default, <code>null</code> is returned. Subclasses should override
- * as necessary.
- * <p>
- * Tab identifiers allow contributed tabs to be ordered relative to one
- * another.
- * </p>
- * @return tab id or <code>null</code>
- * @since 3.3
- */
- public String getId() {
- return null;
- }
-
- /**
- * Convenience method to set a boolean attribute of on a launch
- * configuration. If the value being set is the default, the attribute's
- * value is set to <code>null</code>.
- *
- * @param attribute attribute identifier
- * @param configuration the configuration on which to set the attribute
- * @param value the value of the attribute
- * @param defaultValue the default value of the attribute
- * @since 2.1
- */
- protected void setAttribute(String attribute, ILaunchConfigurationWorkingCopy configuration, boolean value, boolean defaultValue) {
- if (value == defaultValue) {
- configuration.setAttribute(attribute, (String)null);
- } else {
- configuration.setAttribute(attribute, value);
- }
- }
-
-
-
- /**
- * Returns if this tab has pending changes that need to be saved.
- *
- * It is up to clients to set/reset and consult this attribute as required.
- * By default, a tab is initialized to dirty for backwards compatibility.
- *
- * @return whether this tab is dirty
- * @since 2.1
- */
- protected boolean isDirty() {
- return fDirty;
- }
-
- /**
- * Sets the dirty state of the tab. Setting this flag allows clients to
- * explicitly say whether this tab has pending changes or not.
- *
- * It is up to clients to set/reset and consult this attribute as required.
- * By default, a tab is initialized to dirty for backwards compatibility.
- *
- * @param dirty what to set the dirty flag to
- * @since 2.1
- */
- protected void setDirty(boolean dirty) {
- fDirty = dirty;
- }
-
- /**
- * This method was added to the <code>ILaunchConfigurationTab</code> interface
- * in the 3.0 release to allow tabs to distinguish between a tab being activated
- * and a tab group be initialized for the first time, from a selected launch
- * configuration. To maintain backwards compatible behavior, the default
- * implementation provided, calls this tab's <code>initializeFrom</code> method.
- * Tabs should override this method as required.
- * <p>
- * The launch tab framework was originally designed to take care of inter tab
- * communication by applying attributes from the active tab to the launch configuration
- * being edited, when a tab is exited, and by initializing a tab when activated.
- * The addition of the methods <code>activated</code> and <code>deactivated</code>
- * allow tabs to determine the appropriate course of action.
- * </p>
- *
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- * @since 3.0
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- initializeFrom(workingCopy);
- }
-
- /**
- * This method was added to the <code>ILaunchConfigurationTab</code> interface
- * in the 3.0 release to allow tabs to distinguish between a tab being deactivated
- * and saving its attributes to a launch configuration. To maintain backwards
- * compatible behavior, the default implementation provided, calls this tab's
- * <code>performApply</code> method. Tabs should override this method as required.
- * <p>
- * The launch tab framework was originally designed to take care of inter tab
- * communication by applying attributes from the active tab to the launch configuration
- * being edited, when a tab is exited, and by initializing a tab when activated.
- * The addition of the methods <code>activated</code> and <code>deactivated</code>
- * allow tabs to determine the appropriate course of action.
- * </p>
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- * @since 3.0
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- performApply(workingCopy);
- }
-
- /**
- * Returns the job to update the launch configuration dialog.
- *
- * @return update job
- */
- private Job getUpdateJob() {
- if (fRereshJob == null) {
- fRereshJob = createUpdateJob();
- fRereshJob.setSystem(true);
- }
- return fRereshJob;
- }
-
- /**
- * Schedules the update job to run for this tab based on this tab's delay.
- *
- * @since 3.6
- */
- protected void scheduleUpdateJob() {
- Job job = getUpdateJob();
- job.cancel(); // cancel existing job
- job.schedule(getUpdateJobDelay());
- }
-
- /**
- * Creates and returns a job used to update the launch configuration dialog
- * for this tab. Subclasses may override.
- *
- * @return job to update the launch dialog for this tab
- * @since 3.6
- */
- protected Job createUpdateJob() {
- return new WorkbenchJob(getControl().getDisplay(), "Update LCD") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!getControl().isDisposed()) {
- updateLaunchConfigurationDialog();
- }
- return Status.OK_STATUS;
- }
- public boolean shouldRun() {
- return !getControl().isDisposed();
- }
- };
- }
-
- /**
- * Return the time delay that should be used when scheduling the
- * update job. Subclasses may override.
- *
- * @return a time delay in milliseconds before the job should run
- * @since 3.6
- */
- protected long getUpdateJobDelay() {
- return 200;
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
deleted file mode 100644
index defae2d5a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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 org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-/**
- * Common function for launch configuration tab groups.
- * Generally, a launch configuration tab group will subclass
- * this class, and define a method to create and set the tabs
- * in that group.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see ILaunchConfigurationTabGroup
- * @since 2.0
- */
-public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConfigurationTabGroup {
-
- /**
- * The tabs in this tab group, or <code>null</code> if not yet instantiated.
- */
- protected ILaunchConfigurationTab[] fTabs = null;
-
- /**
- * @see ILaunchConfigurationTabGroup#getTabs()
- */
- public ILaunchConfigurationTab[] getTabs() {
- return fTabs;
- }
-
- /**
- * Sets the tabs in this group
- *
- * @param tabs the tabs in this group
- */
- protected void setTabs(ILaunchConfigurationTab[] tabs) {
- fTabs = tabs;
- }
-
- /**
- * By default, dispose all the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#dispose()
- */
- public void dispose() {
- ILaunchConfigurationTab[] tabs = getTabs();
- if (tabs != null) {
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].dispose();
- }
- }
- }
-
- /**
- * By default, delegate to all of the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#setDefaults(ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setDefaults(configuration);
- }
- }
-
- /**
- * By default, delegate to all of the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#initializeFrom(ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].initializeFrom(configuration);
- }
- }
-
- /**
- * By default, delegate to all of the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#performApply(ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].performApply(configuration);
- }
- }
-
- /**
- * By default, delegate to all of the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#launched(ILaunch)
- * @deprecated
- */
- public void launched(ILaunch launch) {
- ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].launched(launch);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java
deleted file mode 100644
index 32e60a036..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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 org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * Default implementation for a breakpoint type category.
- * <p>
- * Clients providing breakpoint type category adapters may instantiate
- * and subclass this class.
- * </p>
- * @since 3.1
- */
-public class BreakpointTypeCategory extends PlatformObject implements IBreakpointTypeCategory, IWorkbenchAdapter {
-
- private String fName;
- private ImageDescriptor fImageDescriptor = DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_OBJS_BREAKPOINT_TYPE);
-
- /**
- * Constructs a type category for the given type name.
- *
- * @param name breakpoint type name
- */
- public BreakpointTypeCategory(String name) {
- fName = name;
- }
-
- /**
- * Constructs a type category for the given type name with the given
- * image.
- *
- * @param name breakpoint type name
- * @param descriptor image descriptor
- */
- public BreakpointTypeCategory(String name, ImageDescriptor descriptor) {
- fName = name;
- if (descriptor != null) {
- fImageDescriptor = descriptor;
- }
- }
-
- /**
- * Returns the name of this category's breakpoint type.
- *
- * @return the name of this category's breakpoint type
- */
- protected String getName() {
- return fName;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object object) {
- if (object instanceof BreakpointTypeCategory) {
- BreakpointTypeCategory type = (BreakpointTypeCategory) object;
- return type.getName().equals(getName());
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getName().hashCode();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return fImageDescriptor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- return getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
deleted file mode 100644
index e43740958..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
+++ /dev/null
@@ -1,935 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 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.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.ide.IDEEncoding;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Launch configuration tab used to specify the location a launch configuration
- * is stored in, whether it should appear in the favorites list, and perspective
- * switching behavior for an associated launch.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class CommonTab extends AbstractLaunchConfigurationTab {
-
- /**
- * Constant representing the id of the {@link IDialogSettings} location for the {@link ContainerSelectionDialog} used
- * on this tab
- *
- * @since 3.6
- */
- private final String SHARED_LAUNCH_CONFIGURATON_DIALOG = IDebugUIConstants.PLUGIN_ID + ".SHARED_LAUNCH_CONFIGURATON_DIALOG"; //$NON-NLS-1$
- private final String WORKSPACE_SELECTION_DIALOG = IDebugUIConstants.PLUGIN_ID + ".WORKSPACE_SELECTION_DIALOG"; //$NON-NLS-1$
-
- /**
- * This attribute exists solely for the purpose of making sure that invalid shared locations
- * can be revertible. This attribute is not saveable and will never appear in a saved
- * launch configuration.
- * @since 3.3
- */
- private static final String BAD_CONTAINER = "bad_container_name"; //$NON-NLS-1$
-
- // Local/shared UI widgets
- private Button fLocalRadioButton;
- private Button fSharedRadioButton;
- private Text fSharedLocationText;
- private Button fSharedLocationButton;
- private Button fLaunchInBackgroundButton;
- private Button fDefaultEncodingButton;
- private Button fAltEncodingButton;
- private Combo fEncodingCombo;
- private Button fConsoleOutput;
- private Button fFileOutput;
- private Button fFileBrowse;
- private Text fFileText;
- private Button fVariables;
- private Button fAppend;
- private Button fWorkspaceBrowse;
-
- /**
- * Check box list for specifying favorites
- */
- private CheckboxTableViewer fFavoritesTable;
-
- /**
- * Modify listener that simply updates the owning launch configuration dialog.
- */
- private ModifyListener fBasicModifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- setControl(comp);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB);
- comp.setLayout(new GridLayout(2, true));
- comp.setFont(parent.getFont());
-
- createSharedConfigComponent(comp);
- createFavoritesComponent(comp);
- createEncodingComponent(comp);
- createOutputCaptureComponent(comp);
- createLaunchInBackgroundComponent(comp);
- }
-
- /**
- * @return the {@link IDialogSettings} to pass into the {@link ContainerSelectionDialog}
- * @since 3.6
- */
- IDialogSettings getDialogBoundsSettings(String id) {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(id);
- if (section == null) {
- section = settings.addNewSection(id);
- }
- return section;
- }
-
- /**
- * Creates the favorites control
- * @param parent the parent composite to add this one to
- * @since 3.2
- */
- private void createFavoritesComponent(Composite parent) {
- Group favComp = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_Display_in_favorites_menu__10, 1, 1, GridData.FILL_BOTH);
- fFavoritesTable = CheckboxTableViewer.newCheckList(favComp, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
- Control table = fFavoritesTable.getControl();
- GridData gd = new GridData(GridData.FILL_BOTH);
- table.setLayoutData(gd);
- table.setFont(parent.getFont());
- fFavoritesTable.setContentProvider(new FavoritesContentProvider());
- fFavoritesTable.setLabelProvider(new FavoritesLabelProvider());
- fFavoritesTable.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateLaunchConfigurationDialog();
- }
- });
- }
-
- /**
- * Creates the shared config component
- * @param parent the parent composite to add this component to
- * @since 3.2
- */
- private void createSharedConfigComponent(Composite parent) {
- Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_0, 3, 2, GridData.FILL_HORIZONTAL);
- Composite comp = SWTFactory.createComposite(group, parent.getFont(), 3, 3, GridData.FILL_BOTH, 0, 0);
- fLocalRadioButton = createRadioButton(comp, LaunchConfigurationsMessages.CommonTab_L_ocal_3);
- GridData gd = new GridData();
- gd.horizontalSpan = 3;
- fLocalRadioButton.setLayoutData(gd);
- fSharedRadioButton = createRadioButton(comp, LaunchConfigurationsMessages.CommonTab_S_hared_4);
- fSharedRadioButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleSharedRadioButtonSelected();
- }
- });
- fSharedLocationText = SWTFactory.createSingleText(comp, 1);
- fSharedLocationText.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result = LaunchConfigurationsMessages.CommonTab_S_hared_4;
- }
- });
- fSharedLocationText.addModifyListener(fBasicModifyListener);
- fSharedLocationButton = createPushButton(comp, LaunchConfigurationsMessages.CommonTab__Browse_6, null);
- fSharedLocationButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleSharedLocationButtonSelected();
- }
- });
-
- fLocalRadioButton.setSelection(true);
- setSharedEnabled(false);
- }
-
- /**
- * Creates the component set for the capture output composite
- * @param parent the parent to add this component to
- */
- private void createOutputCaptureComponent(Composite parent) {
- Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_4, 5, 2, GridData.FILL_HORIZONTAL);
- Composite comp = SWTFactory.createComposite(group, 5, 5, GridData.FILL_BOTH);
- GridLayout ld = (GridLayout)comp.getLayout();
- ld.marginWidth = 1;
- ld.marginHeight = 1;
- fConsoleOutput = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_5);
- GridData gd = new GridData(SWT.BEGINNING, SWT.NORMAL, true, false);
- gd.horizontalSpan = 5;
- fConsoleOutput.setLayoutData(gd);
- fConsoleOutput.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
-
- fFileOutput = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_6);
- fFileOutput.setLayoutData(new GridData(SWT.BEGINNING, SWT.NORMAL, false, false));
- fFileOutput.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- enableOuputCaptureWidgets(fFileOutput.getSelection());
- updateLaunchConfigurationDialog();
- }
- });
- fFileText = SWTFactory.createSingleText(comp, 4);
- fFileText.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result = LaunchConfigurationsMessages.CommonTab_6;
- }
- });
- fFileText.addModifyListener(fBasicModifyListener);
-
- Composite bcomp = SWTFactory.createComposite(comp, 3, 5, GridData.HORIZONTAL_ALIGN_END);
- ld = (GridLayout)bcomp.getLayout();
- ld.marginHeight = 1;
- ld.marginWidth = 0;
- fWorkspaceBrowse = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_12, null);
- fWorkspaceBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- dialog.setTitle(LaunchConfigurationsMessages.CommonTab_13);
- dialog.setMessage(LaunchConfigurationsMessages.CommonTab_14);
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
- dialog.setDialogBoundsSettings(getDialogBoundsSettings(WORKSPACE_SELECTION_DIALOG), Dialog.DIALOG_PERSISTSIZE);
- if (dialog.open() == IDialogConstants.OK_ID) {
- IResource resource = (IResource) dialog.getFirstResult();
- if(resource != null) {
- String arg = resource.getFullPath().toString();
- String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
- fFileText.setText(fileLoc);
- }
- }
- }
- });
- fFileBrowse = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_7, null);
- fFileBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String filePath = fFileText.getText();
- FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
- filePath = dialog.open();
- if (filePath != null) {
- fFileText.setText(filePath);
- }
- }
- });
- fVariables = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_9, null);
- fVariables.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
- dialog.open();
- String variable = dialog.getVariableExpression();
- if (variable != null) {
- fFileText.insert(variable);
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- fAppend = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_11);
- gd = new GridData(SWT.LEFT, SWT.TOP, true, false);
- gd.horizontalSpan = 4;
- fAppend.setLayoutData(gd);
- fAppend.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
- }
-
- /**
- * Enables or disables the output capture widgets based on the the specified enablement
- * @param enable if the output capture widgets should be enabled or not
- * @since 3.2
- */
- private void enableOuputCaptureWidgets(boolean enable) {
- fFileText.setEnabled(enable);
- fFileBrowse.setEnabled(enable);
- fWorkspaceBrowse.setEnabled(enable);
- fVariables.setEnabled(enable);
- fAppend.setEnabled(enable);
- }
-
- /**
- * Returns the default encoding for the specified config
- * @param config
- * @return the default encoding
- *
- * @since 3.4
- */
- private String getDefaultEncoding(ILaunchConfiguration config) {
- try {
- IResource[] resources = config.getMappedResources();
- if(resources != null && resources.length > 0) {
- IResource res = resources[0];
- if(res instanceof IFile) {
- return ((IFile)res).getCharset();
- }
- else if(res instanceof IContainer) {
- return ((IContainer)res).getDefaultCharset();
- }
- }
- }
- catch(CoreException ce) {
- DebugUIPlugin.log(ce);
- }
- return ResourcesPlugin.getEncoding();
- }
-
- /**
- * Creates the encoding component
- * @param parent the parent to add this composite to
- */
- private void createEncodingComponent(Composite parent) {
- Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_1, 2, 1, GridData.FILL_BOTH);
-
- fDefaultEncodingButton = createRadioButton(group, IInternalDebugCoreConstants.EMPTY_STRING);
- GridData gd = new GridData(SWT.BEGINNING, SWT.NORMAL, true, false);
- gd.horizontalSpan = 2;
- fDefaultEncodingButton.setLayoutData(gd);
-
- fAltEncodingButton = createRadioButton(group, LaunchConfigurationsMessages.CommonTab_3);
- fAltEncodingButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- fEncodingCombo = new Combo(group, SWT.READ_ONLY);
- fEncodingCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fEncodingCombo.setFont(parent.getFont());
- List allEncodings = IDEEncoding.getIDEEncodings();
- String[] encodingArray = (String[]) allEncodings.toArray(new String[0]);
- fEncodingCombo.setItems(encodingArray);
- if (encodingArray.length > 0) {
- fEncodingCombo.select(0);
- }
- fEncodingCombo.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result = LaunchConfigurationsMessages.CommonTab_3;
- }
- });
- SelectionListener listener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if(e.getSource() instanceof Button) {
- Button button = (Button)e.getSource();
- if(button.getSelection()) {
- updateLaunchConfigurationDialog();
- fEncodingCombo.setEnabled(fAltEncodingButton.getSelection() == true);
- }
- }
- else {
- updateLaunchConfigurationDialog();
- }
- }
- };
- fAltEncodingButton.addSelectionListener(listener);
- fDefaultEncodingButton.addSelectionListener(listener);
- fEncodingCombo.addSelectionListener(listener);
- }
-
- /**
- * Creates the controls needed to edit the launch in background
- * attribute of an external tool
- *
- * @param parent the composite to create the controls in
- */
- protected void createLaunchInBackgroundComponent(Composite parent) {
- fLaunchInBackgroundButton = createCheckButton(parent, LaunchConfigurationsMessages.CommonTab_10);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- fLaunchInBackgroundButton.setLayoutData(data);
- fLaunchInBackgroundButton.setFont(parent.getFont());
- fLaunchInBackgroundButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
- }
-
- /**
- * handles the shared radio button being selected
- */
- private void handleSharedRadioButtonSelected() {
- setSharedEnabled(isShared());
- updateLaunchConfigurationDialog();
- }
-
- /**
- * Sets the widgets for specifying that a launch configuration is to be shared to the enable value
- * @param enable the enabled value for
- */
- private void setSharedEnabled(boolean enable) {
- fSharedLocationText.setEnabled(enable);
- fSharedLocationButton.setEnabled(enable);
- }
-
- private String getDefaultSharedConfigLocation(ILaunchConfiguration config) {
- String path = IInternalDebugCoreConstants.EMPTY_STRING;
- try {
- IResource[] res = config.getMappedResources();
- if(res != null) {
- IProject proj;
- for (int i = 0; i < res.length; i++) {
- proj = res[i].getProject();
- if(proj != null && proj.isAccessible()) {
- return proj.getFullPath().toOSString();
- }
- }
- }
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- return path;
- }
-
- /**
- * if the shared radio button is selected, indicating that the launch configuration is to be shared
- * @return true if the radio button is selected, false otherwise
- */
- private boolean isShared() {
- return fSharedRadioButton.getSelection();
- }
-
- /**
- * Handles the shared location button being selected
- */
- private void handleSharedLocationButtonSelected() {
- String currentContainerString = fSharedLocationText.getText();
- IContainer currentContainer = getContainer(currentContainerString);
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
- currentContainer,
- false,
- LaunchConfigurationsMessages.CommonTab_Select_a_location_for_the_launch_configuration_13);
- dialog.showClosedProjects(false);
- dialog.setDialogBoundsSettings(getDialogBoundsSettings(SHARED_LAUNCH_CONFIGURATON_DIALOG), Dialog.DIALOG_PERSISTSIZE);
- dialog.open();
- Object[] results = dialog.getResult();
- if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) {
- IPath path = (IPath)results[0];
- String containerName = path.toOSString();
- fSharedLocationText.setText(containerName);
- }
- }
-
- /**
- * gets the container form the specified path
- * @param path the path to get the container from
- * @return the container for the specified path or null if one cannot be determined
- */
- private IContainer getContainer(String path) {
- Path containerPath = new Path(path);
- return (IContainer) getWorkspaceRoot().findMember(containerPath);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- boolean isShared = !configuration.isLocal();
- fSharedRadioButton.setSelection(isShared);
- fLocalRadioButton.setSelection(!isShared);
- setSharedEnabled(isShared);
- fSharedLocationText.setText(getDefaultSharedConfigLocation(configuration));
- if(isShared) {
- String containerName = IInternalDebugCoreConstants.EMPTY_STRING;
- IFile file = configuration.getFile();
- if (file != null) {
- IContainer parent = file.getParent();
- if (parent != null) {
- containerName = parent.getFullPath().toOSString();
- }
- }
- fSharedLocationText.setText(containerName);
- }
- updateFavoritesFromConfig(configuration);
- updateLaunchInBackground(configuration);
- updateEncoding(configuration);
- updateConsoleOutput(configuration);
- }
-
- /**
- * Updates the console output form the local configuration
- * @param configuration the local configuration
- */
- private void updateConsoleOutput(ILaunchConfiguration configuration) {
- boolean outputToConsole = true;
- String outputFile = null;
- boolean append = false;
-
- try {
- outputToConsole = configuration.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, true);
- outputFile = configuration.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, (String)null);
- append = configuration.getAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, false);
- } catch (CoreException e) {
- }
-
- fConsoleOutput.setSelection(outputToConsole);
- fAppend.setSelection(append);
- boolean haveOutputFile= outputFile != null;
- if (haveOutputFile) {
- fFileText.setText(outputFile);
- }
- fFileOutput.setSelection(haveOutputFile);
- enableOuputCaptureWidgets(haveOutputFile);
- }
-
- /**
- * Updates the launch on background check button
- * @param configuration the local launch configuration
- */
- protected void updateLaunchInBackground(ILaunchConfiguration configuration) {
- fLaunchInBackgroundButton.setSelection(isLaunchInBackground(configuration));
- }
-
- /**
- * Updates the encoding
- * @param configuration the local configuration
- */
- private void updateEncoding(ILaunchConfiguration configuration) {
- String encoding = null;
- try {
- encoding = configuration.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, (String)null);
- } catch (CoreException e) {
- }
- String defaultEncoding = getDefaultEncoding(configuration);
- fDefaultEncodingButton.setText(MessageFormat.format(LaunchConfigurationsMessages.CommonTab_2, new String[]{defaultEncoding}));
- fDefaultEncodingButton.pack();
- if (encoding != null) {
- fAltEncodingButton.setSelection(true);
- fDefaultEncodingButton.setSelection(false);
- fEncodingCombo.setText(encoding);
- fEncodingCombo.setEnabled(true);
- } else {
- fDefaultEncodingButton.setSelection(true);
- fAltEncodingButton.setSelection(false);
- fEncodingCombo.setEnabled(false);
- }
- }
-
- /**
- * Returns whether the given configuration should be launched in the background.
- *
- * @param configuration the configuration
- * @return whether the configuration is configured to launch in the background
- */
- public static boolean isLaunchInBackground(ILaunchConfiguration configuration) {
- boolean launchInBackground= true;
- try {
- launchInBackground= configuration.getAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, true);
- } catch (CoreException ce) {
- DebugUIPlugin.log(ce);
- }
- return launchInBackground;
- }
-
- /**
- * Updates the favorites selections from the local configuration
- * @param config the local configuration
- */
- private void updateFavoritesFromConfig(ILaunchConfiguration config) {
- fFavoritesTable.setInput(config);
- fFavoritesTable.setCheckedElements(new Object[]{});
- try {
- List groups = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, new ArrayList());
- if (groups.isEmpty()) {
- // check old attributes for backwards compatible
- if (config.getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false)) {
- groups.add(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
- }
- if (config.getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false)) {
- groups.add(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
- }
- }
- if (!groups.isEmpty()) {
- List list = new ArrayList();
- Iterator iterator = groups.iterator();
- while (iterator.hasNext()) {
- String id = (String)iterator.next();
- LaunchGroupExtension extension = getLaunchConfigurationManager().getLaunchGroup(id);
- if (extension != null) {
- list.add(extension);
- }
- }
- fFavoritesTable.setCheckedElements(list.toArray());
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
-
- /**
- * Updates the configuration form the local shared config working copy
- * @param config the local shared config working copy
- */
- private void updateConfigFromLocalShared(ILaunchConfigurationWorkingCopy config) {
- if (isShared()) {
- String containerPathString = fSharedLocationText.getText();
- IContainer container = getContainer(containerPathString);
- if(container == null) {
- //we need to force an attribute to allow the invalid container path to be revertable
- config.setAttribute(BAD_CONTAINER, containerPathString);
- }
- else {
- config.setContainer(container);
- }
- } else {
- config.setContainer(null);
- }
- }
-
- /**
- * Convenience accessor
- */
- protected LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * Update the favorite settings.
- *
- * NOTE: set to <code>null</code> instead of <code>false</code> for backwards compatibility
- * when comparing if content is equal, since 'false' is default
- * and will be missing for older configurations.
- */
- private void updateConfigFromFavorites(ILaunchConfigurationWorkingCopy config) {
- try {
- Object[] checked = fFavoritesTable.getCheckedElements();
- boolean debug = config.getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false);
- boolean run = config.getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false);
- if (debug || run) {
- // old attributes
- List groups = new ArrayList();
- int num = 0;
- if (debug) {
- groups.add(getLaunchConfigurationManager().getLaunchGroup(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP));
- num++;
- }
- if (run) {
- num++;
- groups.add(getLaunchConfigurationManager().getLaunchGroup(IDebugUIConstants.ID_RUN_LAUNCH_GROUP));
- }
- // see if there are any changes
- if (num == checked.length) {
- boolean different = false;
- for (int i = 0; i < checked.length; i++) {
- if (!groups.contains(checked[i])) {
- different = true;
- break;
- }
- }
- if (!different) {
- return;
- }
- }
- }
- config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
- config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, (String)null);
- List groups = null;
- for (int i = 0; i < checked.length; i++) {
- LaunchGroupExtension group = (LaunchGroupExtension)checked[i];
- if (groups == null) {
- groups = new ArrayList();
- }
- groups.add(group.getIdentifier());
- }
- config.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, groups);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
-
- /**
- * Convenience method for getting the workspace root.
- */
- private IWorkspaceRoot getWorkspaceRoot() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration config) {
- setMessage(null);
- setErrorMessage(null);
-
- return validateLocalShared() && validateRedirectFile() && validateEncoding();
- }
-
- /**
- * validates the encoding selection
- * @return true if the validate encoding is allowable, false otherwise
- */
- private boolean validateEncoding() {
- if (fAltEncodingButton.getSelection()) {
- if (fEncodingCombo.getSelectionIndex() == -1) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_No_Encoding_Selected);
- return false;
- }
- }
- return true;
- }
-
- /**
- * Validates if the redirect file is valid
- * @return true if the filename is not zero, false otherwise
- */
- private boolean validateRedirectFile() {
- if(fFileOutput.getSelection()) {
- int len = fFileText.getText().trim().length();
- if (len == 0) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_8);
- return false;
- }
- }
- return true;
- }
-
- /**
- * validates the local shared config file location
- * @return true if the local shared file exists, false otherwise
- */
- private boolean validateLocalShared() {
- if (isShared()) {
- String path = fSharedLocationText.getText().trim();
- IContainer container = getContainer(path);
- if (container == null || container.equals(ResourcesPlugin.getWorkspace().getRoot())) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_Invalid_shared_configuration_location_14);
- return false;
- } else if (!container.getProject().isOpen()) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_Cannot_save_launch_configuration_in_a_closed_project__1);
- return false;
- }
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setContainer(null);
- setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, config, true, true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- updateConfigFromLocalShared(configuration);
- updateConfigFromFavorites(configuration);
- setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, configuration, fLaunchInBackgroundButton.getSelection(), true);
- String encoding = null;
- if(fAltEncodingButton.getSelection()) {
- encoding = fEncodingCombo.getText();
- }
- configuration.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, encoding);
- boolean captureOutput = false;
- if (fConsoleOutput.getSelection()) {
- captureOutput = true;
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, (String)null);
- } else {
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, false);
- }
- if (fFileOutput.getSelection()) {
- captureOutput = true;
- String file = fFileText.getText();
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, file);
- if(fAppend.getSelection()) {
- configuration.setAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, true);
- } else {
- configuration.setAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, (String)null);
- }
- } else {
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, (String)null);
- }
-
- if (!captureOutput) {
- configuration.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, false);
- } else {
- configuration.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, (String)null);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return LaunchConfigurationsMessages.CommonTab__Common_15;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
- *
- * @since 3.3
- */
- public String getId() {
- return "org.eclipse.debug.ui.commonTab"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#canSave()
- */
- public boolean canSave() {
- return validateLocalShared();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return DebugUITools.getImage(IInternalDebugUIConstants.IMG_OBJS_COMMON_TAB);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {}
-
- /**
- * Content provider for the favorites table
- */
- class FavoritesContentProvider implements IStructuredContentProvider {
-
- public Object[] getElements(Object inputElement) {
- ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
- List possibleGroups = new ArrayList();
- ILaunchConfiguration configuration = (ILaunchConfiguration)inputElement;
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup extension = groups[i];
- LaunchHistory history = getLaunchConfigurationManager().getLaunchHistory(extension.getIdentifier());
- if (history != null && history.accepts(configuration)) {
- possibleGroups.add(extension);
- }
- }
- return possibleGroups.toArray();
- }
-
- public void dispose() {}
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
- }
-
- /**
- * Provides the labels for the favorites table
- *
- */
- class FavoritesLabelProvider implements ITableLabelProvider {
-
- private Map fImages = new HashMap();
-
- public Image getColumnImage(Object element, int columnIndex) {
- Image image = (Image)fImages.get(element);
- if (image == null) {
- ImageDescriptor descriptor = ((LaunchGroupExtension)element).getImageDescriptor();
- if (descriptor != null) {
- image = descriptor.createImage();
- fImages.put(element, image);
- }
- }
- return image;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- String label = ((LaunchGroupExtension)element).getLabel();
- return DebugUIPlugin.removeAccelerators(label);
- }
-
- public void addListener(ILabelProviderListener listener) {}
-
- public void dispose() {
- Iterator images = fImages.values().iterator();
- while (images.hasNext()) {
- Image image = (Image)images.next();
- image.dispose();
- }
- }
-
- public boolean isLabelProperty(Object element, String property) {return false;}
-
- public void removeListener(ILabelProviderListener listener) {}
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java
deleted file mode 100644
index fed8d2b4c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 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 org.eclipse.debug.internal.ui.views.launch.DebugElementHelper;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.model.IWorkbenchAdapter2;
-
-/**
- * Common function for debug element workbench adapters.
- * <p>
- * Clients may subclass this class to provide custom adapters for elements in a debug
- * model. The debug platform provides <code>IWorkbenchAdapters</code> for the standard debug
- * elements. Clients may override the default content in the debug view by providing an
- * <code>IWorkbenchAdapter</code> or <code>IDeferredWorkbenchAdapter</code> for a debug
- * element.
- * </p>
- * @since 3.1
- * @deprecated Custom content in the debug views is no longer supported by
- * {@link IWorkbenchAdapter}. Custom content is currently supported
- * by a provisional internal viewer framework.
- */
-public abstract class DebugElementWorkbenchAdapter implements IWorkbenchAdapter, IWorkbenchAdapter2 {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return DebugElementHelper.getImageDescriptor(object);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- return DebugElementHelper.getLabel(o);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getForeground(java.lang.Object)
- */
- public RGB getForeground(Object element) {
- return DebugElementHelper.getForeground(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getBackground(java.lang.Object)
- */
- public RGB getBackground(Object element) {
- return DebugElementHelper.getBackground(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getFont(java.lang.Object)
- */
- public FontData getFont(Object element) {
- return DebugElementHelper.getFont(element);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
deleted file mode 100644
index 124bd972f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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 com.ibm.icu.text.MessageFormat;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.PopupDialog;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.IHandlerActivation;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.keys.IBindingService;
-
-/**
- * A <code>PopupDialog</code> that is automatically positioned relative
- * to a specified anchor point. The popup can be dismissed in the same
- * manor as all popup dialogs, but additionally allows clients the option
- * of specifying a command id that can be used to persist the contents of
- * the dialog.
- * <p>
- * Clients may subclass this.
- * @since 3.2
- */
-public abstract class DebugPopup extends PopupDialog {
-
- private Point fAnchor;
-
- private IHandlerActivation fActivation;
-
- private IHandlerService fHandlerService;
-
- private String fCommandId;
-
- private boolean fPersisted = false;
-
- /**
- * Constructs a new popup dialog of type <code>PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE</code>
- * @param parent The parent shell
- * @param anchor point at which to anchor the popup dialog in Display coordinate space.
- * Since 3.3, <code>null</code> can be specified to use a default anchor point
- * @param commandId The command id to be used for persistence of
- * the dialog, or <code>null</code>
- */
- public DebugPopup(Shell parent, Point anchor, String commandId) {
- super(parent, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, true, false, true, true, false, null, null);
- fAnchor = anchor;
- fCommandId = commandId;
- }
-
- /**
- * Returns the text to be shown in the popups's information area.
- * May return <code>null</code>.
- * <p>
- * By default, if this dialog has a persistence command associated with it,
- * the text displayed is of the form "Press {key-sequence} to {action}". The
- * action text is specified by the method <code>getActionText()</code>.
- * </p>
- * @return The text to be shown in the popup's information area or <code>null</code>
- */
- protected String getInfoText() {
- if (getCommandId() != null && getActionText() != null) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IBindingService bindingService = (IBindingService) workbench.getAdapter(IBindingService.class);
- String formattedBinding = bindingService.getBestActiveBindingFormattedFor(getCommandId());
-
- String infoText = null;
- if (formattedBinding != null) {
- infoText = MessageFormat.format(DebugUIViewsMessages.InspectPopupDialog_1, new String[] { formattedBinding, getActionText()});
- }
- return infoText;
- }
- return null;
- }
-
- /**
- * Returns the text to be shown as the action performed when this dialog's
- * persist command is invoked, or <code>null</code>.
- * <p>
- * Subclasses should override as necessary.
- * </p>
- * @return the text to be shown as the action performed when this dialog's
- * persist command is invoked
- */
- protected String getActionText() {
- return null;
- }
-
- /**
- * Returns the command id to be used for persisting the contents of the
- * dialog. If the contents should not be persisted, this method should
- * return null.
- *
- * @return The command id to be used for persisting the contents of the
- * dialog or <code>null</code>
- */
- protected String getCommandId() {
- return fCommandId;
- }
-
- /**
- * Persists the contents of the dialog. Subclasses should override as required,
- * but also call super.persist().
- */
- protected void persist() {
- fPersisted = true;
- }
-
- /**
- * Returns whether the command handler was invoked to persist this popup's result.
- *
- * @return whether the command handler was invoked to persist this popup's result
- */
- protected boolean wasPersisted() {
- return fPersisted;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected abstract Control createDialogArea(Composite parent);
-
-
- /**
- * Returns the initial location to use for the shell based upon the
- * current selection in the viewer. Bottom is preferred to top, and
- * right is preferred to left, therefore if possible the popup will
- * be located below and to the right of the selection.
- *
- * @param initialSize
- * the initial size of the shell, as returned by
- * <code>getInitialSize</code>.
- * @return the initial location of the shell
- */
- protected Point getInitialLocation(Point initialSize) {
- if (fAnchor == null) {
- return super.getInitialLocation(initialSize);
- }
- Point point = fAnchor;
- Rectangle monitor = getShell().getMonitor().getClientArea();
- if (monitor.width < point.x + initialSize.x) {
- point.x = Math.max(0, point.x - initialSize.x);
- }
- if (monitor.height < point.y + initialSize.y) {
- point.y = Math.max(0, point.y - initialSize.y);
- }
- return point;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#getDialogSettings()
- */
- protected IDialogSettings getDialogSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- return settings;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#open()
- */
- public int open() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- String commandId = getCommandId();
- if (commandId != null) {
- IHandler fCloseHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event) throws ExecutionException {
- persist();
- close();
- return null;
- }
- };
-
- fHandlerService = (IHandlerService) workbench.getAdapter(IHandlerService.class);
- fActivation = fHandlerService.activateHandler(commandId, fCloseHandler);
- }
-
- String infoText = getInfoText();
- if (infoText != null)
- setInfoText(infoText);
-
- return super.open();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#close()
- */
- public boolean close() {
- if (fActivation != null)
- fHandlerService.deactivateHandler(fActivation);
-
- return super.close();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
deleted file mode 100644
index e7cac3bb7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
+++ /dev/null
@@ -1,895 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchDelegate;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DefaultLabelProvider;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
-import org.eclipse.debug.internal.ui.memory.MemoryRenderingManager;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIUtils;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.contexts.IDebugContextManager;
-import org.eclipse.debug.ui.memory.IMemoryRenderingManager;
-import org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser;
-import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * This class provides utilities for clients of the debug UI.
- * <p>
- * Images retrieved from this facility should not be disposed.
- * The images will be disposed when this plug-in is shutdown.
- * </p>
- * @noinstantiate This class is not intended to be instantiated by clients.
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class DebugUITools {
-
- /**
- * Returns the shared image managed under the given key, or <code>null</code>
- * if none.
- * <p>
- * Note that clients <b>MUST NOT</b> dispose the image returned by this method.
- * </p>
- * <p>
- * See <code>IDebugUIConstants</code> for available images.
- * </p>
- *
- * @param key the image key
- * @return the image, or <code>null</code> if none
- * @see IDebugUIConstants
- */
- public static Image getImage(String key) {
- return DebugPluginImages.getImage(key);
- }
-
- /**
- * Returns the shared image descriptor managed under the given key, or
- * <code>null</code> if none.
- * <p>
- * See <code>IDebugUIConstants</code> for available image descriptors.
- * </p>
- *
- * @param key the image descriptor key
- * @return the image descriptor, or <code>null</code> if none
- * @see IDebugUIConstants
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- return DebugPluginImages.getImageDescriptor(key);
- }
-
- /**
- * Returns the default image descriptor for the given element
- * or <code>null</code> if none is defined.
- */
- public static ImageDescriptor getDefaultImageDescriptor(Object element) {
- String imageKey= getDefaultImageKey(element);
- if (imageKey == null) {
- return null;
- }
- return DebugPluginImages.getImageDescriptor(imageKey);
- }
-
- private static String getDefaultImageKey(Object element) {
- return ((DefaultLabelProvider)DebugUIPlugin.getDefaultLabelProvider()).getImageKey(element);
- }
-
- /**
- * Returns the preference store for the debug UI plug-in.
- *
- * @return preference store
- */
- public static IPreferenceStore getPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * Returns a new debug model presentation that delegates to
- * appropriate debug models.
- * <p>
- * It is the client's responsibility dispose the presentation.
- * </p>
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- * @return a debug model presentation
- * @since 2.0
- */
- public static IDebugModelPresentation newDebugModelPresentation() {
- return new DelegatingModelPresentation();
- }
-
- /**
- * Returns a new debug model presentation for specified
- * debug model, or <code>null</code> if a presentation does
- * not exist.
- * <p>
- * It is the client's responsibility dispose the presentation.
- * </p>
- *
- * @param identifier debug model identifier
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- * @return a debug model presentation, or <code>null</code>
- * @since 2.0
- */
- public static IDebugModelPresentation newDebugModelPresentation(String identifier) {
- IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.ID_DEBUG_MODEL_PRESENTATION);
- if (point != null) {
- IExtension[] extensions= point.getExtensions();
- for (int i= 0; i < extensions.length; i++) {
- IExtension extension= extensions[i];
- IConfigurationElement[] configElements= extension.getConfigurationElements();
- for (int j= 0; j < configElements.length; j++) {
- IConfigurationElement elt= configElements[j];
- String id= elt.getAttribute("id"); //$NON-NLS-1$
- if (id != null && id.equals(identifier)) {
- return new LazyModelPresentation(elt);
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the currently selected element in the
- * debug view of the current workbench page,
- * or <code>null</code> if there is no current
- * debug context.
- * <p>
- * This method used to return <code>null</code> when called from a non-UI thread,
- * but since 3.1, this methods also works when called from a non-UI thread.
- * </p>
- * @return the currently selected debug context, or <code>null</code>
- * @since 2.0
- */
- public static IAdaptable getDebugContext() {
- IWorkbenchWindow activeWindow = SelectedResourceManager.getDefault().getActiveWindow();
- if (activeWindow != null) {
- ISelection activeContext = DebugUITools.getDebugContextManager().getContextService(activeWindow).getActiveContext();
- if (activeContext instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) activeContext;
- if (!selection.isEmpty()) {
- Object firstElement = selection.getFirstElement();
- if (firstElement instanceof IAdaptable) {
- return (IAdaptable) firstElement;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the currently selected resource in the active workbench window,
- * or <code>null</code> if none. If an editor is active, the resource adapter
- * associated with the editor is returned, if any.
- *
- * @return selected resource or <code>null</code>
- * @since 3.0
- */
- public static IResource getSelectedResource() {
- return SelectedResourceManager.getDefault().getSelectedResource();
- }
-
- /**
- * Returns the process associated with the current debug context.
- * If there is no debug context currently, the most recently
- * launched process is returned. If there is no current process
- * <code>null</code> is returned.
- *
- * @return the current process, or <code>null</code>
- * @since 2.0
- */
- public static IProcess getCurrentProcess() {
- IAdaptable context = getDebugContext();
- if (context == null) {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- if (launches.length > 0) {
- context = launches[launches.length - 1];
- }
- }
-
- if (context instanceof IDebugElement) {
- return ((IDebugElement)context).getDebugTarget().getProcess();
- }
-
- if (context instanceof IProcess) {
- return (IProcess)context;
- }
-
- if (context instanceof ILaunch) {
- ILaunch launch= (ILaunch)context;
- IDebugTarget target= launch.getDebugTarget();
- if (target != null) {
- IProcess process = target.getProcess();
- if (process != null) {
- return process;
- }
- }
- IProcess[] ps = launch.getProcesses();
- if (ps.length > 0) {
- return ps[ps.length - 1];
- }
- }
-
- if (context != null) {
- return (IProcess) context.getAdapter(IProcess.class);
- }
-
- return null;
- }
-
- /**
- * Open the launch configuration dialog with the specified initial selection.
- * The selection may be <code>null</code>, or contain any mix of
- * <code>ILaunchConfiguration</code> or <code>ILaunchConfigurationType</code>
- * elements.
- * <p>
- * Before opening a new dialog, this method checks if there is an existing open
- * launch configuration dialog. If there is, this dialog is used with the
- * specified selection. If there is no existing dialog, a new one is created.
- * </p>
- * <p>
- * Note that if an existing dialog is reused, the <code>mode</code> argument is ignored
- * and the existing dialog keeps its original mode.
- * </p>
- *
- * @param shell the parent shell for the launch configuration dialog
- * @param selection the initial selection for the dialog
- * @param mode the mode (run or debug) in which to open the launch configuration dialog.
- * This should be one of the constants defined in <code>ILaunchManager</code>.
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 2.0
- * @deprecated use openLaunchConfigurationDialogOnGroup(Shell, IStructuredSelection, String)
- * to specify the launch group that the dialog should be opened on. This method will open
- * on the launch group with the specified mode and a <code>null</code> category
- */
- public static int openLaunchConfigurationDialog(Shell shell, IStructuredSelection selection, String mode) {
- ILaunchGroup[] groups = getLaunchGroups();
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup group = groups[i];
- if (group.getMode().equals(mode) && group.getCategory() == null) {
- return openLaunchConfigurationDialogOnGroup(shell, selection, group.getIdentifier());
- }
- }
- return Window.CANCEL;
- }
-
- /**
- * Open the launch configuration dialog with the specified initial selection.
- * The selection may be <code>null</code>, or contain any mix of
- * <code>ILaunchConfiguration</code> or <code>ILaunchConfigurationType</code>
- * elements.
- * <p>
- * Before opening a new dialog, this method checks if there is an existing open
- * launch configuration dialog. If there is, this dialog is used with the
- * specified selection. If there is no existing dialog, a new one is created.
- * </p>
- * <p>
- * Note that if an existing dialog is reused, the <code>mode</code> argument is ignored
- * and the existing dialog keeps its original mode.
- * </p>
- *
- * @param shell the parent shell for the launch configuration dialog
- * @param selection the initial selection for the dialog
- * @param groupIdentifier the identifier of the launch group to display (corresponds to
- * the identifier of a launch group extension)
- * @return The return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 2.1
- */
- public static int openLaunchConfigurationDialogOnGroup(Shell shell, IStructuredSelection selection, String groupIdentifier) {
- return openLaunchConfigurationDialogOnGroup(shell, selection, groupIdentifier, null);
- }
-
- /**
- * Open the launch configuration dialog with the specified initial selection.
- * The selection may be <code>null</code>, or contain any mix of
- * <code>ILaunchConfiguration</code> or <code>ILaunchConfigurationType</code>
- * elements.
- * <p>
- * Before opening a new dialog, this method checks if there is an existing open
- * launch configuration dialog. If there is, this dialog is used with the
- * specified selection. If there is no existing dialog, a new one is created.
- * </p>
- * <p>
- * Note that if an existing dialog is reused, the <code>mode</code> argument is ignored
- * and the existing dialog keeps its original mode.
- * </p>
- * <p>
- * If a status is specified, a status handler is consulted to handle the
- * status. The status handler is passed the instance of the launch
- * configuration dialog that is opened. This gives the status handler an
- * opportunity to perform error handling/initialization as required.
- * </p>
- * @param shell the parent shell for the launch configuration dialog
- * @param selection the initial selection for the dialog
- * @param groupIdentifier the identifier of the launch group to display (corresponds to
- * the identifier of a launch group extension)
- * @param status the status to display in the dialog, or <code>null</code>
- * if none
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see org.eclipse.debug.core.IStatusHandler
- * @see ILaunchGroup
- * @since 2.1
- */
- public static int openLaunchConfigurationDialogOnGroup(final Shell shell, final IStructuredSelection selection, final String groupIdentifier, final IStatus status) {
- final int[] result = new int[1];
- Runnable r = new Runnable() {
- /**
- * @see java.lang.Runnable#run()
- */
- public void run() {
- LaunchConfigurationsDialog dialog = (LaunchConfigurationsDialog) LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
- if (dialog != null) {
- dialog.setInitialSelection(selection);
- dialog.doInitialTreeSelection();
- if (status != null) {
- dialog.handleStatus(status);
- }
- result[0] = Window.OK;
- } else {
- LaunchGroupExtension ext = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier);
- if(ext != null) {
- dialog = new LaunchConfigurationsDialog(shell, ext);
- dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
- dialog.setInitialSelection(selection);
- dialog.setInitialStatus(status);
- result[0] = dialog.open();
- }
- else {
- result[0] = Window.CANCEL;
- }
- }
- }
- };
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), r);
- return result[0];
- }
-
- /**
- * Open the launch configuration properties dialog on the specified launch
- * configuration.
- *
- * @param shell the parent shell for the launch configuration dialog
- * @param configuration the configuration to display
- * @param groupIdentifier group identifier of the launch group the launch configuration
- * belongs to
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 2.1
- */
- public static int openLaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier) {
- return openLaunchConfigurationPropertiesDialog(shell, configuration, groupIdentifier, null);
- }
-
- /**
- * Open the launch configuration properties dialog on the specified launch
- * configuration.
- *
- * @param shell the parent shell for the launch configuration dialog
- * @param configuration the configuration to display
- * @param groupIdentifier group identifier of the launch group the launch configuration
- * belongs to
- * @param status the status to display, or <code>null</code> if none
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 3.0
- */
- public static int openLaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, IStatus status) {
- LaunchGroupExtension group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier);
- if (group != null) {
- LaunchConfigurationPropertiesDialog dialog = new LaunchConfigurationPropertiesDialog(shell, configuration, group);
- dialog.setInitialStatus(status);
- return dialog.open();
- }
-
- return Window.CANCEL;
- }
-
- /**
- * Open the launch configuration dialog on the specified launch
- * configuration. The dialog displays the tabs for a single configuration
- * only (a tree of launch configuration is not displayed), and provides a
- * launch (run or debug) button.
- * <p>
- * If a status is specified, a status handler is consulted to handle the
- * status. The status handler is passed the instance of the launch
- * configuration dialog that is opened. This gives the status handler an
- * opportunity to perform error handling/initialization as required.
- * </p>
- * @param shell the parent shell for the launch configuration dialog
- * @param configuration the configuration to display
- * @param groupIdentifier group identifier of the launch group the launch configuration
- * belongs to
- * @param status the status to display, or <code>null</code> if none
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 2.1
- */
- public static int openLaunchConfigurationDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, IStatus status) {
- LaunchGroupExtension group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier);
- if (group != null) {
- LaunchConfigurationDialog dialog = new LaunchConfigurationDialog(shell, configuration, group);
- dialog.setInitialStatus(status);
- return dialog.open();
- }
-
- return Window.CANCEL;
- }
-
- /**
- * Saves all dirty editors and builds the workspace according to current
- * preference settings, and returns whether a launch should proceed.
- * <p>
- * The following preferences effect whether dirty editors are saved,
- * and/or if the user is prompted to save dirty editors:<ul>
- * <li>PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_AUTOSAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * </ul>
- * The following preference effects whether a build is performed before
- * launching (if required):<ul>
- * <li>PREF_BUILD_BEFORE_LAUNCH</li>
- * </ul>
- * </p>
- *
- * @return whether a launch should proceed
- * @since 2.0
- * @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
- * of resources that are only involved in the current launch, no longer the entire workspace
- */
- public static boolean saveAndBuildBeforeLaunch() {
- return DebugUIPlugin.saveAndBuild();
- }
-
- /**
- * Saves all dirty editors according to current
- * preference settings, and returns whether a launch should proceed.
- * <p>
- * The following preferences effect whether dirty editors are saved,
- * and/or if the user is prompted to save dirty editors:<ul>
- * <li>PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_AUTOSAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * </ul>
- * </p>
- *
- * @return whether a launch should proceed
- * @since 2.1
- * @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
- * of resources that are only involved in the current launch, no longer the entire workspace
- */
- public static boolean saveBeforeLaunch() {
- return DebugUIPlugin.preLaunchSave();
- }
-
- /**
- * Saves and builds the workspace according to current preference settings, and
- * launches the given launch configuration in the specified mode.
- * <p>
- * This method must be called in the UI thread.
- * </p>
- * @param configuration the configuration to launch
- * @param mode launch mode - run or debug
- * @since 2.1
- */
- public static void launch(final ILaunchConfiguration configuration, final String mode) {
- boolean launchInBackground= true;
- try {
- launchInBackground= configuration.getAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, true);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- if (launchInBackground) {
- DebugUIPlugin.launchInBackground(configuration, mode);
- } else {
- DebugUIPlugin.launchInForeground(configuration, mode);
- }
- }
-
-
-
- /**
- * Builds the workspace according to current preference settings, and launches
- * the given configuration in the specified mode, returning the resulting launch
- * object.
- * <p>
- * The following preference effects whether a build is performed before
- * launching (if required):<ul>
- * <li>PREF_BUILD_BEFORE_LAUNCH</li>
- * </ul>
- * </p>
- *
- * @param configuration the configuration to launch
- * @param mode the mode to launch in
- * @param monitor progress monitor
- * @return the resulting launch object
- * @throws CoreException if building or launching fails
- * @since 2.1
- */
- public static ILaunch buildAndLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
- return DebugUIPlugin.buildAndLaunch(configuration, mode, monitor);
- }
-
- /**
- * Returns the perspective to switch to when a configuration of the given type
- * is launched in the given mode, or <code>null</code> if no switch should take
- * place.
- *
- * In 3.3 this method is equivalent to calling <code>getLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate)</code>,
- * with the 'mode' parameter comprising a single element set and passing <code>null</code> as the launch delegate.
- *
- * @param type launch configuration type
- * @param mode launch mode identifier
- * @return perspective identifier or <code>null</code>
- * @since 3.0
- */
- public static String getLaunchPerspective(ILaunchConfigurationType type, String mode) {
- return DebugUIPlugin.getDefault().getPerspectiveManager().getLaunchPerspective(type, mode);
- }
-
- /**
- * Returns the perspective id to switch to when a configuration of the given type launched with the specified delegate
- * is launched in the given mode set, or <code>null</code> if no switch should occurr.
- * @param type the configuration type
- * @param delegate the launch delegate
- * @param modes the set of modes
- * @return the perspective id or <code>null</code> if no switch should occur
- *
- * @since 3.3
- */
- public static String getLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes) {
- return DebugUIPlugin.getDefault().getPerspectiveManager().getLaunchPerspective(type, modes, delegate);
- }
-
- /**
- * Sets the perspective to switch to when a configuration of the given type
- * is launched in the given mode. <code>PERSPECTIVE_NONE</code> indicates no
- * perspective switch should take place. <code>PERSPECTIVE_DEFAULT</code> indicates
- * a default perspective switch should take place, as defined by the associated
- * launch tab group extension.
- *
- * In 3.3 this method is equivalent to calling <code>setLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate, String perspectiveid)</code>,
- * with the parameter 'mode' used in the set modes, and null passed as the delegate
- *
- * @param type launch configuration type
- * @param mode launch mode identifier
- * @param perspective identifier, <code>PERSPECTIVE_NONE</code>, or
- * <code>PERSPECTIVE_DEFAULT</code>
- * @since 3.0
- */
- public static void setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective) {
- DebugUIPlugin.getDefault().getPerspectiveManager().setLaunchPerspective(type, mode, perspective);
- }
-
- /**
- * Sets the perspective to switch to when a configuration of the specified type and launched using the
- * specified launch delegate is launched in the specified modeset. <code>PERSPECTIVE_NONE</code> indicates no
- * perspective switch should take place.
- *
- * Passing <code>null</code> for the launch delegate is quivalent to using the default perspective for the specified
- * type.
- * @param type the configuration type
- * @param delegate the launch delegate
- * @param modes the set of modes
- * @param perspectiveid identifier or <code>PERSPECTIVE_NONE</code>
- *
- * @since 3.3
- */
- public static void setLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes, String perspectiveid) {
- DebugUIPlugin.getDefault().getPerspectiveManager().setLaunchPerspective(type, modes, delegate, perspectiveid);
- }
-
- /**
- * Returns whether the given launch configuration is private. Generally,
- * private launch configurations should not be displayed to the user. The
- * private status of a launch configuration is determined by the
- * <code>IDebugUIConstants.ATTR_PRIVATE</code> attribute.
- *
- * @param configuration launch configuration
- * @return whether the given launch configuration is private
- * @since 3.0
- */
- public static boolean isPrivate(ILaunchConfiguration configuration) {
- return !LaunchConfigurationManager.isVisible(configuration);
- }
-
- /**
- * Sets whether step filters should be applied to step commands. This
- * setting is a global option applied to all registered debug targets.
- * <p>
- * Since 3.3, this is equivalent to calling <code>DebugPlugin.setUseStepFilters(boolean)</code>.
- * </p>
- * @param useStepFilters whether step filters should be applied to step
- * commands
- * @since 3.0
- * @see org.eclipse.debug.core.model.IStepFilters
- */
- public static void setUseStepFilters(boolean useStepFilters) {
- DebugPlugin.setUseStepFilters(useStepFilters);
- }
-
- /**
- * Returns whether step filters are applied to step commands.
- * <p>
- * Since 3.3, this is equivalent to calling <code>DebugPlugin.isUseStepFilters()</code>.
- * </p>
- * @return whether step filters are applied to step commands
- * @since 3.0
- * @see org.eclipse.debug.core.model.IStepFilters
- */
- public static boolean isUseStepFilters() {
- return DebugPlugin.isUseStepFilters();
- }
-
- /**
- * Returns the console associated with the given process, or
- * <code>null</code> if none.
- *
- * @param process a process
- * @return console associated with the given process, or
- * <code>null</code> if none
- * @since 3.0
- */
- public static IConsole getConsole(IProcess process) {
- return DebugUIPlugin.getDefault().getProcessConsoleManager().getConsole(process);
- }
-
- /**
- * Returns the console associated with the given debug element, or
- * <code>null</code> if none.
- *
- * @param element a debug model element
- * @return console associated with the given element, or
- * <code>null</code> if none
- * @since 3.0
- */
- public static IConsole getConsole(IDebugElement element) {
- IProcess process = element.getDebugTarget().getProcess();
- if (process != null) {
- return getConsole(process);
- }
- return null;
- }
-
- /**
- * Returns all registered launch group extensions.
- *
- * @return all registered launch group extensions
- * @since 3.0
- */
- public static ILaunchGroup[] getLaunchGroups() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroups();
- }
-
- /**
- * Returns the last configuration that was launched for specified launch group or
- * <code>null</code>, if there is not one. This method does not provide any form of
- * filtering on the returned launch configurations.
- *
- * @param groupId the unique identifier of a launch group
- * @return the last launched configuration for the specified group or <code>null</code>.
- * @see DebugUITools#getLaunchGroups()
- * @since 3.3
- */
- public static ILaunchConfiguration getLastLaunch(String groupId) {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLastLaunch(groupId);
- }
-
- /**
- * Returns the launch group that the given launch configuration belongs
- * to, for the specified mode, or <code>null</code> if none.
- *
- * @param configuration
- * @param mode
- * @return the launch group the given launch configuration belongs to, for
- * the specified mode, or <code>null</code> if none
- * @since 3.0
- */
- public static ILaunchGroup getLaunchGroup(ILaunchConfiguration configuration, String mode) {
- try {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configuration.getType(), mode);
- }
- catch(CoreException ce) {
- return null;
- }
- }
-
- /**
- * Performs source lookup on the given artifact and returns the result.
- * Optionally, a source locator may be specified.
- *
- * @param artifact object for which source is to be resolved
- * @param locator the source locator to use, or <code>null</code>. When <code>null</code>
- * a source locator is determined from the artifact, if possible. If the artifact
- * is a debug element, the source locator from its associated launch is used.
- * @return a source lookup result
- * @since 3.1
- */
- public static ISourceLookupResult lookupSource(Object artifact, ISourceLocator locator) {
- return SourceLookupFacility.getDefault().lookup(artifact, locator);
- }
-
- /**
- * Displays the given source lookup result in an editor in the given workbench
- * page. Has no effect if the result has an unknown editor id or editor input.
- * The editor is opened, positioned, and annotated.
- * <p>
- * Honors user preference for editors re-use.
- * </p>
- * @param result source lookup result to display
- * @param page the page to display the result in
- * @since 3.1
- */
- public static void displaySource(ISourceLookupResult result, IWorkbenchPage page) {
- SourceLookupFacility.getDefault().display(result, page);
- }
-
- /**
- * Returns the memory rendering manager.
- *
- * @return the memory rendering manager
- * @since 3.1
- */
- public static IMemoryRenderingManager getMemoryRenderingManager() {
- return MemoryRenderingManager.getDefault();
- }
-
- /**
- * Returns the image associated with the specified type of source container
- * or <code>null</code> if none.
- *
- * @param id unique identifier for a source container type
- * @return image associated with the specified type of source container
- * or <code>null</code> if none
- * @since 3.2
- * @see org.eclipse.debug.core.sourcelookup.ISourceContainerType
- */
- public static Image getSourceContainerImage(String id){
- return SourceLookupUIUtils.getSourceContainerImage(id);
- }
-
- /**
- * Returns a new source container browser for the specified type of source container
- * or <code>null</code> if a browser has not been registered.
- *
- * @param id unique identifier for a source container type
- * @return source container browser or <code>null</code> if none
- * @since 3.2
- * @see org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser
- */
- public static ISourceContainerBrowser getSourceContainerBrowser(String id) {
- return SourceLookupUIUtils.getSourceContainerBrowser(id);
- }
-
- /**
- * Returns the color associated with the specified preference identifier or
- * <code>null</code> if none.
- *
- * @param id preference identifier of the color
- * @return the color associated with the specified preference identifier
- * or <code>null</code> if none
- * @since 3.2
- * @see IDebugUIConstants
- */
- public static Color getPreferenceColor(String id) {
- return DebugUIPlugin.getPreferenceColor(id);
- }
-
- /**
- * Returns the debug context manager.
- *
- * @return debug context manager
- * @since 3.3
- */
- public static IDebugContextManager getDebugContextManager() {
- return DebugContextManager.getDefault();
- }
-
- /**
- * Return the debug context for the given executionEvent or <code>null</code> if none.
- *
- * @param event The execution event that contains the application context
- * @return the current debug context, or <code>null</code>.
- *
- * @since 3.5
- */
- public static ISelection getDebugContextForEvent(ExecutionEvent event) {
- Object o = HandlerUtil.getVariable(event, IConfigurationElementConstants.DEBUG_CONTEXT);
- if (o instanceof ISelection) {
- return (ISelection) o;
- }
- return null;
- }
-
- /**
- * Return the debug context for the given executionEvent.
- *
- * @param event The execution event that contains the application context
- * @return the debug context. Will not return <code>null</code>.
- * @throws ExecutionException If the current selection variable is not found.
- *
- * @since 3.5
- */
- public static ISelection getDebugContextForEventChecked(ExecutionEvent event)
- throws ExecutionException {
- Object o = HandlerUtil.getVariableChecked(event, IConfigurationElementConstants.DEBUG_CONTEXT);
- if (!(o instanceof ISelection)) {
- throw new ExecutionException("Incorrect type for " //$NON-NLS-1$
- + IConfigurationElementConstants.DEBUG_CONTEXT
- + " found while executing " //$NON-NLS-1$
- + event.getCommand().getId()
- + ", expected " + ISelection.class.getName() //$NON-NLS-1$
- + " found " + o.getClass().getName()); //$NON-NLS-1$
- }
- return (ISelection) o;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java
deleted file mode 100644
index c3083bf8b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 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 org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
-import org.eclipse.ui.progress.IElementCollector;
-
-
-/**
- * Common function for a deferred workbench adapter for a debug element.
- * <p>
- * Clients may subclass this class to provide custom adapters for elements in a debug
- * model. The debug platform provides <code>IDeferredWorkbenchAdapters</code> for the standard debug
- * elements. Clients may override the default content in the debug view by providing an
- * <code>IWorkbenchAdapter</code> or <code>IDeferredWorkbenchAdapter</code> for a debug
- * element.
- * </p>
- * @since 3.1
- * @deprecated deferred custom content in the debug views is no longer supported by
- * {@link IDeferredWorkbenchAdapter}. Deferred custom content is currently supported
- * by a provisional internal viewer framework.
- */
-public abstract class DeferredDebugElementWorkbenchAdapter extends DebugElementWorkbenchAdapter implements IDeferredWorkbenchAdapter {
-
- /**
- * An empty collection of children
- */
- protected static final Object[] EMPTY = new Object[0];
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer()
- */
- public boolean isContainer() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#getRule(java.lang.Object)
- */
- public ISchedulingRule getRule(Object object) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#fetchDeferredChildren(java.lang.Object, org.eclipse.ui.progress.IElementCollector, org.eclipse.core.runtime.IProgressMonitor)
- */
- public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) {
- if (monitor.isCanceled()) {
- return;
- }
- Object[] children = getChildren(object);
- if (monitor.isCanceled()) {
- return;
- }
- if (children.length > 0) {
- collector.add(children, monitor);
- }
- collector.done();
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
deleted file mode 100644
index ab22caf07..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
+++ /dev/null
@@ -1,685 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 Keith Seitz 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:
- * Keith Seitz (keiths@redhat.com) - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.MultipleInputDialog;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.launchConfigurations.EnvironmentVariable;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Launch configuration tab for configuring the environment passed
- * into Runtime.exec(...) when a config is launched.
- * <p>
- * This class may be instantiated.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class EnvironmentTab extends AbstractLaunchConfigurationTab {
-
- protected TableViewer environmentTable;
- protected String[] envTableColumnHeaders = {
- LaunchConfigurationsMessages.EnvironmentTab_Variable_1,
- LaunchConfigurationsMessages.EnvironmentTab_Value_2,
- };
- private static final String NAME_LABEL= LaunchConfigurationsMessages.EnvironmentTab_8;
- private static final String VALUE_LABEL= LaunchConfigurationsMessages.EnvironmentTab_9;
- protected static final String P_VARIABLE = "variable"; //$NON-NLS-1$
- protected static final String P_VALUE = "value"; //$NON-NLS-1$
- protected Button envAddButton;
- protected Button envEditButton;
- protected Button envRemoveButton;
- protected Button appendEnvironment;
- protected Button replaceEnvironment;
- protected Button envSelectButton;
-
- /**
- * Content provider for the environment table
- */
- protected class EnvironmentVariableContentProvider implements IStructuredContentProvider {
- public Object[] getElements(Object inputElement) {
- EnvironmentVariable[] elements = new EnvironmentVariable[0];
- ILaunchConfiguration config = (ILaunchConfiguration) inputElement;
- Map m;
- try {
- m = config.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
- } catch (CoreException e) {
- DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, "Error reading configuration", e)); //$NON-NLS-1$
- return elements;
- }
- if (m != null && !m.isEmpty()) {
- elements = new EnvironmentVariable[m.size()];
- String[] varNames = new String[m.size()];
- m.keySet().toArray(varNames);
- for (int i = 0; i < m.size(); i++) {
- elements[i] = new EnvironmentVariable(varNames[i], (String) m.get(varNames[i]));
- }
- }
- return elements;
- }
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput == null){
- return;
- }
- if (viewer instanceof TableViewer){
- TableViewer tableViewer= (TableViewer) viewer;
- if (tableViewer.getTable().isDisposed()) {
- return;
- }
- tableViewer.setComparator(new ViewerComparator() {
- public int compare(Viewer iviewer, Object e1, Object e2) {
- if (e1 == null) {
- return -1;
- } else if (e2 == null) {
- return 1;
- } else {
- return ((EnvironmentVariable)e1).getName().compareToIgnoreCase(((EnvironmentVariable)e2).getName());
- }
- }
- });
- }
- }
- }
-
- /**
- * Label provider for the environment table
- */
- public class EnvironmentVariableLabelProvider extends LabelProvider implements ITableLabelProvider {
- public String getColumnText(Object element, int columnIndex) {
- String result = null;
- if (element != null) {
- EnvironmentVariable var = (EnvironmentVariable) element;
- switch (columnIndex) {
- case 0: // variable
- result = var.getName();
- break;
- case 1: // value
- result = var.getValue();
- break;
- }
- }
- return result;
- }
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENV_VAR);
- }
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- // Create main composite
- Composite mainComposite = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_HORIZONTAL);
- setControl(mainComposite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_ENVIRONMENT_TAB);
-
- createEnvironmentTable(mainComposite);
- createTableButtons(mainComposite);
- createAppendReplace(mainComposite);
-
- Dialog.applyDialogFont(mainComposite);
- }
-
- /**
- * Creates and configures the widgets which allow the user to
- * choose whether the specified environment should be appended
- * to the native environment or if it should completely replace it.
- * @param parent the composite in which the widgets should be created
- */
- protected void createAppendReplace(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, 1, 2, GridData.FILL_HORIZONTAL);
- appendEnvironment= createRadioButton(comp, LaunchConfigurationsMessages.EnvironmentTab_16);
- appendEnvironment.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
- replaceEnvironment= createRadioButton(comp, LaunchConfigurationsMessages.EnvironmentTab_17);
- }
-
- /**
- * Updates the enablement of the append/replace widgets. The
- * widgets should disable when there are no environment variables specified.
- */
- protected void updateAppendReplace() {
- boolean enable= environmentTable.getTable().getItemCount() > 0;
- appendEnvironment.setEnabled(enable);
- replaceEnvironment.setEnabled(enable);
- }
-
- /**
- * Creates and configures the table that displayed the key/value
- * pairs that comprise the environment.
- * @param parent the composite in which the table should be created
- */
- protected void createEnvironmentTable(Composite parent) {
- Font font = parent.getFont();
- // Create label, add it to the parent to align the right side buttons with the top of the table
- SWTFactory.createLabel(parent, LaunchConfigurationsMessages.EnvironmentTab_Environment_variables_to_set__3, 2);
- // Create table composite
- Composite tableComposite = SWTFactory.createComposite(parent, font, 1, 1, GridData.FILL_BOTH, 0, 0);
- // Create table
- environmentTable = new TableViewer(tableComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
- Table table = environmentTable.getTable();
- table.setLayout(new GridLayout());
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- table.setFont(font);
- environmentTable.setContentProvider(new EnvironmentVariableContentProvider());
- environmentTable.setLabelProvider(new EnvironmentVariableLabelProvider());
- environmentTable.setColumnProperties(new String[] {P_VARIABLE, P_VALUE});
- environmentTable.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleTableSelectionChanged(event);
- }
- });
- environmentTable.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- if (!environmentTable.getSelection().isEmpty()) {
- handleEnvEditButtonSelected();
- }
- }
- });
- // Create columns
- final TableColumn tc1 = new TableColumn(table, SWT.NONE, 0);
- tc1.setText(envTableColumnHeaders[0]);
- final TableColumn tc2 = new TableColumn(table, SWT.NONE, 1);
- tc2.setText(envTableColumnHeaders[1]);
- final Table tref = table;
- final Composite comp = tableComposite;
- tableComposite.addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- Rectangle area = comp.getClientArea();
- Point size = tref.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- ScrollBar vBar = tref.getVerticalBar();
- int width = area.width - tref.computeTrim(0,0,0,0).width - 2;
- if (size.y > area.height + tref.getHeaderHeight()) {
- Point vBarSize = vBar.getSize();
- width -= vBarSize.x;
- }
- Point oldSize = tref.getSize();
- if (oldSize.x > area.width) {
- tc1.setWidth(width/2-1);
- tc2.setWidth(width - tc1.getWidth());
- tref.setSize(area.width, area.height);
- } else {
- tref.setSize(area.width, area.height);
- tc1.setWidth(width/2-1);
- tc2.setWidth(width - tc1.getWidth());
- }
- }
- });
- }
-
- /**
- * Responds to a selection changed event in the environment table
- * @param event the selection change event
- */
- protected void handleTableSelectionChanged(SelectionChangedEvent event) {
- int size = ((IStructuredSelection)event.getSelection()).size();
- envEditButton.setEnabled(size == 1);
- envRemoveButton.setEnabled(size > 0);
- }
-
- /**
- * Creates the add/edit/remove buttons for the environment table
- * @param parent the composite in which the buttons should be created
- */
- protected void createTableButtons(Composite parent) {
- // Create button composite
- Composite buttonComposite = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_END, 0, 0);
-
- // Create buttons
- envAddButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_New_4, null);
- envAddButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- handleEnvAddButtonSelected();
- }
- });
- envSelectButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_18, null);
- envSelectButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- handleEnvSelectButtonSelected();
- }
- });
- envEditButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_Edit_5, null);
- envEditButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- handleEnvEditButtonSelected();
- }
- });
- envEditButton.setEnabled(false);
- envRemoveButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_Remove_6, null);
- envRemoveButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- handleEnvRemoveButtonSelected();
- }
- });
- envRemoveButton.setEnabled(false);
- }
-
- /**
- * Adds a new environment variable to the table.
- */
- protected void handleEnvAddButtonSelected() {
- MultipleInputDialog dialog = new MultipleInputDialog(getShell(), LaunchConfigurationsMessages.EnvironmentTab_22);
- dialog.addTextField(NAME_LABEL, null, false);
- dialog.addVariablesField(VALUE_LABEL, null, true);
-
- if (dialog.open() != Window.OK) {
- return;
- }
-
- String name = dialog.getStringValue(NAME_LABEL);
- String value = dialog.getStringValue(VALUE_LABEL);
-
- if (name != null && value != null && name.length() > 0 && value.length() >0) {
- addVariable(new EnvironmentVariable(name.trim(), value.trim()));
- updateAppendReplace();
- }
- }
-
- /**
- * Attempts to add the given variable. Returns whether the variable
- * was added or not (as when the user answers not to overwrite an
- * existing variable).
- * @param variable the variable to add
- * @return whether the variable was added
- */
- protected boolean addVariable(EnvironmentVariable variable) {
- String name= variable.getName();
- TableItem[] items = environmentTable.getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- EnvironmentVariable existingVariable = (EnvironmentVariable) items[i].getData();
- if (existingVariable.getName().equals(name)) {
- boolean overWrite= MessageDialog.openQuestion(getShell(), LaunchConfigurationsMessages.EnvironmentTab_12, MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_13, new String[] {name})); //
- if (!overWrite) {
- return false;
- }
- environmentTable.remove(existingVariable);
- break;
- }
- }
- environmentTable.add(variable);
- updateLaunchConfigurationDialog();
- return true;
- }
-
- /**
- * Displays a dialog that allows user to select native environment variables
- * to add to the table.
- */
- private void handleEnvSelectButtonSelected() {
- //get Environment Variables from the OS
- Map envVariables = getNativeEnvironment();
-
- //get Environment Variables from the table
- TableItem[] items = environmentTable.getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
- envVariables.remove(var.getName());
- }
-
- NativeEnvironmentSelectionDialog dialog = new NativeEnvironmentSelectionDialog(getShell(), envVariables);
- dialog.setTitle(LaunchConfigurationsMessages.EnvironmentTab_20);
-
- int button = dialog.open();
- if (button == Window.OK) {
- Object[] selected = dialog.getResult();
- for (int i = 0; i < selected.length; i++) {
- environmentTable.add(selected[i]);
- }
- }
-
- updateAppendReplace();
- updateLaunchConfigurationDialog();
- }
-
- /**
- * Gets native environment variable from the LaunchManager. Creates EnvironmentVariable objects.
- * @return Map of name - EnvironmentVariable pairs based on native environment.
- */
- private Map getNativeEnvironment() {
- Map stringVars = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironmentCasePreserved();
- HashMap vars = new HashMap();
- for (Iterator i = stringVars.keySet().iterator(); i.hasNext(); ) {
- String key = (String) i.next();
- String value = (String) stringVars.get(key);
- vars.put(key, new EnvironmentVariable(key, value));
- }
- return vars;
- }
-
- /**
- * Creates an editor for the value of the selected environment variable.
- */
- private void handleEnvEditButtonSelected() {
- IStructuredSelection sel= (IStructuredSelection) environmentTable.getSelection();
- EnvironmentVariable var= (EnvironmentVariable) sel.getFirstElement();
- if (var == null) {
- return;
- }
- String originalName= var.getName();
- String value= var.getValue();
- MultipleInputDialog dialog= new MultipleInputDialog(getShell(), LaunchConfigurationsMessages.EnvironmentTab_11);
- dialog.addTextField(NAME_LABEL, originalName, false);
- dialog.addVariablesField(VALUE_LABEL, value, true);
-
- if (dialog.open() != Window.OK) {
- return;
- }
- String name= dialog.getStringValue(NAME_LABEL);
- value= dialog.getStringValue(VALUE_LABEL);
- if (!originalName.equals(name)) {
- if (addVariable(new EnvironmentVariable(name, value))) {
- environmentTable.remove(var);
- }
- } else {
- var.setValue(value);
- environmentTable.update(var, null);
- updateLaunchConfigurationDialog();
- }
- }
-
- /**
- * Removes the selected environment variable from the table.
- */
- private void handleEnvRemoveButtonSelected() {
- IStructuredSelection sel = (IStructuredSelection) environmentTable.getSelection();
- environmentTable.getControl().setRedraw(false);
- for (Iterator i = sel.iterator(); i.hasNext(); ) {
- EnvironmentVariable var = (EnvironmentVariable) i.next();
- environmentTable.remove(var);
- }
- environmentTable.getControl().setRedraw(true);
- updateAppendReplace();
- updateLaunchConfigurationDialog();
- }
-
- /**
- * Updates the environment table for the given launch configuration
- * @param configuration
- */
- protected void updateEnvironment(ILaunchConfiguration configuration) {
- environmentTable.setInput(configuration);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- configuration.removeAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- boolean append= true;
- try {
- append = configuration.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
- } catch (CoreException e) {
- DebugUIPlugin.log(e.getStatus());
- }
- if (append) {
- appendEnvironment.setSelection(true);
- replaceEnvironment.setSelection(false);
- } else {
- replaceEnvironment.setSelection(true);
- appendEnvironment.setSelection(false);
- }
- updateEnvironment(configuration);
- updateAppendReplace();
- }
-
- /**
- * Stores the environment in the given configuration
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- // Convert the table's items into a Map so that this can be saved in the
- // configuration's attributes.
- TableItem[] items = environmentTable.getTable().getItems();
- Map map = new HashMap(items.length);
- for (int i = 0; i < items.length; i++)
- {
- EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
- map.put(var.getName(), var.getValue());
- }
- if (map.size() == 0) {
- configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
- } else {
- configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, map);
- }
-
- if(appendEnvironment.getSelection()) {
- ILaunchConfiguration orig = configuration.getOriginal();
- boolean hasTrueValue = false;
- if(orig != null) {
- try {
- hasTrueValue = orig.hasAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES) &&
- orig.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
- } catch (CoreException e) {
- DebugUIPlugin.log(e.getStatus());
- }
- }
- if (hasTrueValue) {
- configuration.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
- } else {
- configuration.removeAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES);
- }
- } else {
- configuration.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, false);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return LaunchConfigurationsMessages.EnvironmentTab_Environment_7;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
- *
- * @since 3.3
- */
- public String getId() {
- return "org.eclipse.debug.ui.environmentTab"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing when activated
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing when de-activated
- }
-
- /**
- * This dialog allows users to select one or more known native environment variables from a list.
- */
- private class NativeEnvironmentSelectionDialog extends AbstractDebugCheckboxSelectionDialog {
-
- private Object fInput;
-
- public NativeEnvironmentSelectionDialog(Shell parentShell, Object input) {
- super(parentShell);
- fInput = input;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- setShowSelectAllButtons(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return IDebugUIConstants.PLUGIN_ID + ".ENVIRONMENT_TAB.NATIVE_ENVIROMENT_DIALOG"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_NATIVE_ENVIRONMENT_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return LaunchConfigurationsMessages.EnvironmentTab_19;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
- */
- protected IBaseLabelProvider getLabelProvider() {
- return new ILabelProvider() {
- public Image getImage(Object element) {
- return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT);
- }
- public String getText(Object element) {
- EnvironmentVariable var = (EnvironmentVariable) element;
- return MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_7, new String[] {var.getName(), var.getValue()});
- }
- public void addListener(ILabelProviderListener listener) {
- }
- public void dispose() {
- }
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
- public void removeListener(ILabelProviderListener listener) {
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
- */
- protected IContentProvider getContentProvider() {
- return new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- EnvironmentVariable[] elements = null;
- if (inputElement instanceof HashMap) {
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- String s1 = (String)o1;
- String s2 = (String)o2;
- return s1.compareTo(s2);
- }
- };
- TreeMap envVars = new TreeMap(comparator);
- envVars.putAll((Map)inputElement);
- elements = new EnvironmentVariable[envVars.size()];
- int index = 0;
- for (Iterator iterator = envVars.keySet().iterator(); iterator.hasNext(); index++) {
- Object key = iterator.next();
- elements[index] = (EnvironmentVariable) envVars.get(key);
- }
- }
- return elements;
- }
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- };
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java
deleted file mode 100644
index c0422fe4e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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 org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.util.IPropertyChangeListener;
-
-/**
- * A breakpoint organizer is used to categorize breakpoints and provides
- * change notification when categorization has changed. Categories are represented
- * as arbitrary adaptable objects. For example, projects could be used to
- * categorize breakpoints. Images and labels for categories are generated
- * via workbench adapters.
- * <p>
- * Organizers may optionally support breakpoint recategorization.
- * </p>
- * <p>
- * Following is example plug-in XML for contributing a breakpoint organizer.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.breakpointOrganizers"&gt;
- * &lt;breakpointOrganizer
- * class="com.example.BreakpointOrganizer"
- * id="com.example.BreakpointOrganizer"
- * label="Example Organizer"
- * icon="icons/full/obj16/example_org.gif"/&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>class</code> Fully qualified name of a Java class that implements
- * {@link IBreakpointOrganizerDelegate}.</li>
- * <li><code>id</code> Unique identifier for this breakpoint organizer.</li>
- * <li><code>label</code> Label for this organizer which is suitable for
- * presentation to the user.</li>
- * <li><code>icon</code> Optional path to an icon which can be shown for this
- * organizer</li>
- * </ul>
- * </p>
- * <p>
- * Clients contributing a breakpoint organizer are intended to implement
- * this interface.
- * </p>
- * @since 3.1
- */
-public interface IBreakpointOrganizerDelegate {
-
- /**
- * Change event id when a category's breakpoints have changed.
- * The <code>oldValue</code> of the <code>PropertyChangeEvent</code> will be the
- * category that has changed, and the source of the event will the the
- * breakpoint organizer. Breakpoints in the category will be
- * recategorized when this event is fired.
- *
- * @see IPropertyChangeListener
- */
- public static final String P_CATEGORY_CHANGED = DebugUIPlugin.getUniqueIdentifier() + ".P_CATEGORY_CHANGED"; //$NON-NLS-1$
-
- /**
- * Returns objects representing the categories of the specified
- * breakpoint or <code>null</code> if this organizer cannot classify
- * the breakpoint. Categories must return <code>true</code> when sent
- * the message <code>equals(Object)</code> with an equivalent category
- * as an argument.
- *
- * @param breakpoint breakpoint to classify
- * @return categories of the given breakpoint or <code>null</code>
- */
- public IAdaptable[] getCategories(IBreakpoint breakpoint);
-
- /**
- * Adds the specified listener. Has no effect if an identical listener is
- * already registered.
- *
- * @param listener listener to add
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Removes the specified listener. Has no effect if an identical listener
- * is not already registered.
- *
- * @param listener listener to remove
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Adds the specified breakpoint to the given category. Only called
- * if <code>canAdd(...)</code> returns <code>true</code> for the given
- * breakpoint and category.
- *
- * @param breakpoint breakpoint to recategorize
- * @param category the breakpoint's new category
- */
- public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category);
-
- /**
- * Removes the specified breakpoint from the given category. Only
- * called if <code>canRemove(...)</code> returns <code>true</code> for
- * the given breakpoint and category.
- *
- * @param breakpoint breakpoint to recategorize
- * @param category the category the breakpoint is remove from
- */
- public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category);
-
- /**
- * Returns whether the given breakpoint can be categorized in the
- * specified category.
- *
- * @param breakpoint breakpoint to recatogorize
- * @param category the category to add the breakpoint to
- * @return whether the given breakpoint can be categorized in the
- * specified category
- */
- public boolean canAdd(IBreakpoint breakpoint, IAdaptable category);
-
- /**
- * Returns whether the given breakpoint can be removed from the given
- * category.
- *
- * @param breakpoint breakpoint to recategorize
- * @param category the category to remove the breakpoint from
- * @return whether the given breakpoint can be removed from the given
- * category
- */
- public boolean canRemove(IBreakpoint breakpoint, IAdaptable category);
-
- /**
- * Returns all categories managed by this organizer, or <code>null</code>.
- * When <code>null</code> is returned, the breakpoints view only displays
- * categories that contain breakpoints. When a collection of categories
- * is returned the breakpoints will display all of the categories, some of
- * which may be empty.
- *
- * @return all categories managed by this organizer, or <code>null</code>
- */
- public IAdaptable[] getCategories();
-
- /**
- * Disposes this breakpoint organizer.
- */
- public void dispose();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java
deleted file mode 100644
index 9bff24a27..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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 org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- * Optional enhancements to the {@link IBreakpointOrganizerDelegate} interface.
- * Supports operations on more than one breakpoint at a time.
- * <p>
- * Clients contributing a breakpoint organizer may optionally implement this
- * interface when implementing {@link IBreakpointOrganizerDelegate}.
- * </p>
- * @since 3.3
- */
-public interface IBreakpointOrganizerDelegateExtension extends IBreakpointOrganizerDelegate {
-
- /**
- * Adds the specified breakpoints to the given category. Only called
- * if <code>canAdd(...)</code> returns <code>true</code> for the given
- * breakpoints and category.
- *
- * @param breakpoints breakpoints add
- * @param category the breakpoints' new category
- */
- public void addBreakpoints(IBreakpoint[] breakpoints, IAdaptable category);
-
- /**
- * Removes the specified breakpoints from the given category. Only
- * called if <code>canRemove(...)</code> returns <code>true</code> for
- * the given breakpoints and category.
- *
- * @param breakpoints breakpoints to remove
- * @param category the category the breakpoint is remove from
- */
- public void removeBreakpoints(IBreakpoint[] breakpoints, IAdaptable category);
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointTypeCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointTypeCategory.java
deleted file mode 100644
index ddb1ea8a3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointTypeCategory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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 org.eclipse.core.runtime.IAdaptable;
-
-/**
- * Represents a breakpoint's type to support organization of breakpoints
- * by type in the breakpoints view. A default breakpoint type adapter
- * is provided for breakpoints by the debug platform, but clients may override
- * the default adapter by providing their own adapter for breakpoints.
- * <p>
- * A breakpoint type category is an adaptable that must provide an
- * <code>IWorkbenchAdapter</code> such that it can be rendered in the
- * breakpoints view.
- * </p>
- * <p>
- * Implementations should ensure that <code>equals</code> and <code>hashCode</code>
- * are implemented properly to reflect the equality of type categories.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see org.eclipse.debug.ui.BreakpointTypeCategory
- * @since 3.1
- */
-public interface IBreakpointTypeCategory extends IAdaptable {
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugEditorPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugEditorPresentation.java
deleted file mode 100644
index dcef24c81..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugEditorPresentation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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 org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A debug model presentation may implement this interface to override
- * standard editor positioning and annotations associated with
- * source code display for stack frames.
- *
- * @since 3.0
- */
-public interface IDebugEditorPresentation {
- /**
- * Positions and adds annotations to the given editor for the specified
- * stack frame and returns whether any annotations were added. When
- * <code>true</code> is returned, a call will be made to remove annotations
- * when the source selection is cleared for the stack frame. When
- * <code>false</code> is returned, the debugger will position and add
- * standard annotations to the editor, and a corresponding call to remove
- * annotations will not be made. This method is called when the debugger is
- * has opened an editor to display source for the given stack frame.
- *
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- */
- public boolean addAnnotations(IEditorPart editorPart, IStackFrame frame);
-
- /**
- * Removes any debug related annotations from the given editor.
- * This method is called when the debugger clears the source selection
- * in an editor opened by the debugger. For example, when a debug
- * session is resumed or terminated.
- *
- * @param editorPart an editor that annotations were added to for
- * a stack frame
- * @param thread the thread for which stack frame annotations were
- * added to the editor
- */
- public void removeAnnotations(IEditorPart editorPart, IThread thread);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
deleted file mode 100644
index cdcbc3c5f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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 org.eclipse.debug.core.model.IValue;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A debug model presentation is responsible for providing labels, images,
- * and editors associated with debug elements in a specific debug model.
- * Extensions of type <code>org.eclipse.debug.ui.debugModelPresentations</code> implement
- * this interface. Generally, a debug model implementation will also provide a
- * debug model presentation extension to render and display its elements. A debug
- * model presentation is registered for a specific debug model, and is responsible
- * for the presentation elements defined/implemented by that model.
- * <p>
- * A debug model presentation extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a debug model presentation extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.debugModelPresentations"&gt;
- * &lt;debugModelPresentation
- * id="com.example.debugModelIdentifier"
- * class="com.example.ExamplePresentation"
- * detailsViewerConfiguration="com.example.ExampleSourceViewerConfiguration"&gt;
- * &lt;/debugModelPresentation&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies the identifier of the debug model this presentation
- * is responsible for. Corresponds to the model identifier returned from a debug
- * element - see <code>IDebugElement.getModelIndentifier</code></li>
- * <li><code>class</code> specifies the fully qualified name of the Java class
- * that implements this interface.</li>
- * <li><code>detailsViewerConfiguration</code> optionally specifies the fully qualified name of the Java class
- * that is an instance of <code>org.eclipse.jface.text.source.SourceViewerConfiguration</code>.
- * When specified, the source viewer configuration will be used in the "details" area of the
- * variables and expressions view when displaying the details of an element from the
- * debug model associated with this debug model presentation. When unspecified,
- * a default configuration is used.</li>
- * </ul>
- * </p>
- * <p>
- * To allow for an extensible configuration, this interface defines
- * a <code>setAttribute</code> method. The debug UI plug-in defines
- * one presentation attribute:
- * <ul>
- * <li><code>DISPLAY_VARIABLE_TYPE_NAMES</code> - This is a boolean attribute
- * indicating whether variable elements should be rendered with the declared
- * type of a variable. For example, a Java debug model presentation would render
- * an integer as <code>"int x = 3"</code> when true, and <code>"x = 3"</code>
- * when false.</li>
- * </ul>
- * </p>
- * <p>
- * Clients may define new presentation attributes. For example, a client may wish
- * to define a "hexadecimal" property to display numeric values in hexadecimal. Implementations
- * should honor the presentation attributes defined by this interface where possible,
- * but do not need to honor presentation attributes defined by other clients.
- * To access the debug model presentation for a debug view, clients should use
- * <code>IDebugView#getPresentation(String)</code>.
- * </p>
- * <p>
- * Since 3.1, debug model presentations may optionally implement <code>IColorProvider</code>
- * and <code>IFontProvider</code> to override default fonts and colors for debug elements.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see org.eclipse.debug.core.model.IDebugElement
- * @see org.eclipse.jface.viewers.ILabelProvider
- * @see org.eclipse.debug.ui.IDebugView
- */
-
-public interface IDebugModelPresentation extends ILabelProvider, ISourcePresentation {
- /**
- * Variable type names presentation property (value <code>"org.eclipse.debug.ui.displayVariableTypeNames"</code>).
- * When <code>DISPLAY_VARIABLE_TYPE_NAMES</code> is set to <code>true</code>,
- * this label provider should include the reference type of a variable when rendering
- * variables. When set to <code>false</code>, this label provider
- * should not include the reference type of a variable when rendering
- * variables.
- * @see #setAttribute(String, Object)
- */
- public final static String DISPLAY_VARIABLE_TYPE_NAMES= IDebugUIConstants.PLUGIN_ID + ".displayVariableTypeNames"; //$NON-NLS-1$
- /**
- * Sets a presentation attribute of this label provider. For example,
- * see the presentation attribute <code>DISPLAY_VARIABLE_TYPE_NAMES</code>
- * defined by this interface.
- *
- * @param attribute the presentation attribute identifier
- * @param value the value of the attribute
- */
- void setAttribute(String attribute, Object value);
- /**
- * Returns an image for the element, or <code>null</code> if a default
- * image should be used.
- *
- * @param element the debug model element
- * @return an image for the element, or <code>null</code> if a default
- * image should be used
- * @see ILabelProvider
- */
- public Image getImage(Object element);
- /**
- * Returns a label for the element, or <code>null</code> if a default
- * label should be used.
- *
- * @param element the debug model element
- * @return a label for the element, or <code>null</code> if a default
- * label should be used
- * @see ILabelProvider
- */
- public String getText(Object element);
-
- /**
- * Computes a detailed description of the given value, reporting
- * the result to the specified listener. This allows a presentation
- * to provide extra details about a selected value in the variable detail
- * portion of the variables view. Since this can be a long-running operation,
- * the details are reported back to the specified listener asynchronously.
- * If <code>null</code> is reported, the value's value string is displayed
- * (<code>IValue.getValueString()</code>).
- *
- * @param value the value for which a detailed description
- * is required
- * @param listener the listener to report the details to
- * asynchronously
- * @since 2.0
- */
- void computeDetail(IValue value, IValueDetailListener listener);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentationExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentationExtension.java
deleted file mode 100644
index 144dad097..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentationExtension.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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;
-
-/**
- * Optional extension for an {@link IDebugModelPresentation}. Dynamically controls
- * whether labels are computed in a UI thread. The debug platform calls debug model
- * presentation label related methods that do not implement this interface in a
- * <b>non-UI</b> thread.
- * <p>
- * For example, some models may require at least one access in a UI thread to initialize
- * an image registry at which point they may be able to provide labels in a non-UI
- * thread.
- * </p>
- * <p>
- * Clients implementing a debug model presentation should also implement
- * this interface to control which thread labels are generated in.
- * </p>
- * @since 3.4
- */
-public interface IDebugModelPresentationExtension extends IDebugModelPresentation {
-
- /**
- * Returns whether the UI thread is required to retrieve a label (text, image, font,
- * foreground, background, etc.), for the specified element. When <code>true</code> is
- * returned, label related methods will be called in the UI thread, otherwise methods
- * may be called in a non-UI thread.
- *
- * @param element the element a label is to be retrieved for
- * @return whether label related methods should be called on the UI thread
- */
- public boolean requiresUIThread(Object element);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
deleted file mode 100644
index 411e523a5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
+++ /dev/null
@@ -1,1266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 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
- * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640)
- * Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchManager;
-
-/**
- * Constant definitions for debug UI plug-in.
- * <p>
- * Popup menus in the debug UI support action contribution via the
- * <code>org.eclipse.ui.popupMenus</code> extension. Actions may be
- * contributed to any group on the menu. To facilitate insertion of actions
- * in between existing groups, empty groups have been defined
- * in the menu. Each group prefixed by "empty" indicates an empty group.
- * </p>
- * <h3>Debug View Popup Menu</h3>
- * <ul>
- * <li>Empty edit group</li>
- * <li>Edit group</li>
- * <li>Copy stack action</li>
- * <li>Empty step group</li>
- * <li>Step group</li>
- * <li>Step into group</li>
- * <li>Step into action</li>
- * <li>Step over group</li>
- * <li>Step over action</li>
- * <li>Step return group</li>
- * <li>Step return action</li>
- * <li>Empty thread group</li>
- * <li>Thread group</li>
- * <li>Resume action</li>
- * <li>Suspend action</li>
- * <li>Terminate action</li>
- * <li>Disconnect action</li>
- * <li>Empty launch group</li>
- * <li>Launch group</li>
- * <li>Remove all terminated action</li>
- * <li>Terminate and Remove action</li>
- * <li>Relaunch action</li>
- * <li>Terminate all action</li>
- * <li>Empty render group</li>
- * <li>Render group</li>
- * <li>Property group</li>
- * <li>Property dialog action</li>
- * <li>Additions group</li>
- * </ul>
- * <h3>Variables View Popup Menus</h3>
- * <ul>
- * <li>Empty variable group</li>
- * <li>Variable group</li>
- * <li>Select all action</li>
- * <li>Copy to clipboard action</li>
- * <li>Find action</li>
- * <li>Change value action</li>
- * <li>Available logical structures action</li>
- * <li>Available detail panes action</li>
- * <li>Empty render group</li>
- * <li>Render group</li>
- * <li>Show type names action</li>
- * <li>Additions group</li>
- * </ul>
- * <h3>Breakpoints View Popup Menu</h3>
- * <ul>
- * <li>Empty Navigation group</li>
- * <li>Navigation group</li>
- * <li>Open action</li>
- * <li>Empty Breakpoint group</li>
- * <li>Breakpoint group</li>
- * <li>Enable action</li>
- * <li>Disable action</li>
- * <li>Remove action</li>
- * <li>Remove all action</li>
- * <li>Empty render group</li>
- * <li>Render group</li>
- * <li>Show breakpoints for model action</li>
- * <li>Additions group</li>
- * </ul>
- * <h3>Expressions View Popup Menu</h3>
- * <ul>
- * <li>Empty Expression group</li>
- * <li>Expression group</li>
- * <li>Select all action</li>
- * <li>Copy to clipboard action</li>
- * <li>Remove action</li>
- * <li>Remove all action</li>
- * <li>Find action</li>
- * <li>Change variable value action</li>
- * <li>Available logical structures action</li>
- * <li>Available detail panes action</li>
- * <li>Empty Render group</li>
- * <li>Render group</li>
- * <li>Show type names action</li>
- * <li>Additions group</li>
- * </ul>
- * <p>
- * Constants only.
- * </p>
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-
-public interface IDebugUIConstants {
-
- /**
- * Debug UI plug-in identifier (value <code>"org.eclipse.debug.ui"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.debug.ui"; //$NON-NLS-1$;
-
- /**
- * Debug perspective identifier (value <code>"org.eclipse.debug.ui.DebugPerspective"</code>).
- */
- public static final String ID_DEBUG_PERSPECTIVE = PLUGIN_ID + ".DebugPerspective"; //$NON-NLS-1$
-
- /**
- * Console type identifier (value <code>"org.eclipse.debug.ui.ProcessConsoleType"</code>).
- *
- * @since 3.1
- */
- public static final String ID_PROCESS_CONSOLE_TYPE = PLUGIN_ID + ".ProcessConsoleType"; //$NON-NLS-1$
-
- /**
- * Constant for referring to no perspective.
- */
- public static final String PERSPECTIVE_NONE = "perspective_none"; //$NON-NLS-1$
-
- /**
- * Constant for referring to a default perspective.
- */
- public static final String PERSPECTIVE_DEFAULT = "perspective_default"; //$NON-NLS-1$
-
- // Preferences
-
- /**
- * String preference that identifies the default 'switch to perspective id' when running a
- * launch configuration. This default is used if a particular launch configuration does not
- * override the 'switch to perspective when in run mode' attribute with something else.
- */
- public static final String PREF_SHOW_RUN_PERSPECTIVE_DEFAULT= PLUGIN_ID + ".show_run_perspective_default"; //$NON-NLS-1$
-
- /**
- * String preference that identifies the default 'switch to perspective id' when debugging a
- * launch configuration. This default is used if a particular launch configuration does not
- * override the 'switch to perspective when in debug mode' attribute with something else.
- */
- public static final String PREF_SHOW_DEBUG_PERSPECTIVE_DEFAULT= PLUGIN_ID + ".show_debug_perspective_default"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether a build is done before
- * launching a program (if one is needed).
- */
- public static final String PREF_BUILD_BEFORE_LAUNCH= PLUGIN_ID + ".build_before_launch"; //$NON-NLS-1$
- /**
- * Boolean preference controlling automatic removal of terminated launches
- * when a new launch is registered.
- * @since 2.0
- */
- public static final String PREF_AUTO_REMOVE_OLD_LAUNCHES= PLUGIN_ID + ".auto_remove_old_launches"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger re-uses non-dirty editors
- * that it opens when displaying source. When <code>true</code> the debugger
- * re-uses the same editor when showing source for a selected stack frame (unless
- * the editor is dirty).
- *
- * @since 2.0
- */
- public static final String PREF_REUSE_EDITOR = PLUGIN_ID + ".reuse_editor"; //$NON-NLS-1$
-
- /**
- * Integer preference that specifies the length of the Run & Debug launch history lists.
- *
- * @since 2.0
- */
- public static final String PREF_MAX_HISTORY_SIZE = PLUGIN_ID + ".max_history_size"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger shows types names
- * in its variable view. When <code>true</code> the debugger
- * will display type names in new variable views.
- *
- * @since 2.0
- * @deprecated no longer used
- */
- public static final String PREF_SHOW_TYPE_NAMES = PLUGIN_ID + ".show_type_names"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger shows the detail pane
- * in its variable view. When <code>true</code> the debugger
- * will show the detail panes in new variable views.
- *
- * @since 2.0
- * @deprecated no longer used
- */
- public static final String PREF_SHOW_DETAIL_PANE = PLUGIN_ID + ".show_detail_pane"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger will force activate the active
- * shell/window of the Eclipse workbench when a breakpoint is hit.
- *
- * @since 2.1
- */
- public static final String PREF_ACTIVATE_WORKBENCH= PLUGIN_ID + ".activate_workbench"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether breakpoints are
- * automatically skipped during a Run To Line operation.
- * If true, breakpoints will be skipped automatically
- * during Run To Line. If false, they will be hit.
- *
- * @since 3.0
- */
- public static final String PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE= PLUGIN_ID + ".skip_breakpoints_during_run_to_line"; //$NON-NLS-1$
-
- /**
- * String preference controlling in which perspectives view management will
- * occur. This preference, if set, overrides the perspectives enabled
- * through the <code>contextViewBindings</code> extension point. The value
- * is a comma-separated list of perspective IDs, an empty string (no perspectives),
- * or the value of <code>PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT</code> ("<code>DEFAULT</code>").
- *
- * @since 3.0
- */
- public static final String PREF_MANAGE_VIEW_PERSPECTIVES= PLUGIN_ID + ".manage_view_perspectives"; //$NON-NLS-1$
-
- /**
- * The default value of the {@link IDebugUIConstants#PREF_MANAGE_VIEW_PERSPECTIVES} preference.
- *
- * @see IDebugUIConstants#PREF_MANAGE_VIEW_PERSPECTIVES
- *
- * @since 3.5
- */
- public static final String PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT= "DEFAULT"; //$NON-NLS-1$
-
- /**
- * Font preference setting for the process console.
- *
- * @since 3.3
- */
- public static final String PREF_CONSOLE_FONT= "org.eclipse.debug.ui.consoleFont"; //$NON-NLS-1$
-
- /**
- * Debug view identifier (value <code>"org.eclipse.debug.ui.DebugView"</code>).
- */
- public static final String ID_DEBUG_VIEW= "org.eclipse.debug.ui.DebugView"; //$NON-NLS-1$
-
- /**
- * Breakpoint view identifier (value <code>"org.eclipse.debug.ui.BreakpointView"</code>).
- */
- public static final String ID_BREAKPOINT_VIEW= "org.eclipse.debug.ui.BreakpointView"; //$NON-NLS-1$
-
- /**
- * Variable view identifier (value <code>"org.eclipse.debug.ui.VariableView"</code>).
- */
- public static final String ID_VARIABLE_VIEW= "org.eclipse.debug.ui.VariableView"; //$NON-NLS-1$
-
- /**
- * Expression view identifier (value <code>"org.eclipse.debug.ui.ExpressionView"</code>).
- * @since 2.0
- */
- public static final String ID_EXPRESSION_VIEW= "org.eclipse.debug.ui.ExpressionView"; //$NON-NLS-1$
-
- /**
- * Register view identifier (value <code>"org.eclipse.debug.ui.RegisterView"</code>).
- * @since 3.0
- */
- public static final String ID_REGISTER_VIEW= "org.eclipse.debug.ui.RegisterView"; //$NON-NLS-1$
-
- /**
- * Module view identifier (value <code>"org.eclipse.debug.ui.ModuleView"</code>).
- * @since 3.4
- */
- public static final String ID_MODULE_VIEW= "org.eclipse.debug.ui.ModuleView"; //$NON-NLS-1$
-
- /**
- * Console view identifier (value <code>"org.eclipse.debug.ui.ConsoleView"</code>).
- * @deprecated Use org.eclipse.ui.console.IConsoleConstants.ID_CONSOLE_VIEW
- * @since 3.0
- */
- public static final String ID_CONSOLE_VIEW= "org.eclipse.debug.ui.ConsoleView"; //$NON-NLS-1$
-
- // Console stream identifiers
-
- /**
- * Identifier for the standard out stream.
- *
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(String)
- * @since 2.1
- */
- public static final String ID_STANDARD_OUTPUT_STREAM = IDebugUIConstants.PLUGIN_ID + ".ID_STANDARD_OUTPUT_STREAM"; //$NON-NLS-1$
-
- /**
- * Identifier for the standard error stream.
- *
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(String)
- * @since 2.1
- */
- public static final String ID_STANDARD_ERROR_STREAM = IDebugUIConstants.PLUGIN_ID + ".ID_STANDARD_ERROR_STREAM"; //$NON-NLS-1$
-
- /**
- * Identifier for the standard input stream.
- *
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(String)
- * @since 2.1
- */
- public static final String ID_STANDARD_INPUT_STREAM = IDebugUIConstants.PLUGIN_ID + ".ID_STANDARD_INPUT_STREAM"; //$NON-NLS-1$
-
- // Debug Action images
-
- /**
- * Debug action image identifier.
- */
- public static final String IMG_ACT_DEBUG= "IMG_ACT_DEBUG"; //$NON-NLS-1$
-
- /**
- * Run action image identifier.
- */
- public static final String IMG_ACT_RUN= "IMG_ACT_RUN"; //$NON-NLS-1$
-
- /** "Link with View" action image identifier. */
- public static final String IMG_ACT_SYNCED= "IMG_ACT_SYNCED"; //$NON-NLS-1$
-
- /** "Skip Breakpoints" action image identifier */
- public static final String IMG_SKIP_BREAKPOINTS= "IMG_SKIP_BREAKPOINTS"; //$NON-NLS-1$
-
- /** Clear action image identifier.
- * @deprecated */
- public static final String IMG_LCL_CLEAR= "IMG_LCL_CLEAR"; //$NON-NLS-1$
-
- /** Display variable type names action image identifier. */
- public static final String IMG_LCL_TYPE_NAMES= "IMG_LCL_TYPE_NAMES"; //$NON-NLS-1$
-
- /** Toggle detail pane action image identifier.*/
- public static final String IMG_LCL_DETAIL_PANE= "IMG_LCL_DETAIL_PANE"; //$NON-NLS-1$
-
- /** Change variable value action image identifier.*/
- public static final String IMG_LCL_CHANGE_VARIABLE_VALUE= "IMG_LCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
-
- /**
- * Disconnect action image identifier
- *
- * @since 2.0
- */
- public static final String IMG_LCL_DISCONNECT= "IMG_LCL_DISCONNECT"; //$NON-NLS-1$
-
- /**
- * Scroll lock action image identifier
- *
- * @since 2.1
- */
- public static final String IMG_LCL_LOCK = "IMG_LCL_LOCK"; //$NON-NLS-1$
-
- /**
- * Remove all action image identifier
- *
- * @since 2.1
- */
- public static final String IMG_LCL_REMOVE_ALL = "IMG_LCL_REMOVE_ALL"; //$NON-NLS-1$
-
- /**
- * Remove action image identifier
- *
- * @since 3.2
- */
- public static final String IMG_LCL_REMOVE = "IMG_LCL_REMOVE"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier.
- */
- public static final String IMG_LCL_CONTENT_ASSIST= "IMG_LCL_CONTENT_ASSIST"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier (enabled).
- */
- public static final String IMG_ELCL_CONTENT_ASSIST= "IMG_ELCL_CONTENT_ASSIST"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier (disabled).
- */
- public static final String IMG_DLCL_CONTENT_ASSIST= "IMG_DLCL_CONTENT_ASSIST"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier.
- */
- public static final String IMG_LCL_DETAIL_PANE_UNDER= "IMG_LCL_DETAIL_PANE_UNDER"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier.
- */
- public static final String IMG_LCL_DETAIL_PANE_RIGHT= "IMG_LCL_DETAIL_PANE_RIGHT"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier.
- */
- public static final String IMG_LCL_DETAIL_PANE_HIDE= "IMG_LCL_DETAIL_PANE_HIDE"; //$NON-NLS-1$
-
- // Debug element images
-
- /** Debug mode launch image identifier. */
- public static final String IMG_OBJS_LAUNCH_DEBUG= "IMG_OBJS_LAUNCH_DEBUG"; //$NON-NLS-1$
-
- /** Run mode launch image identifier. */
- public static final String IMG_OBJS_LAUNCH_RUN= "IMG_OBJS_LAUNCH_RUN"; //$NON-NLS-1$
-
- /** Terminated run mode launch image identifier. */
- public static final String IMG_OBJS_LAUNCH_RUN_TERMINATED= "IMG_OBJS_LAUNCH_RUN_TERMINATED"; //$NON-NLS-1$
-
- /** Running debug target image identifier. */
- public static final String IMG_OBJS_DEBUG_TARGET= "IMG_OBJS_DEBUG_TARGET"; //$NON-NLS-1$
-
- /** Suspended debug target image identifier. */
- public static final String IMG_OBJS_DEBUG_TARGET_SUSPENDED= "IMG_OBJS_DEBUG_TARGET_SUSPENDED"; //$NON-NLS-1$
-
- /** Terminated debug target image identifier. */
- public static final String IMG_OBJS_DEBUG_TARGET_TERMINATED= "IMG_OBJS_DEBUG_TARGET_TERMINATED"; //$NON-NLS-1$
-
- /** Running thread image identifier. */
- public static final String IMG_OBJS_THREAD_RUNNING= "IMG_OBJS_THREAD_RUNNING"; //$NON-NLS-1$
-
- /** Suspended thread image identifier. */
- public static final String IMG_OBJS_THREAD_SUSPENDED= "IMG_OBJS_THREAD_SUSPENDED"; //$NON-NLS-1$
-
- /** Terminated thread image identifier. */
- public static final String IMG_OBJS_THREAD_TERMINATED= "IMG_OBJS_THREAD_TERMINATED"; //$NON-NLS-1$
-
- /** Stack frame (suspended) image identifier. */
- public static final String IMG_OBJS_STACKFRAME= "IMG_OBJS_STACKFRAME"; //$NON-NLS-1$
-
- /** Stack frame (running) image identifier. */
- public static final String IMG_OBJS_STACKFRAME_RUNNING= "IMG_OBJS_STACKFRAME_RUNNING"; //$NON-NLS-1$
-
- /** Enabled breakpoint image identifier. */
- public static final String IMG_OBJS_BREAKPOINT= "IMG_OBJS_BREAKPOINT"; //$NON-NLS-1$
-
- /** Disabled breakpoint image identifier. */
- public static final String IMG_OBJS_BREAKPOINT_DISABLED= "IMG_OBJS_BREAKPOINT_DISABLED"; //$NON-NLS-1$
-
- /**
- * Breakpoint group image identifier.
- *
- * @since 3.1
- */
- public static final String IMG_OBJS_BREAKPOINT_GROUP = "IMG_OBJS_BREAKPOINT_GROUP"; //$NON-NLS-1$
-
- /**
- * Disabled breakpoint group image identifier.
- *
- * @since 3.1
- */
- public static final String IMG_OBJS_BREAKPOINT_GROUP_DISABLED = "IMG_OBJS_BREAKPOINT_GROUP_DISABLED"; //$NON-NLS-1$
-
- /**
- * Enabled watchpoint image identifier (access & modification).
- * @since 3.0
- */
- public static final String IMG_OBJS_WATCHPOINT= "IMG_OBJS_WATCHPOINT"; //$NON-NLS-1$
-
- /**
- * Disabled watchpoint image identifier (access & modification).
- * @since 3.0
- */
- public static final String IMG_OBJS_WATCHPOINT_DISABLED= "IMG_OBJS_WATCHPOINT_DISABLED"; //$NON-NLS-1$
-
- /**
- * Enabled access watchpoint image identifier.
- * @since 3.1
- */
- public static final String IMG_OBJS_ACCESS_WATCHPOINT= "IMG_OBJS_ACCESS_WATCHPOINT"; //$NON-NLS-1$
-
- /**
- * Disabled access watchpoint image identifier.
- * @since 3.1
- */
- public static final String IMG_OBJS_ACCESS_WATCHPOINT_DISABLED= "IMG_OBJS_ACCESS_WATCHPOINT_DISABLED"; //$NON-NLS-1$
-
- /**
- * Enabled modification watchpoint image identifier.
- * @since 3.1
- */
- public static final String IMG_OBJS_MODIFICATION_WATCHPOINT= "IMG_OBJS_MODIFICATION_WATCHPOINT"; //$NON-NLS-1$
-
- /**
- * Disabled modification watchpoint image identifier.
- * @since 3.1
- */
- public static final String IMG_OBJS_MODIFICATION_WATCHPOINT_DISABLED= "IMG_OBJS_MODIFICATION_WATCHPOINT_DISABLED"; //$NON-NLS-1$
-
- /** Running system process image identifier. */
- public static final String IMG_OBJS_OS_PROCESS= "IMG_OBJS_OS_PROCESS"; //$NON-NLS-1$
-
- /** Terminated system process image identifier. */
- public static final String IMG_OBJS_OS_PROCESS_TERMINATED= "IMG_OBJS_OS_PROCESS_TERMINATED"; //$NON-NLS-1$
-
- /**
- * Expression image identifier.
- *
- * @since 2.0
- */
- public static final String IMG_OBJS_EXPRESSION= "IMG_OBJS_EXPRESSION"; //$NON-NLS-1$
-
- /**
- * Generic variable image identifier.
- *
- * @since 2.0
- */
- public static final String IMG_OBJS_VARIABLE= "IMG_OBJS_VARIABLE"; //$NON-NLS-1$
-
- /**
- * Generic identifier of register group image.
- *
- * @since 3.0
- */
- public static final String IMG_OBJS_REGISTER_GROUP= "IMG_OBJS_REGISTER_GROUP"; //$NON-NLS-1$
-
- /**
- * Generic register image identifier.
- *
- * @since 3.0
- */
- public static final String IMG_OBJS_REGISTER= "IMG_OBJS_REGISTER"; //$NON-NLS-1$
-
- /**
- * Environment image identifier.
- *
- * @since 3.0
- */
- public static final String IMG_OBJS_ENVIRONMENT = "IMG_OBJS_ENVIRONMENT"; //$NON-NLS-1$
-
- /**
- * Environment variable image identifier.
- *
- * @since 3.0
- */
- public static final String IMG_OBJS_ENV_VAR = "IMG_OBJS_ENV_VAR"; //$NON-NLS-1$
-
- // views
-
- /**
- * Launches view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_LAUNCHES= "IMG_VIEW_LAUNCHES"; //$NON-NLS-1$
-
- /**
- * Breakpoints view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_BREAKPOINTS= "IMG_VIEW_BREAKPOINTS"; //$NON-NLS-1$
-
- /**
- * Variables view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_VARIABLES= "IMG_VIEW_VARIABLES"; //$NON-NLS-1$
-
- /**
- * Expressions view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_EXPRESSIONS= "IMG_VIEW_EXPRESSIONS"; //$NON-NLS-1$
-
- /**
- * Console view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_CONSOLE= "IMG_VIEW_CONSOLE"; //$NON-NLS-1$
-
- // perspective
- /**
- * Debug perspective image identifier
- *
- * @since 2.0
- */
- public static final String IMG_PERSPECTIVE_DEBUG= "IMG_PERSPECTIVE_DEBUG"; //$NON-NLS-1$
-
- // wizard banners
- /** Debug wizard banner image identifier. */
- public static final String IMG_WIZBAN_DEBUG= "IMG_WIZBAN_DEBUG"; //$NON-NLS-1$
-
- /** Run wizard banner image identifier. */
- public static final String IMG_WIZBAN_RUN= "IMG_WIZBAN_RUN"; //$NON-NLS-1$
-
- // overlays
- /** Error overlay image identifier. */
- public static final String IMG_OVR_ERROR = "IMG_OVR_ERROR"; //$NON-NLS-1$
-
- /**
- * Skip breakpoint image overlay identifier.
- * @since 3.1
- */
- public static final String IMG_OVR_SKIP_BREAKPOINT = "IMG_OVR_SKIP_BREAKPOINT"; //$NON-NLS-1$
-
- /**
- * Debug action set identifier (value <code>"org.eclipse.debug.ui.debugActionSet"</code>).
- */
- public static final String DEBUG_ACTION_SET= PLUGIN_ID + ".debugActionSet"; //$NON-NLS-1$
-
-
- /**
- * Launch action set identifier (value <code>"org.eclipse.debug.ui.launchActionSet"</code>).
- */
- public static final String LAUNCH_ACTION_SET= PLUGIN_ID + ".launchActionSet"; //$NON-NLS-1$
-
- // extensions
- /**
- * Identifier for the standard 'debug' launch group.
- * @since 2.1
- */
- public static final String ID_DEBUG_LAUNCH_GROUP = PLUGIN_ID + ".launchGroup.debug"; //$NON-NLS-1$
-
- /**
- * Identifier for the standard 'run' launch group.
- * @since 2.1
- */
- public static final String ID_RUN_LAUNCH_GROUP = PLUGIN_ID + ".launchGroup.run"; //$NON-NLS-1$
-
- /**
- * Identifier for the standard 'profile' launch group.
- * @since 3.0
- */
- public static final String ID_PROFILE_LAUNCH_GROUP = PLUGIN_ID + ".launchGroup.profile"; //$NON-NLS-1$
-
- // menus
-
- /**
- * Identifier for an empty group preceding an
- * edit group in a menu (value <code>"emptyEditGroup"</code>).
- */
- public static final String EMPTY_EDIT_GROUP = "emptyEditGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an edit group in a menu (value <code>"editGroup"</code>).
- */
- public static final String EDIT_GROUP = "editGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * step group in a menu (value <code>"emptyStepGroup"</code>).
- */
- public static final String EMPTY_STEP_GROUP = "emptyStepGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step group in a menu or toolbar (value <code>"stepGroup"</code>).
- */
- public static final String STEP_GROUP = "stepGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step into group in a menu or toolbar (value <code>"stepIntoGroup"</code>).
- */
- public static final String STEP_INTO_GROUP = "stepIntoGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step over group in a menu or toolbar (value <code>"stepOverGroup"</code>).
- */
- public static final String STEP_OVER_GROUP = "stepOverGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step return group in a menu or toolbar (value <code>"stepReturnGroup"</code>).
- */
- public static final String STEP_RETURN_GROUP = "stepReturnGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * thread group in a menu (value <code>"emptyThreadGroup"</code>).
- */
- public static final String EMPTY_THREAD_GROUP = "emptyThreadGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a thread group in a menu or toolbar(value <code>"threadGroup"</code>).
- */
- public static final String THREAD_GROUP = "threadGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * launch group in a menu (value <code>"emptyLaunchGroup"</code>).
- */
- public static final String EMPTY_LAUNCH_GROUP = "emptyLaunchGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a launch group in a menu (value <code>"launchGroup"</code>).
- */
- public static final String LAUNCH_GROUP = "launchGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an output group in a menu (value
- * <code>"outputGroup"</code>).
- */
- public static final String OUTPUT_GROUP = "outputGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * variable group in a menu (value <code>"emptyVariableGroup"</code>).
- */
- public static final String EMPTY_VARIABLE_GROUP = "emptyVariableGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a variable group in a menu (value <code>"variableGroup"</code>).
- */
- public static final String VARIABLE_GROUP = "variableGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * navigation group in a menu (value <code>"emptyNavigationGroup"</code>).
- */
- public static final String EMPTY_NAVIGATION_GROUP = "emptyNavigationGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a navigation group in a menu (value <code>"navigationGroup"</code>).
- */
- public static final String NAVIGATION_GROUP = "navigationGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * breakpoint group in a menu (value <code>"emptyBreakpointGroup"</code>).
- */
- public static final String EMPTY_BREAKPOINT_GROUP = "emptyBreakpointGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a breakpoint group in a menu (value <code>"breakpointGroup"</code>).
- */
- public static final String BREAKPOINT_GROUP = "breakpointGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a "breakpoint group" group in a menu (value <code>"breakpointGroupGroup"</code>).
- *
- * @since 3.1
- */
- public static final String BREAKPOINT_GROUP_GROUP = "breakpointGroupGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding an
- * expression group in a menu (value <code>"emptyExpressionGroup"</code>).
- *
- * @since 2.0
- */
- public static final String EMPTY_EXPRESSION_GROUP = "emptyExpressionGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an expression group in a menu (value <code>"expressionGroup"</code>).
- *
- * @since 2.0
- */
- public static final String EXPRESSION_GROUP = "expressionGroup"; //$NON-NLS-1$
- /**
- * Identifier for an empty group preceding a
- * render group in a menu (value <code>"emptyRenderGroup"</code>).
- */
- public static final String EMPTY_RENDER_GROUP = "emptyRenderGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a render group in a menu or toolbar(value <code>"renderGroup"</code>).
- */
- public static final String RENDER_GROUP = "renderGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a property group in a menu (value <code>"propertyGroup"</code>).
- */
- public static final String PROPERTY_GROUP = "propertyGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * register group in a menu (value <code>"emptyRegisterGroup"</code>).
- */
- public static final String EMPTY_REGISTER_GROUP = "emptyRegisterGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a register group in a menu (value <code>"registerGroup"</code>).
- */
- public static final String REGISTER_GROUP = "registerGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * modules group in a menu (value <code>"emptyModulesGroup"</code>).
- * @since 3.4
- */
- public static final String EMPTY_MODULES_GROUP = "emptyModulesGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a modules group in a menu (value <code>"modulesGroup"</code>).
- * @since 3.4
- */
- public static final String MODULES_GROUP = "modulesGroup"; //$NON-NLS-1$
-
- /**
- * Id for the popup menu associated with the variables (tree viewer) part of the VariableView
- */
- public static final String VARIABLE_VIEW_VARIABLE_ID = "org.eclipse.debug.ui.VariableView.variables"; //$NON-NLS-1$
-
- /**
- * Id for the popup menu associated with the detail (text viewer) part of the VariableView
- */
- public static final String VARIABLE_VIEW_DETAIL_ID = "org.eclipse.debug.ui.VariableView.detail"; //$NON-NLS-1$
-
- // status codes
- /**
- * Status indicating an invalid extension definition.
- */
- public static final int STATUS_INVALID_EXTENSION_DEFINITION = 100;
-
- /**
- * Status code indicating an unexpected internal error.
- */
- public static final int INTERNAL_ERROR = 120;
-
- // launch configuration attribute keys
- /**
- * Launch configuration attribute - the perspective to
- * switch to when a launch configuration is launched in
- * run mode (value <code>org.eclipse.debug.ui.target_run_perspective</code>).
- * Value is a string corresponding to a perspective identifier,
- * or <code>null</code> indicating no perspective change.
- *
- * @since 2.0
- * @deprecated Since 3.0, this launch configuration attribute is no longer supported.
- * Use <code>DebugUITools.setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective)</code>.
- */
- public static final String ATTR_TARGET_RUN_PERSPECTIVE = PLUGIN_ID + ".target_run_perspective"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - the perspective to
- * switch to when a launch configuration is launched in
- * debug mode (value <code>org.eclipse.debug.ui.target_debug_perspective</code>).
- * Value is a string corresponding to a perspective identifier,
- * or <code>null</code> indicating no perspective change.
- *
- * @since 2.0
- * @deprecated Since 3.0, this launch configuration attribute is no longer supported.
- * Use <code>DebugUITools.setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective)</code>.
- */
- public static final String ATTR_TARGET_DEBUG_PERSPECTIVE = PLUGIN_ID + ".target_debug_perspective"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - the container where the configuration file
- * is stored. The container is set via the 'setContainer()' call on ILaunchConfigurationWorkingCopy.
- * This constant is only needed for persisting and reading the default value of the
- * container value for individual resources.
- *
- * @since 2.0
- */
- public static final String ATTR_CONTAINER = PLUGIN_ID + ".container"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a boolean value that indicates if the launch configuration
- * is 'private'. A private configuration is one that does not appear to the user in the launch
- * history or the launch configuration dialog.
- *
- * @since 2.0
- */
- public static final String ATTR_PRIVATE = ILaunchManager.ATTR_PRIVATE;
-
- /**
- * Launch configuration attribute - a boolean value that indicates if the launch configuration
- * is displayed in the debug favorites menu. Default value is
- * <code>false</code> if absent.
- *
- * @since 2.0
- * @deprecated use <code>ATTR_FAVORITE_GROUPS</code> instead
- */
- public static final String ATTR_DEBUG_FAVORITE = PLUGIN_ID + ".debugFavorite"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a boolean value that indicates if the launch configuration
- * is displayed in the run favorites menu.Default value is
- * <code>false</code> if absent.
- *
- * @since 2.0
- * @deprecated use <code>ATTR_FAVORITE_GROUPS</code> instead
- */
- public static final String ATTR_RUN_FAVORITE = PLUGIN_ID + ".runFavorite"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a list of launch group identifiers
- * representing the favorite histories a launch configuration should appear
- * in. When <code>null</code>, the configuration does not appear in any
- * favorite lists.
- *
- * @since 2.1
- */
- public static final String ATTR_FAVORITE_GROUPS = PLUGIN_ID + ".favoriteGroups"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a boolean value indicating whether a
- * configuration should be launched in the background. Default value is <code>true</code>.
- *
- * @since 3.0
- */
- public static final String ATTR_LAUNCH_IN_BACKGROUND = PLUGIN_ID + ".ATTR_LAUNCH_IN_BACKGROUND"; //$NON-NLS-1$
-
- /**
- * ProcessConsole attribute - references the process that was launched.
- *
- * @since 3.1
- */
- public static final String ATTR_CONSOLE_PROCESS = PLUGIN_ID + ".ATTR_CONSOLE_PROCESS"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute specifying the encoding that the console should use.
- * When unspecified, the default encoding is used. Encoding names are available
- * from {@link org.eclipse.ui.WorkbenchEncoding}.
- *
- * @since 3.1
- * @deprecated in 3.3 Please use DebugPlugin.ATTR_CONSOLE_ENCODING instead.
- */
- public static final String ATTR_CONSOLE_ENCODING = DebugPlugin.ATTR_CONSOLE_ENCODING;
-
- /**
- * Launch configuration boolean attribute specifying whether output from the launched process will
- * be captured and written to the console. Default value is <code>true</code>.
- *
- * @since 3.1
- */
- public static final String ATTR_CAPTURE_IN_CONSOLE = PLUGIN_ID + ".ATTR_CONSOLE_OUTPUT_ON"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute specifying a file name that console output should
- * be written to or <code>null</code> if none. Default value is <code>null</code>.
- * When specified, all output from the launched process will be written to the file.
- * The file name attribute may contain variables which will be resolved by the
- * {@link org.eclipse.core.variables.IStringVariableManager}.
- *
- * @since 3.1
- */
- public static final String ATTR_CAPTURE_IN_FILE = PLUGIN_ID + ".ATTR_CAPTURE_IN_FILE"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute specifying whether process output will be appended to the
- * file specified by the <code>ATTR_CAPTURE_IN_FILE</code> attribute instead of overwriting
- * the file. Default value is <code>false</code>.
- *
- * @since 3.1
- */
- public static final String ATTR_APPEND_TO_FILE = PLUGIN_ID + ".ATTR_APPEND_TO_FILE"; //$NON-NLS-1$
-
- // Extension points
-
- /**
- * Debug model presentation simple extension point identifier (value <code>"debugModelPresentations"</code>).
- */
- public static final String ID_DEBUG_MODEL_PRESENTATION= "debugModelPresentations"; //$NON-NLS-1$
-
- /**
- * Debug action groups extension point identifier
- * (value <code>"debugActionGroups"</code>).
- *
- * @since 2.0
- * @deprecated The Debug Action Groups extension point no longer exists. Product
- * vendors should use Activities instead.
- */
- public static final String EXTENSION_POINT_DEBUG_ACTION_GROUPS= "debugActionGroups"; //$NON-NLS-1$
-
- /**
- * Launch configuration tab groups extension point identifier
- * (value <code>"launchConfigurationTabGroups"</code>).
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS= "launchConfigurationTabGroups"; //$NON-NLS-1$
-
- /**
- * Contributed Launch Configuration Tab extension point identifier
- * (value <code>"launchConfigurationTabs"</code>).
- *
- * @since 3.3
- */
- public static final String EXTENSION_POINT_LAUNCH_TABS = "launchConfigurationTabs"; //$NON-NLS-1$
-
- /**
- * Launch shortcuts extension point identifier
- * (value <code>"launchShortcuts"</code>).
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_SHORTCUTS= "launchShortcuts"; //$NON-NLS-1$
-
- /**
- * Extension point for launch configuration type images.
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES = "launchConfigurationTypeImages"; //$NON-NLS-1$
-
- /**
- * Console document color provider extension point identifier
- * (value <code>"consoleColorProviders"</code>).
- *
- * @since 2.1
- */
- public static final String EXTENSION_POINT_CONSOLE_COLOR_PROVIDERS = "consoleColorProviders"; //$NON-NLS-1$
-
- /**
- * Launch groups extension point identifier (value
- * <code>"launchGroups"</code>).
- *
- * @since 2.1
- */
- public static final String EXTENSION_POINT_LAUNCH_GROUPS = "launchGroups"; //$NON-NLS-1$
-
- /**
- * Console line trackers extension point identifier (value
- * <code>"consoleLineTrackers"</code>).
- *
- * @since 2.1
- */
- public static final String EXTENSION_POINT_CONSOLE_LINE_TRACKERS = "consoleLineTrackers"; //$NON-NLS-1$
-
- /**
- * Variables content providers extension point identifier (value
- * <code>"variablesContentProviders"</code>).
- *
- * @since 3.0
- */
- public static final String EXTENSION_POINT_OBJECT_BROWSERS = "objectBrowsers"; //$NON-NLS-1$
-
- /**
- * Launch variable components extension point identifier (value
- * <code>"launchVariableComponents"</code>). The launch variable
- * components extension point specifies an <code>IVariableComponent</code>
- * for an <code>IContextLaunchVariable</code>.
- */
- public static final String EXTENSION_POINT_LAUNCH_VARIABLE_COMPONENTS = "launchVariableComponents"; //$NON-NLS-1$
-
- /**
- * Variable value editors extension point identifier (value
- * <code>"variableValueEditors"</code>
- *
- * @since 3.1
- */
- public static final String EXTENSION_POINT_VARIABLE_VALUE_EDITORS = "variableValueEditors"; //$NON-NLS-1$
-
- /**
- * Memory renderings extension point identifier (value
- * <code>"memoryRenderings"</code>
- *
- * @since 3.1
- * @deprecated As of release 3.4, replaced by {@link #EXTENSION_POINT_MEMORY_RENDERINGS}
- */
- public static final String EXTENSION_POINT_MEMORY_RENDERIGNS = "memoryRenderings"; //$NON-NLS-1$
-
- /**
- * Memory renderings extension point identifier (value
- * <code>"memoryRenderings"</code>
- *
- * @since 3.4
- */
- public static final String EXTENSION_POINT_MEMORY_RENDERINGS = "memoryRenderings"; //$NON-NLS-1$
-
- /**
- * Breakpoint organizers extension point identifier (value
- * <code>"breakpointOrganizers"</code>
- *
- * @since 3.1
- */
- public static final String EXTENSION_POINT_BREAKPOINT_ORGANIZERS = "breakpointOrganizers"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"detailPaneFactories"</code>) for the
- * detail pane factories extension point.
- *
- * @since 3.3
- */
- public static final String EXTENSION_POINT_DETAIL_FACTORIES = "detailPaneFactories"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"toggleBreakpointsTargetFactories"</code>) for the
- * toggle breakpoint targets extension point.
- *
- * @since 3.5
- */
- public static final String EXTENSION_POINT_TOGGLE_BREAKPOINTS_TARGET_FACTORIES = "toggleBreakpointsTargetFactories"; //$NON-NLS-1$
-
- /**
- * Update policies extension point identifier (value
- * <code>"updatePolicies"</code>
- *
- * @since 3.2
- */
- public static final String EXTENSION_POINT_UPDATE_POLICIES = "updatePolicies"; //$NON-NLS-1$
-
- /**
- * Padded string preference for renderings. Padded string is the string to be used in place of
- * of a memory byte if a rendering cannot render the data properly.
- * @since 3.1
- */
- public static final String PREF_PADDED_STR = PLUGIN_ID + ".memory.paddedStr"; //$NON-NLS-1$
-
- /**
- * ASCII code page for rendering memory to ASCII strings.
- * @since 3.1
- */
- public static final String PREF_DEFAULT_ASCII_CODE_PAGE = PLUGIN_ID + ".defaultAsciiCodePage"; //$NON-NLS-1$
-
- /**
- * EBCDIC code page for rendering memory to EBCDIC strings.
- * @since 3.1
- */
- public static final String PREF_DEFAULT_EBCDIC_CODE_PAGE = PLUGIN_ID + ".defaultEbcdicCodePage"; //$NON-NLS-1$
-
- /**
- * Maximum number of characters to display in the details area of the variables
- * view, or 0 if unlimited.
- *
- * @since 3.2
- */
- public static final String PREF_MAX_DETAIL_LENGTH = PLUGIN_ID + ".max_detail_length"; //$NON-NLS-1$
-
- /**
- * Identifier for breakpoint working set type.
- * <br>
- * Value is: <code>org.eclipse.debug.ui.breakpointWorkingSet</code>
- *
- * @since 3.2
- */
- public static final String BREAKPOINT_WORKINGSET_ID = "org.eclipse.debug.ui.breakpointWorkingSet"; //$NON-NLS-1$
-
- /**
- * Memory view identifier (value <code>"org.eclipse.debug.ui.MemoryView"</code>).
- *
- * @since 3.2
- */
- public static String ID_MEMORY_VIEW = "org.eclipse.debug.ui.MemoryView"; //$NON-NLS-1$
-
- /**
- * Memory view's rendering view pane identifier for the rendering view pane
- * on the left. (value <code>"org.eclipse.debug.ui.MemoryView.RenderingViewPane.1"</code>).
- *
- * @since 3.2
- */
- public static String ID_RENDERING_VIEW_PANE_1 = "org.eclipse.debug.ui.MemoryView.RenderingViewPane.1"; //$NON-NLS-1$
-
- /**
- * Memory view's rendering view pane identifier for the rendering view pane
- * on the right. (value <code>"org.eclipse.debug.ui.MemoryView.RenderingViewPane.2"</code>).
- *
- * @since 3.2
- */
- public static String ID_RENDERING_VIEW_PANE_2 = "org.eclipse.debug.ui.MemoryView.RenderingViewPane.2"; //$NON-NLS-1$
-
- /**
- * Preference color to indicate that a <code>MemoryByte</code> does not have history.
- * (value <code> org.eclipse.debug.ui.MemoryHistoryUnknownColor </code>)
- *
- * @since 3.2
- */
- public static final String PREF_MEMORY_HISTORY_UNKNOWN_COLOR = PLUGIN_ID + ".MemoryHistoryUnknownColor"; //$NON-NLS-1$
-
- /**
- * Preference color to indicate that a <code>MemoryByte</code> has history.
- * (value <code> org.eclipse.debug.ui.MemoryHistoryKnownColor </code>)
- *
- * @since 3.2
- */
- public static final String PREF_MEMORY_HISTORY_KNOWN_COLOR = PLUGIN_ID + ".MemoryHistoryKnownColor"; //$NON-NLS-1$
-
- /**
- * Annotation type identifier for default annotation of the current instruction
- * pointer (top stack frame in a thread). Value is <code>org.eclipse.debug.ui.currentIP</code>,
- * identifying a <code>org.eclipse.ui.editors.markerAnnotationSpecification</code>
- * extension.
- *
- * @since 3.2
- */
- public static final String ANNOTATION_TYPE_INSTRUCTION_POINTER_CURRENT = "org.eclipse.debug.ui.currentIP"; //$NON-NLS-1$
-
- /**
- * Annotation type identifier for default annotation of secondary instruction pointers
- * (non top stack frames). Value is <code>org.eclipse.debug.ui.secondaryIP</code>,
- * identifying a <code>org.eclipse.ui.editors.markerAnnotationSpecification</code>
- * extension.
- *
- * @since 3.2
- */
- public static final String ANNOTATION_TYPE_INSTRUCTION_POINTER_SECONDARY = "org.eclipse.debug.ui.secondaryIP"; //$NON-NLS-1$
-
- /**
- * Editor Identifier for the "Common Source Not Found" editor.
- * Value is <code>org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor</code>
- *
- * @since 3.2
- */
- public static final String ID_COMMON_SOURCE_NOT_FOUND_EDITOR="org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor"; //$NON-NLS-1$
-
- /**
- * Preference color used to render debug elements that have changed
- * (value <code>org.eclipse.debug.ui.changedDebugElement</code>).
- * For example, when a variable value changes, variables are rendered in this
- * color.
- *
- * @since 3.2
- * @see DebugUITools
- */
- public static final String PREF_CHANGED_DEBUG_ELEMENT_COLOR= "org.eclipse.debug.ui.changedDebugElement"; //$NON-NLS-1$
-
-
- /**
- * Preference for background color in tree columns when a value changes color.
- *
- * @since 3.5
- * @see DebugUITools
- */
- public static final String PREF_CHANGED_VALUE_BACKGROUND = PLUGIN_ID + ".PREF_CHANGED_VALUE_BACKGROUND"; //$NON-NLS-1$
-
-
- /**
- * The name of the font to use for the variable text in the variables, registers and expression views.
- * This font is managed via the workbench font preference page.
- *
- * @since 3.5
- */
- public static final String PREF_VARIABLE_TEXT_FONT= "org.eclipse.debug.ui.VariableTextFont"; //$NON-NLS-1$
-
- /**
- * The name of the font to use for detail panes. This font is managed via
- * the workbench font preference page.
- *
- * @since 3.5
- */
- public static final String PREF_DETAIL_PANE_FONT= "org.eclipse.debug.ui.DetailPaneFont"; //$NON-NLS-1$
-
- /**
- * Instruction pointer image for editor ruler for the currently executing
- * instruction in the top stack frame.
- *
- * @since 3.2
- */
- public static final String IMG_OBJS_INSTRUCTION_POINTER_TOP = "IMG_OBJS_INSTRUCTION_POINTER_TOP"; //$NON-NLS-1$
-
- /**
- * Instruction pointer image for editor ruler for secondary (non-top) stack frames.
- *
- * @since 3.2
- */
- public static final String IMG_OBJS_INSTRUCTION_POINTER = "IMG_OBJS_INSTRUCTION_POINTER"; //$NON-NLS-1$
-
- /**
- * A key for a system property that indicates whether there are toggle
- * breakpoint factories registered in this installation. This can be used
- * to trigger the UI to include menus related to breakpoint types.
- *
- * @since 3.5
- */
- public static final String SYS_PROP_BREAKPOINT_TOGGLE_FACTORIES_USED = "org.eclipse.debug.ui.breakpoints.toggleFactoriesUsed"; //$NON-NLS-1$
-
- /**
- * Name of the debug context variable which can be used in standard
- * expressions and command handlers to access the active debug context.
- *
- * @since 3.5
- */
- public static final String DEBUG_CONTEXT_SOURCE_NAME = "debugContext"; //$NON-NLS-1$
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
deleted file mode 100644
index da04b4d78..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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 org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Common function for debug views. Provides access to the underlying viewer and
- * debug model presentation being used by a viewer. This allows clients to do
- * such things as add and remove filters to a viewer, and configure a debug
- * model presentation.
- * <p>
- * Clients may implement this interface. Generally, clients should subclass
- * <code>AbstractDebugView</code> when creating a new debug view.
- * </p>
- * @see org.eclipse.core.runtime.IAdaptable
- * @see org.eclipse.debug.ui.IDebugModelPresentation
- * @see org.eclipse.debug.ui.AbstractDebugView
- * @since 2.0
- */
-
-public interface IDebugView extends IViewPart {
-
- /**
- * Action id for a view's copy action. Any view
- * with a copy action that should be invoked when
- * CTRL+C is pressed should store their
- * copy action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String COPY_ACTION = ActionFactory.COPY.getId();
-
- /**
- * Action id for a view's cut action. Any view
- * with a cut action that should be invoked when
- * CTRL+X is pressed should store their
- * cut action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String CUT_ACTION = ActionFactory.CUT.getId();
-
- /**
- * Action id for a view's double-click action. Any view
- * with an action that should be invoked when
- * the mouse is double-clicked should store their
- * double-click action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String DOUBLE_CLICK_ACTION = "Double_Click_ActionId"; //$NON-NLS-1$
-
- /**
- * Action id for a view's find action. Any view
- * with a find action that should be invoked when
- * CTRL+F is pressed should store their
- * find action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String FIND_ACTION = ActionFactory.FIND.getId();
-
- /**
- * Action id for a view's paste action. Any view
- * with a paste action that should be invoked when
- * CTRL+V is pressed should store their
- * paste action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String PASTE_ACTION = ActionFactory.PASTE.getId();
-
- /**
- * Action id for a view's remove action. Any view
- * with a remove action that should be invoked when
- * the delete key is pressed should store their
- * remove action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String REMOVE_ACTION = "Remove_ActionId"; //$NON-NLS-1$
-
- /**
- * Action id for a view's select all action. Any view
- * with a select all action that should be invoked when
- * CTRL+A is pressed should store their
- * select all action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String SELECT_ALL_ACTION = ActionFactory.SELECT_ALL.getId();
-
- /**
- * Returns the viewer contained in this debug view.
- *
- * @return viewer
- */
- public Viewer getViewer();
-
- /**
- * Returns the debug model presentation for this view specified
- * by the debug model identifier.
- *
- * @param id the debug model identifier that corresponds to the <code>id</code>
- * attribute of a debug model presentation extension
- * @return the debug model presentation, or <code>null</code> if no
- * presentation is registered for the specified id
- */
- public IDebugModelPresentation getPresentation(String id);
-
- /**
- * Installs the given action under the given action id.
- *
- * If the action has an id that maps to one of the global
- * action ids defined by this interface, the action is registered
- * as a global action handler.
- *
- * If the action is an instance of <code>IUpdate</code> it is added/remove
- * from the collection of updateables associated with this view.
- *
- * @param actionID the action id
- * @param action the action, or <code>null</code> to clear it
- * @see #getAction
- */
- public void setAction(String actionID, IAction action);
-
- /**
- * Adds the given IUpdate to this view's collection of updatable
- * objects. Allows the view to periodically update these registered
- * objects.
- * Has no effect if an identical IUpdate is already registered.
- *
- * @param updatable The IUpdate instance to be added
- */
- public void add(IUpdate updatable);
-
- /**
- * Removes the given IUpdate from this view's collection of updatable
- * objects.
- * Has no effect if an identical IUpdate was not already registered.
- *
- * @param updatable The IUpdate instance to be removed
- */
- public void remove(IUpdate updatable);
-
- /**
- * Returns the action installed under the given action id.
- *
- * @param actionID the action id
- * @return the action, or <code>null</code> if none
- * @see #setAction
- */
- public IAction getAction(String actionID);
-
- /**
- * Returns the context menu manager for this view.
- *
- * @return the context menu manager for this view, or <code>null</code> if none
- * @deprecated See AbstractDebugView#getContextMenuManagers()
- */
- public IMenuManager getContextMenuManager();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane.java
deleted file mode 100644
index 9dc2c84c9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 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
- * Wind River - Anton Leherbauer - Fix selection provider (Bug 254442)
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbenchPartSite;
-
-/**
- * A detail pane is created from a detail pane factory and displays detailed information about
- * a current selection with an SWT <code>Control</code>. Use the
- * <code>org.eclipse.debug.ui.detailFactories</code> extension point to contribute a detail pane
- * factory.
- * <p>
- * Implementors should implement {@link IDetailPane2} in favor of this interface.
- * </p>
- * @see IDetailPaneFactory
- * @see IDetailPane2
- * @since 3.3
- */
-public interface IDetailPane {
-
- /**
- * Initializes this detail pane for the given workbench part site. This is the first method
- * invoked on a detail pane after instantiation. If this detail pane is being added to a
- * non-view component such as a dialog, the passed workbench part site will be <code>null</code>.
- *
- * @param partSite The workbench part site that this detail pane has been created in or <code>null</code>
- */
- public void init(IWorkbenchPartSite partSite);
-
- /**
- * Creates and returns the main control for this detail pane using the given composite as a
- * parent.
- *
- * @param parent The parent composite that UI components should be added to
- * @return The main control for this detail pane
- */
- public Control createControl(Composite parent);
-
- /**
- * Disposes this detail pane. This is the last method invoked on a detail pane and should
- * dispose of all UI components including the main composite returned in <code>createControl()</code>.
- */
- public void dispose();
-
- /**
- * Displays details for the given selection, possible <code>null</code>. An empty selection
- * or <code>null</code> should clear this detail pane.
- *
- * @param selection The selection to be displayed, possibly empty or <code>null</code>
- */
- public void display(IStructuredSelection selection);
-
- /**
- * Allows this detail pane to give focus to an appropriate control, and returns whether
- * the detail pane accepted focus. If this detail pane does not want focus, it should
- * return <code>false</code>, allowing the containing view to choose another target
- * for focus.
- *
- * @return whether focus was taken
- */
- public boolean setFocus();
-
- /**
- * Returns a unique identifier for this detail pane.
- *
- * @return A unique identifier for this detail pane
- */
- public String getID();
-
- /**
- * The human readable name of this detail pane. This is a short description of the type
- * of details this pane displays that appears in the context menu.
- *
- * @return name of this detail pane
- */
- public String getName();
-
- /**
- * A brief description of this detail pane, or <code>null</code> if none
- *
- * @return a description of this detail pane, or <code>null</code> if none
- */
- public String getDescription();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane2.java
deleted file mode 100644
index 1a6fb5109..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane2.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems, Inc. 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-
-/**
- * An extension to the detail pane interface which allows implementors to
- * provide a selection provider instead of setting the selection provider of the
- * view's {@link org.eclipse.ui.IWorkbenchPartSite site} directly.
- * <p>
- * Clients may implement this interface.
- * </p>
- *
- * @since 3.5
- */
-public interface IDetailPane2 extends IDetailPane {
-
- /**
- * Request the selection provider of this detail pane.
- * <p>
- * This method is called on every focus change of the <code>Control</code>
- * returned by {@link #createControl(org.eclipse.swt.widgets.Composite)
- * createControl(Composite)}.
- * </p>
- *
- * @return the selection provider of this detail pane or <code>null</code>
- */
- public ISelectionProvider getSelectionProvider();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java
deleted file mode 100644
index 2dbfdfbdd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.jface.viewers.IStructuredSelection;
-
-/**
- * A detail pane factory creates one or more types of detail panes.
- * <p>
- * Detail pane factories are contributed via the <code>org.eclipse.debug.ui.detailPaneFactories</code>
- * extension point. Following is an example of a detail pane factory extension:
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.detailPaneFactories"&gt;
- * &lt;detailFactories
- * class="org.eclipse.temp.TableDetailPaneFactory"
- * name="Table Detail Factory"&gt;
- * &lt;/detailFactories&gt;
- * &lt;/extension&gt;
- * </pre>
- * </p>
- * <p>
- * <p>
- * Clients contributing a detail pane factory are intended to implement this interface.
- * @see IDetailPane
- * @since 3.3
- *
- */
-public interface IDetailPaneFactory {
-
- /**
- * Returns all possible types detail panes that this factory can
- * create for the given selection, possibly empty. Detail panes are returned
- * as a set of detail pane identifiers.
- *
- * @param selection The current selection
- * @return Set of String IDs for possible detail pane types, possibly empty
- */
- public Set getDetailPaneTypes(IStructuredSelection selection);
-
- /**
- * Returns the identifier of the default detail pane type to use for the given
- * selection, or <code>null</code> if this factory has no preference.
- * A factory can override the platform's default detail pane by returning
- * a non-<code>null</code> value.
- *
- * @param selection The current selection
- * @return a detail pane type identifier or <code>null</code>
- */
- public String getDefaultDetailPane(IStructuredSelection selection);
-
- /**
- * Creates and returns a detail pane corresponding to the given detail pane
- * type identifier that this factory can produce (according to
- * <code>getDetailPaneTypes(IStructuredSelection selection)</code>).
- *
- * @param paneID The id of the detain pane type to be created
- * @return detail pane or <code>null</code> if one could not be created
- */
- public IDetailPane createDetailPane(String paneID);
-
- /**
- * Returns a name for the detail pane type associated with the given ID
- * or <code>null</code> if none. Used to
- * populate the context menu with meaningful names of the pane types.
- *
- * @param paneID detail pane type identifier
- * @return detail pane name or <code>null</code> if none
- */
- public String getDetailPaneName(String paneID);
-
- /**
- * Returns a description for the detail pane type associated with the given ID
- * or <code>null</code> if none.
- *
- * @param paneID detail pane type identifier
- * @return detail pane description or <code>null</code> if none
- */
- public String getDetailPaneDescription(String paneID);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java
deleted file mode 100644
index 3b90b387c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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 org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A debug model presentation may implement this interface to override
- * standard annotations used to display instruction pointers for stack frames.
- * <p>
- * A client has several options when overriding default instruction pointer
- * annotations, and the debug platform uses the following prioritized order
- * when computing an annotation for a stack frame.
- * <ol>
- * <li>Specify the annotation object to use. This is done by returning a non-<code>null</code>
- * value from <code>getInstructionPointerAnnotation(..)</code>.</li>
- * <li>Specify an <code>annotationType</code> extension to use.
- * This is done by returning a non-<code>null</code> value from
- * <code>getInstructionPointerAnnotationType(..)</code>. When specified, the annotation
- * type controls the image displayed via its associated
- * <code>markerAnnotationSpecification</code>.</li>
- * <li>Specify the image to use. This is done by returning a non-<code>null</code>
- * value from <code>getInstructionPointerImage(..)</code>.</li>
- * </ol>
- * Additionally, when specifying an annotation type or image the text
- * for the instruction pointer may be specified by returning a non-<code>null</code>
- * value from <code>getInstructionPointerText(..)</code>.
- * </p>
- * <p>
- * These methods are called when the debugger has opened an editor to display
- * source for the given stack frame. The image will be positioned based on stack frame
- * line number and character ranges.
- * </p>
- * <p>
- * By default, the debug platform uses different annotations for top stack
- * frames and non-top stack frames in a thread. The default platform annotations
- * are contributed as <code>annotationType</code> extensions with
- * the identifiers <code>IDebugUIConstants.ANNOTATION_INSTRUCTION_POINTER_CURRENT</code>
- * and <code>IDebugUIConstants.ANNOTAION_INSTRUCTION_POINTER_SECONDARY</code>.
- * </p>
- * <p>
- * Clients implementing a debug model presentation may also implement this interface.
- * </p>
- * @since 3.2
- */
-public interface IInstructionPointerPresentation extends IDebugModelPresentation {
- /**
- * Returns an annotation used for the specified stack frame in the specified
- * editor, or <code>null</code> if a default annotation should be used.
- *
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- * @return annotation or <code>null</code>
- */
- public Annotation getInstructionPointerAnnotation(IEditorPart editorPart, IStackFrame frame);
-
- /**
- * Returns an identifier of a <code>org.eclipse.ui.editors.annotationTypes</code> extension used for
- * the specified stack frame in the specified editor, or <code>null</code> if a default annotation
- * should be used.
- *
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- * @return annotation type identifier or <code>null</code>
- */
- public String getInstructionPointerAnnotationType(IEditorPart editorPart, IStackFrame frame);
-
- /**
- * Returns the instruction pointer image used for the specified stack frame in the specified
- * editor, or <code>null</code> if a default image should be used.
- * <p>
- * By default, the debug platform uses different images for top stack
- * frames and non-top stack frames in a thread.
- * </p>
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- * @return image or <code>null</code>
- */
- public Image getInstructionPointerImage(IEditorPart editorPart, IStackFrame frame);
-
- /**
- * Returns the text to associate with the instruction pointer annotation used for the
- * specified stack frame in the specified editor, or <code>null</code> if a default
- * message should be used.
- * <p>
- * By default, the debug platform uses different images for top stack
- * frames and non-top stack frames in a thread.
- * </p>
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- * @return message or <code>null</code>
- */
- public String getInstructionPointerText(IEditorPart editorPart, IStackFrame frame);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
deleted file mode 100644
index e7eb3522c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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 org.eclipse.jface.operation.IRunnableContext;
-
-
- /**
- * A launch configuration dialog is used to edit and launch
- * launch configurations. It contains a launch configuration
- * tab group.
- * @see ILaunchConfigurationTabGroup
- * @see ILaunchConfigurationTab
- * @since 2.0
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-
-public interface ILaunchConfigurationDialog extends IRunnableContext {
-
- /**
- * Return value from <code>open()</code> method of a
- * launch configuration dialog when a launch completed
- * successfully with a single click (without opening a
- * launch configuration dialog).
- *
- * @deprecated the launch dialog no longer supports launching without
- * opening - this constant will never be returned by the dialog
- */
- public static final int LAUNCHED_BEFORE_OPENING = 2;
-
- /**
- * Adjusts the enable state of this dialog's buttons
- * to reflect the state of the active tab group.
- * <p>
- * This may be called by to force a button state
- * update.
- * </p>
- */
- public void updateButtons();
-
- /**
- * Updates the message (or error message) shown in the message line to
- * reflect the state of the currently active tab in this launch
- * configuration dialog.
- * <p>
- * This method may be called to force a message
- * update.
- * </p>
- */
- public void updateMessage();
-
- /**
- * Sets the contents of the name field to the given name.
- *
- * @param name new name value
- */
- public void setName(String name);
-
- /**
- * Returns a unique launch configuration name, using the given name
- * as a seed.
- *
- * @param name seed from which to generate a new unique name
- */
- public String generateName(String name);
-
- /**
- * Returns the tabs currently being displayed, or
- * <code>null</code> if none.
- *
- * @return currently displayed tabs, or <code>null</code>
- */
- public ILaunchConfigurationTab[] getTabs();
-
- /**
- * Returns the currently active <code>ILaunchConfigurationTab</code>
- * being displayed, or <code>null</code> if there is none.
- *
- * @return currently active <code>ILaunchConfigurationTab</code>, or <code>null</code>.
- */
- public ILaunchConfigurationTab getActiveTab();
-
- /**
- * Returns the mode in which this dialog was opened -
- * run or debug.
- *
- * @return one of <code>RUN_MODE</code> or <code>DEBUG_MODE</code> defined in <code>ILaunchManager</code>
- * @see org.eclipse.debug.core.ILaunchManager
- */
- public String getMode();
-
- /**
- * Sets the displayed tab to the given tab. Has no effect if the specified
- * tab is not one of the tabs being displayed in the dialog currently.
- *
- * @param tab the tab to display/activate
- * @since 2.1
- */
- public void setActiveTab(ILaunchConfigurationTab tab);
-
- /**
- * Sets the displayed tab to the tab with the given index. Has no effect if
- * the specified index is not within the limits of the tabs returned by
- * <code>getTabs()</code>.
- *
- * @param index the index of the tab to display
- * @since 2.1
- */
- public void setActiveTab(int index);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
deleted file mode 100644
index e7256f5bc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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 org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A launch configuration tab is used to edit/view attributes
- * of a specific type of launch configuration. Launch
- * configurations are presented in a dialog, with a tab folder.
- * Each tab manipulates one ore more attributes of a launch
- * configuration.
- * <p>
- * A tab has the following lifecycle methods:
- * <ul>
- * <li><code>setLaunchConfigurationDialog(ILaunchConfigurationDialog)</code> -
- * this is the first method called on a tab after it is instantiated.</li>
- * <li><code>initializeFrom(ILaunchConfiguration)</code> - called when a
- * launch configuration is selected to be displayed.</li>
- * <li><code>activated(ILaunchConfigurationWorkingCopy)</code> - called when
- * a tab is entered.</li>
- * <li><code>deactivated(ILaunchConfigurationWorkingCopy)</code> - called when
- * a tab is exited.</li>
- * <li><code>performApply(ILaunchConfigurationWorkingCopy)</code> - called when
- * a tab is to write its values to a launch configuration.</li>
- * <li><code>dispose()</code> - the last method called on a tab, when it is
- * to perform any required cleanup. Note that a tab can be disposed before its control
- * has been created.</li>
- * </ul>
- * The method <code>setDefaults(ILaunchConfigurationWorkingCopy)</code>
- * can be called before a tab's controls are created.
- * <p>
- * The launch tab framework was originally designed to handle inter tab
- * communication by applying attributes from the active tab to a launch configuration
- * being edited, when a tab is exited, and by initializing a tab when activated.
- * In 3.0, the addition of the methods <code>activated</code> and <code>deactivated</code>
- * allow tabs to determine the appropriate course of action. The default implementation
- * in <code>AbstractLaunchConfigurationTab</code> is to call the old methods
- * (<code>initializeFrom</code> and <code>performApply</code>). Tabs should override
- * the new methods as required.
- * </p>
- * <p>
- * This interface is intended to be implemented by clients.
- * </p>
- * @see org.eclipse.debug.core.ILaunchConfigurationType
- * @see org.eclipse.debug.core.ILaunchConfiguration
- * @since 2.0
- */
-public interface ILaunchConfigurationTab {
-
- /**
- * Creates the top level control for this launch configuration
- * tab under the given parent composite. This method is called once on
- * tab creation, after <code>setLaunchConfigurationDialog</code>
- * is called.
- * <p>
- * Implementors are responsible for ensuring that
- * the created control can be accessed via <code>getControl</code>
- * </p>
- *
- * @param parent the parent composite
- */
- public void createControl(Composite parent);
-
- /**
- * Returns the top level control for this tab.
- * <p>
- * May return <code>null</code> if the control
- * has not been created yet.
- * </p>
- *
- * @return the top level control or <code>null</code>
- */
- public Control getControl();
-
- /**
- * Initializes the given launch configuration with
- * default values for this tab. This method
- * is called when a new launch configuration is created
- * such that the configuration can be initialized with
- * meaningful values. This method may be called before this
- * tab's control is created.
- *
- * @param configuration launch configuration
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Initializes this tab's controls with values from the given
- * launch configuration. This method is called when
- * a configuration is selected to view or edit, after this
- * tab's control has been created.
- *
- * @param configuration launch configuration
- */
- public void initializeFrom(ILaunchConfiguration configuration);
-
- /**
- * Notifies this launch configuration tab that it has
- * been disposed. Marks the end of this tab's lifecycle,
- * allowing this tab to perform any cleanup required.
- */
- public void dispose();
-
- /**
- * Copies values from this tab into the given
- * launch configuration.
- *
- * @param configuration launch configuration
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Returns the current error message for this tab.
- * May be <code>null</code> to indicate no error message.
- * <p>
- * An error message should describe some error state,
- * as opposed to a message which may simply provide instruction
- * or information to the user.
- * </p>
- *
- * @return the error message, or <code>null</code> if none
- */
- public String getErrorMessage();
-
- /**
- * Returns the current message for this tab.
- * <p>
- * A message provides instruction or information to the
- * user, as opposed to an error message which should
- * describe some error state.
- * </p>
- *
- * @return the message, or <code>null</code> if none
- */
- public String getMessage();
-
- /**
- * Returns whether this tab is in a valid state in the context of the specified launch configuration.
- * <p>
- * This information is typically used by the launch configuration
- * dialog to decide when it is okay to launch.
- * </p>
- *
- * @param launchConfig launch configuration which provides context for validating this tab.
- * This value must not be <code>null</code>.
- *
- * @return whether this tab is in a valid state
- */
- public boolean isValid(ILaunchConfiguration launchConfig);
-
- /**
- * Returns whether this tab is in a state that allows the launch configuration whose values
- * this tab is showing to be saved. This differs from <code>isValid()</code> in that <code>canSave()</code>
- * determines if this tab prevents the current launch configuration from being saved, whereas
- * <code>isValid()</code> determines if this tab prevents the current launch configuration from
- * being launched.
- *
- * <p>
- * This information is typically used by the launch configuration
- * dialog to decide when it is okay to save a launch configuration.
- * </p>
- *
- * @return whether this tab is in a state that allows the current launch configuration to be saved
- */
- public boolean canSave();
-
- /**
- * Sets the launch configuration dialog that hosts this tab.
- * This is the first method called on a launch configuration
- * tab, and marks the beginning of this tab's lifecycle.
- *
- * @param dialog launch configuration dialog
- */
- public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog);
-
- /**
- * Notifies this tab that the specified configuration has been
- * launched, resulting in the given launch. This method can be
- * called when a tab's control does not exist, to support single-click
- * launching.
- *
- * @param launch the result of launching the current
- * launch configuration
- * @deprecated As of R3.0, this method is no longer called by the launch
- * framework. Since tabs do not exist when launching is performed elsewhere
- * than the launch dialog, this method cannot be relied upon for launching
- * functionality.
- */
- public void launched(ILaunch launch);
-
- /**
- * Returns the name of this tab.
- *
- * @return the name of this tab
- */
- public String getName();
-
- /**
- * Returns the image for this tab, or <code>null</code> if none
- *
- * @return the image for this tab, or <code>null</code> if none
- */
- public Image getImage();
-
- /**
- * Notification that this tab has become the active tab in the launch
- * configuration dialog.
- *
- * @param workingCopy the launch configuration being edited
- * @since 3.0
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy);
-
- /**
- * Notification that this tab is no longer the active tab in the launch
- * configuration dialog.
- *
- * @param workingCopy the launch configuration being edited
- * @since 3.0
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy);
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java
deleted file mode 100644
index 1f4f117a2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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 org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-/**
- * A launch configuration tab group is used to edit/view attributes
- * of a specific type of launch configuration. Launch
- * configurations are presented in a dialog, with a tab folder.
- * Each tab manipulates one or more attributes of a launch
- * configuration. The tab group controls which tabs are
- * displayed for a specific type of launch configuration,
- * and provides a mechanism for overriding configuration
- * initialization performed by tabs.
- * <p>
- * A tab group has the following lifecycle methods:
- * <ul>
- * <li><code>createTabs(ILaunchConfigurationDialog, String)</code> -
- * this is the first method called on a tab group after it is instantiated.</li>
- * <li><code>initializeFrom(ILaunchConfiguration)</code> - called when a
- * launch configuration is selected to be displayed.</li>
- * <li><code>performApply(ILaunchConfigurationWorkingCopy)</code> - called when
- * a tab group's values are to be written to a launch configuration.</li>
- * <li><code>dispose()</code> - the last method called on a tab group, when it is
- * to perform any required cleanup. Note that a tab can be disposed before its control
- * has been created.</li>
- * </ul>
- * The method <code>setDefaults(ILaunchConfigurationWorkingCopy)</code>
- * can be called before a tab's controls are created.
- * </p>
- * <p>
- * The launch tab framework was originally designed to handle inter tab
- * communication by applying attributes from the active tab to a launch configuration
- * being edited, when a tab is exited, and by initializing a tab when activated.
- * In 3.0, the addition of the methods <code>activated</code> and <code>deactivated</code>
- * allow tabs to determine the appropriate course of action. The default implementation
- * in <code>AbstractLaunchConfigurationTab</code> is to call the old methods
- * (<code>initializeFrom</code> and <code>performApply</code>). Tabs should override
- * the new methods as required.
- * </p>
- * <p>
- * A launch configuration group extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a launch configuration
- * group extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.launchConfigurationTabGroups"&gt;
- * &lt;launchConfigurationTabGroup
- * id="com.example.ExampleTabGroup"
- * type="com.example.ExampleLaunchConfigurationTypeIdentifier"
- * class="com.example.ExampleLaunchConfigurationTabGroupClass"&gt;
- * &lt;/launchConfigurationTabGroup&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies a unique identifier for this launch configuration
- * tab group.</li>
- * <li><code>type</code> specifies launch configuration type that this tab
- * group is applicable to (corresponds to the id of a launch configuration type
- * extension).</li>
- * <li><code>class</code> specifies a fully qualified name of a Java class
- * that implements <code>ILaunchConfigurationTabGroup</code>.</li>
- * </ul>
- * </p>
- * <p>
- * This interface is intended to be implemented by clients.
- * </p>
- * @see org.eclipse.debug.core.ILaunchConfigurationType
- * @see org.eclipse.debug.core.ILaunchConfiguration
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab
- * @since 2.0
- */
-public interface ILaunchConfigurationTabGroup {
-
- /**
- * Creates the tabs contained in this tab group for the specified
- * launch mode. The tabs control's are not created. This is the
- * fist method called in the lifecycle of a tab group.
- *
- * @param dialog the launch configuration dialog this tab group
- * is contained in
- * @param mode the mode the launch configuration dialog was
- * opened in
- */
- public void createTabs(ILaunchConfigurationDialog dialog, String mode);
-
- /**
- * Returns the tabs contained in this tab group.
- *
- * @return the tabs contained in this tab group
- */
- public ILaunchConfigurationTab[] getTabs();
-
- /**
- * Notifies this launch configuration tab group that it has
- * been disposed, and disposes this group's tabs. Marks the end
- * of this tab group's lifecycle, allowing this tab group to
- * perform any cleanup required.
- */
- public void dispose();
-
- /**
- * Initializes the given launch configuration with
- * default values for this tab group. This method
- * is called when a new launch configuration is created
- * such that the configuration can be initialized with
- * meaningful values. This method may be called before
- * tab controls are created.
- *
- * @param configuration launch configuration
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Initializes this group's tab controls with values from the given
- * launch configuration. This method is called when
- * a configuration is selected to view or edit.
- *
- * @param configuration launch configuration
- */
- public void initializeFrom(ILaunchConfiguration configuration);
-
- /**
- * Copies values from this group's tabs into the given
- * launch configuration.
- *
- * @param configuration launch configuration
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Notifies this tab that a configuration has been
- * launched, resulting in the given launch. This method can be
- * called when a tab's control does not exist, to support single-click
- * launching.
- *
- * @param launch the result of launching the current
- * launch configuration
- * @deprecated As of R3.0, this method is no longer called by the launch
- * framework. Since tabs do not exist when launching is performed elsewhere
- * than the launch dialog, this method cannot be relied upon for launching
- * functionality.
- */
- public void launched(ILaunch launch);
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchGroup.java
deleted file mode 100644
index cce5c1034..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchGroup.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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 org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * A launch group identifies a group of launch configurations by a launch
- * mode and category. The launch configuration dialog can be opened on
- * a launch group, and a launch history is maintained for each group.
- * A launch group is defined in plug-in XML via the <code>launchGroups</code>
- * extension point.
- * <p>
- * Following is an example of a launch group contribution:
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.launchGroups"&gt;
- * &lt;launchGroup
- * id="com.example.ExampleLaunchGroupId"
- * mode="run"
- * label="Run"
- * image="icons\run.gif"
- * &lt;/launchGroup&gt;
- * &lt;/extension&gt;
- * </pre>
- * </p>
- * <p>
- * The debug platform defines constants for the identifiers of the launch groups
- * provided by the debug platform:
- * <ul>
- * <li>IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP</li>
- * <li>IDebugUIConstants.ID_RUN_LAUNCH_GROUP</li>
- * <li>IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP</li>
- * </ul>
- * </p>
- * @since 3.0
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-public interface ILaunchGroup {
-
- /**
- * Returns the image for this launch group, or <code>null</code>
- * if none.
- *
- * @return the image for this launch group, or <code>null</code> if none
- */
- public ImageDescriptor getImageDescriptor();
-
- /**
- * Returns the banner image for this launch group, or <code>null</code> if
- * none
- *
- * @return the banner image for this launch group, or <code>null</code> if
- * none
- */
- public ImageDescriptor getBannerImageDescriptor();
-
- /**
- * Returns the label for this launch group
- *
- * @return the label for this launch group
- */
- public String getLabel();
-
- /**
- * Returns the id for this launch group
- *
- * @return the id for this launch group
- */
- public String getIdentifier();
-
- /**
- * Returns the category for this launch group, possibly <code>null</code>
- *
- * @return the category for this launch group, possibly <code>null</code>
- */
- public String getCategory();
-
- /**
- * Returns the mode for this launch group
- *
- * @return the mode for this launch group
- */
- public String getMode();
-
- /**
- * Returns whether this launch group is public
- *
- * @return boolean
- */
- public boolean isPublic();
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut.java
deleted file mode 100644
index 3717741c8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 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 org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A launch shortcut is capable of launching a selection
- * or active editor in the workbench. The delegate is responsible for
- * interpreting the selection or active editor (if it applies), and launching
- * an application. This may require creating a new launch configuration
- * with default values, or re-using an existing launch configuration.
- * <p>
- * A launch shortcut is defined as an extension
- * of type <code>org.eclipse.debug.ui.launchShortcuts</code>.
- * A shortcut specifies the perspectives in which is should be available
- * from the "Run/Debug" cascade menus.
- * </p>
- * <p>
- * A launch shortcut extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a launch shortcut extension.
- * </p>
- * <br>
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.launchShortcuts"&gt;
- * &lt;shortcut
- * class="org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut"
- * description="%JavaLaunchShortcut.description"
- * helpContextId="org.eclipse.jdt.debug.ui.shortcut_local_java_application"
- * icon="$nl$/icons/full/etool16/java_app.gif"
- * id="org.eclipse.jdt.debug.ui.localJavaShortcut"
- * label="%JavaApplicationShortcut.label"
- * modes="run, debug"&gt;
- * &lt;contextualLaunch&gt;
- * &lt;enablement&gt;
- * &lt;with variable="selection"&gt;
- * &lt;count value="1"/&gt;
- * &lt;iterate&gt;
- * &lt;and&gt;
- * &lt;adapt type="org.eclipse.jdt.core.IJavaElement"&gt;
- * &lt;test property="org.eclipse.jdt.core.isInJavaProject"/&gt;
- * &lt;/adapt&gt;
- * &lt;or&gt;
- * &lt;test property="org.eclipse.jdt.launching.hasMain"/&gt;
- * &lt;test property="org.eclipse.jdt.launching.isContainer"/&gt;
- * &lt;test property="org.eclipse.jdt.launching.isPackageFragment"/&gt;
- * &lt;test property="org.eclipse.jdt.launching.isPackageFragmentRoot"/&gt;
- * &lt;/or&gt;
- * &lt;/and&gt;
- * &lt;/iterate&gt;
- * &lt;/with&gt;
- * &lt;/enablement&gt;
- * &lt;/contextualLaunch&gt;
- * &lt;configurationType
- * id="org.eclipse.jdt.launching.localJavaApplication"&gt;
- * &lt;/configurationType&gt;
- * &lt;description
- * description="%RunJavaLaunchShortcut.description"
- * mode="run"&gt;
- * &lt;/description&gt;
- * &lt;description
- * description="%DebugJavaLaunchShortcut.description"
- * mode="debug"&gt;
- * &lt;/description&gt;
- * &lt;/shortcut&gt;
- * &lt;/extension&gt;
- * </pre>
- * <br>
- * <p>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies a unique identifier for this launch shortcut.</li>
- * <li><code>modes</code> specifies a comma separated list of modes this shortcut
- * supports.</li>
- * <li><code>class</code> specifies a fully qualified name of a Java class
- * that implements <code>ILaunchShortcut</code>.</li>
- * <li><code>label</code> specifies a label used to render this shortcut.</li>
- * <li><code>icon</code> specifies a plug-in relative path to an icon used to
- * render this shortcut.</li>
- * <li><code>category</code> specifies the launch configuration type category this shortcut is applicable for.
- * When unspecified, the category is <code>null</code> (default).</li>
- * <li><code>path</code> an optional menu path used to group launch shortcuts in menus.
- * Launch shortcuts are grouped alphabetically based on the <code>path</code> attribute,
- * and then sorted alphabetically within groups based on the <code>label</code> attribute.
- * When unspecified, a shortcut appears in the last group. This attribute was added in the 3.0.1 release.</li>
- * <li><code>helpContextId</code> optional attribute specifying the help context
- * identifier to associate with the launch shortcut action in a menu.</li>
- * <li><code>description</code> Provides a human readable description of what the shortcut does (or will do)
- * if the user selects it. A Description provided in this field will apply as the default description for all
- * of the modes listed in the modes attribute.</li>
- * <li><code>perspective</code> has been <b>deprecated</b> in the 3.1 release.
- * The top level Run/Debug/Profile cascade menus now support contextual (selection sensitive)
- * launching, and clients should provide a <code>contextualLaunch</code> element instead.</li>
- * <li><code>contextualLaunch</code> holds all descriptions for adding shortcuts to the selection sensitive
- * Run/Debug/Profile cascade menus. Only objects that provide an <code>org.eclipse.debug.ui.actions.ILaunchable</code>
- * adapter are considered for the cascade menus. The <code>org.eclipse.debug.ui.actions.ILaunchable</code>
- * interface is simply used to tag objects that support contextual launching.</li>
- * <li><code>contextLabel</code> zero or more context menu labels. For
- * shortcuts that pass their filter tests, the specified label will appear
- * in the "Run ->" context menu and be bound to a launch action of the
- * specified mode (e.g. run,debug,profile).</li>
- * <li><code>configurationType</code> allows more that one associated launch configuration type to be
- * specified for this launch shortcut. That way consumers of launch shortcut information can know what kinds
- * of launch configurations your short is associated with/creates</li>
- * <li><code>description</code> allows a mode specific description(s) to be provided for this launch shortcut.</li>
- * </ul>
- * </p>
- * <p>
- * <br>
- * Clients contributing a launch shortcut are intended to implement this interface.
- * </p>
- * @since 2.0
- */
-public interface ILaunchShortcut {
-
- /**
- * Locates a launchable entity in the given selection and launches
- * an application in the specified mode. This launch configuration
- * shortcut is responsible for progress reporting as well
- * as error handling, in the event that a launchable entity cannot
- * be found, or launching fails.
- *
- * @param selection workbench selection
- * @param mode one of the launch modes defined by the
- * launch manager
- * @see org.eclipse.debug.core.ILaunchManager
- */
- public void launch(ISelection selection, String mode);
-
- /**
- * Locates a launchable entity in the given active editor, and launches
- * an application in the specified mode. This launch configuration
- * shortcut is responsible for progress reporting as well as error
- * handling, in the event that a launchable entity cannot be found,
- * or launching fails.
- *
- * @param editor the active editor in the workbench
- * @param mode one of the launch modes defined by the launch
- * manager
- * @see org.eclipse.debug.core.ILaunchManager
- */
- public void launch(IEditorPart editor, String mode);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut2.java
deleted file mode 100644
index 7e5249035..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut2.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.eclipse.core.resources.IResource;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-
-
-/**
- * <p>
- * An extension to a standard launch shortcut ({@link ILaunchShortcut}) allowing
- * launch shortcuts to specify how selections and editors should be launched.
- * </p>
- * <p>
- * To launch a selection (or active editor), the debug platform derives a resource associated
- * with the selection (or active editor), and then resolves the most recently launched configuration
- * associated with that resource. This interface allows a launch shortcut to override the
- * framework's resource and launch configuration resolution for selections (and active editors).
- * </p>
- * <p>
- * NOTE: the methods in this interface can be called in a <b>non-UI</b> thread.
- * </p>
- * <p>
- * Clients contributing a launch shortcut are intended to implement this interface.
- * </p>
- * @see org.eclipse.debug.internal.ui.contextlaunching.ContextRunner
- * @see org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager
- * @since 3.4
- */
-public interface ILaunchShortcut2 extends ILaunchShortcut {
-
- /**
- * Returns an array of <code>ILaunchConfiguration</code>s that apply to the specified
- * selection, an empty collection if one could be created but does not exist, or
- * <code>null</code> if default resource mappings should be used to derive associated
- * configurations.
- *
- * @param selection the current selection
- * @return an array of existing <code>ILaunchConfiguration</code>s that could be
- * used to launch the given selection, an empty array if one could be created
- * but does not exist, or <code>null</code> if default resource mappings should
- * be used to derive associated configurations
- */
- public ILaunchConfiguration[] getLaunchConfigurations(ISelection selection);
-
- /**
- * Returns an array of existing <code>ILaunchConfiguration</code>s that could be
- * used to launch the given editor part, an empty array if one
- * could be created but does not exist, or <code>null</code> if default resource
- * mappings should be used to derive associated configurations
- *
- * @param editorpart the current selection
- * @return an array of existing <code>ILaunchConfiguration</code>s that could be
- * used to launch the given editor part/editor input, an empty array if one
- * could be created but does not exist, or <code>null</code> if default resource
- * mappings should be used to derive associated configurations
- */
- public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editorpart);
-
- /**
- * Returns an <code>IResource</code> that maps to the given selection for launch
- * purposes, or <code>null</code> if none. The resource is used to resolve a configuration
- * to launch if this shortcut does not provide specific launch configurations to launch
- * for the selection (via {@link #getLaunchConfigurations(ISelection)}.
- *
- * @param selection the current selection
- * @return an <code>IResource</code> that maps to the given selection for launch
- * purposes or <code>null</code> if none
- */
- public IResource getLaunchableResource(ISelection selection);
-
- /**
- * Returns an <code>IResource</code> that maps to given editor part for launch
- * purposes, or <code>null</code> if none. The resource is used to resolve a configuration
- * to launch if this shortcut does not provide specific launch configurations to launch
- * for the editor (via {@link #getLaunchConfigurations(IEditorPart)}.
- *
- * @param editorpart the current editor part
- * @return an <code>IResource</code> that maps to given editor part for launch
- * purposes, or <code>null</code> if none
- */
- public IResource getLaunchableResource(IEditorPart editorpart);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java
deleted file mode 100644
index 329ce6bd4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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 org.eclipse.ui.IEditorInput;
-
-/**
- * A source presentation is used to resolve an editor in
- * which to display a debug model element, breakpoint, or
- * source element. By default, a debug model presentation
- * (which implements this interface) is used to resolve
- * editors when performing source lookup. However, a source
- * locator may override default editor resolution by implementing
- * this interface.
- * <p>
- * Source lookup consists of the following steps:<ol>
- * <li>Locating a source element - the source locator associated
- * with a launch is queried for the source element associated
- * with a stack frame.</li>
- * <li>Resolving an editor in which to display a source element -
- * by default, the debug model presentation associated with the
- * debug model being debugged is queried for an editor input
- * and editor id in which to display a source element. However,
- * clients may override editor resolution by specifying a source
- * locator that is an instance of <code>ISourcePresentation</code>.
- * When a source presentation is specified as a source locator,
- * the source presentation is used to resolve an editor, rather
- * than the default debug model presentation.</li>
- * </ol>
- * </p>
- * <p>
- * Clients may implement this interface as part of an
- * {@link org.eclipse.debug.ui.IDebugModelPresentation} or as an optional
- * extension to an {@link org.eclipse.debug.core.model.ISourceLocator}.
- * </p>
- * @since 2.0
- */
-public interface ISourcePresentation {
-
- /**
- * Returns an editor input that should be used to display the given object
- * in an editor or <code>null</code> if unable to provide an editor input
- * for the given object.
- *
- * @param element a debug model element, breakpoint, or a source element
- * that was returned by a source locator's <code>getSourceElement(IStackFrame)</code>
- * method
- * @return an editor input, or <code>null</code> if none
- */
- public IEditorInput getEditorInput(Object element);
-
- /**
- * Returns the id of the editor to use to display the
- * given editor input and object, or <code>null</code> if
- * unable to provide an editor id.
- *
- * @param input an editor input that was previously retrieved from this
- * source presentation's <code>getEditorInput</code> method
- * @param element the object that was used in the call to
- * <code>getEditorInput</code>, that corresponds to the given editor
- * input
- * @return an editor id, or <code>null</code> if none
- */
- public String getEditorId(IEditorInput input, Object element);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java
deleted file mode 100644
index 05bcc4860..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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 org.eclipse.debug.core.model.IValue;
-
-/**
- * Notified of detailed value descriptions.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IDebugModelPresentation
- * @since 2.0
- */
-
-public interface IValueDetailListener {
- /**
- * Notifies this listener that the details for the given
- * value have been computed as the specified result.
- *
- * @param value the value for which the detail is provided
- * @param result the detailed description of the given value
- */
- public void detailComputed(IValue value, String result);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
deleted file mode 100644
index 2144d26a0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 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.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.debug.internal.ui.views.variables.VariablesView;
-import org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane;
-import org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy;
-import org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.PartInitException;
-
-/**
- * A <code>DebugPopup</code> that can be used to inspect an
- * <code>IExpression</code> object.
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class InspectPopupDialog extends DebugPopup {
-
- private static final String PREF_INSPECT_POPUP_SASH_WEIGHTS = DebugUIPlugin.getUniqueIdentifier() + "inspectPopupSashWeights"; //$NON-NLS-1$
-
- private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 75, 25 };
- private static final int MIN_WIDTH = 300;
- private static final int MIN_HEIGHT = 250;
-
- private TreeModelViewer fViewer;
- private SashForm fSashForm;
- private Composite fDetailPaneComposite;
- private DetailPaneProxy fDetailPane;
- private Tree fTree;
- private IExpression fExpression;
-
- /**
- * Creates a new inspect popup.
- *
- * @param shell The parent shell
- * @param anchor point at which to anchor the popup in Display coordinates. Since
- * 3.3 <code>null</code> indicates a default location should be used.
- * @param commandId The command id to be used for persistence of
- * the dialog (possibly <code>null</code>)
- * @param expression The expression being inspected
- */
- public InspectPopupDialog(Shell shell, Point anchor, String commandId, IExpression expression) {
- super(shell, anchor, commandId);
- fExpression = expression;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite composite = new Composite(parent, parent.getStyle());
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- fSashForm = new SashForm(composite, parent.getStyle());
- fSashForm.setOrientation(SWT.VERTICAL);
- fSashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- VariablesView view = getViewToEmulate();
- IPresentationContext context = new PresentationContext(IDebugUIConstants.ID_VARIABLE_VIEW);
- if (view != null) {
- // copy over properties
- IPresentationContext copy = ((TreeModelViewer)view.getViewer()).getPresentationContext();
- String[] properties = copy.getProperties();
- for (int i = 0; i < properties.length; i++) {
- String key = properties[i];
- context.setProperty(key, copy.getProperty(key));
- }
- }
- fViewer = new TreeModelViewer(fSashForm, SWT.NO_TRIM | SWT.MULTI | SWT.VIRTUAL, context);
- fViewer.setAutoExpandLevel(1);
-
- fDetailPaneComposite = SWTFactory.createComposite(fSashForm, 1, 1, GridData.FILL_BOTH);
-
- fDetailPane = new DetailPaneProxy(new DetailPaneContainer());
- fDetailPane.display(null); // Bring up the default pane so the user doesn't see an empty composite
-
- fTree = fViewer.getTree();
- fTree.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- fDetailPane.display((IStructuredSelection)fViewer.getSelection());
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
-
- initSashWeights();
-
- fViewer.getContentProvider();
- if (view != null) {
- StructuredViewer structuredViewer = (StructuredViewer) view.getViewer();
- if (structuredViewer != null) {
- ViewerFilter[] filters = structuredViewer.getFilters();
- for (int i = 0; i < filters.length; i++) {
- fViewer.addFilter(filters[i]);
- }
- }
- }
-
- TreeRoot treeRoot = new TreeRoot();
- // add update listener to auto-select and display details of root expression
- fViewer.addViewerUpdateListener(new IViewerUpdateListener() {
- public void viewerUpdatesComplete() {
- }
- public void viewerUpdatesBegin() {
- }
- public void updateStarted(IViewerUpdate update) {
- }
- public void updateComplete(IViewerUpdate update) {
- if (update instanceof IChildrenUpdate) {
- TreeSelection selection = new TreeSelection(new TreePath(new Object[]{fExpression}));
- fViewer.setSelection(selection);
- fDetailPane.display(selection);
- fViewer.removeViewerUpdateListener(this);
- }
- }
- });
- fViewer.setInput(treeRoot);
-
- return fTree;
- }
-
- /**
- * Initializes the sash form weights from the preference store (using default values if
- * no sash weights were stored previously).
- */
- protected void initSashWeights(){
- String prefWeights = DebugUIPlugin.getDefault().getPreferenceStore().getString(PREF_INSPECT_POPUP_SASH_WEIGHTS);
- if (prefWeights.length() > 0){
- String[] weights = prefWeights.split(":"); //$NON-NLS-1$
- if (weights.length == 2){
- try{
- int[] intWeights = new int[2];
- intWeights[0] = Integer.parseInt(weights[0]);
- intWeights[1] = Integer.parseInt(weights[1]);
- fSashForm.setWeights(intWeights);
- return;
- } catch (NumberFormatException e){}
- }
- }
- fSashForm.setWeights(DEFAULT_SASH_WEIGHTS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#saveDialogBounds(org.eclipse.swt.widgets.Shell)
- */
- protected void saveDialogBounds(Shell shell) {
- super.saveDialogBounds(shell);
- if (fSashForm != null && !fSashForm.isDisposed()){
- int[] weights = fSashForm.getWeights();
- if (weights.length == 2){
- String weightString = weights[0] + ":" + weights[1]; //$NON-NLS-1$
- DebugUIPlugin.getDefault().getPluginPreferences().setValue(PREF_INSPECT_POPUP_SASH_WEIGHTS, weightString);
- }
- }
- }
-
- /**
- * Creates the content for the root element of the tree viewer in the inspect
- * popup dialog. Always has one child, the expression this popup is displaying.
- *
- */
- private class TreeRoot extends ElementContentProvider {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return 1;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return new Object[] { fExpression };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return true;
- }
- }
-
- /**
- * Attempts to find an appropriate view to emulate, this will either be the
- * variables view or the expressions view.
- * @return a view to emulate or <code>null</code>
- */
- private VariablesView getViewToEmulate() {
- IWorkbenchPage page = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage();
- VariablesView expressionsView = (VariablesView) page.findView(IDebugUIConstants.ID_EXPRESSION_VIEW);
- if (expressionsView != null && expressionsView.isVisible()) {
- return expressionsView;
- }
- VariablesView variablesView = (VariablesView) page.findView(IDebugUIConstants.ID_VARIABLE_VIEW);
- if (variablesView != null && variablesView.isVisible()) {
- return variablesView;
- }
- if (expressionsView != null) {
- return expressionsView;
- }
- return variablesView;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#close()
- */
- public boolean close() {
- if (!wasPersisted()) {
- fExpression.dispose();
- }
- fDetailPane.dispose();
- return super.close();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#getActionText()
- */
- protected String getActionText() {
- return DebugUIViewsMessages.InspectPopupDialog_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#persist()
- */
- protected void persist() {
- super.persist();
- DebugPlugin.getDefault().getExpressionManager().addExpression(fExpression);
-
- fExpression = null;
- IWorkbenchPage page = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage();
- IViewPart part = page.findView(IDebugUIConstants.ID_EXPRESSION_VIEW);
- if (part == null) {
- try {
- page.showView(IDebugUIConstants.ID_EXPRESSION_VIEW);
- } catch (PartInitException e) {
- }
- } else {
- page.bringToTop(part);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#getInitialSize()
- */
- protected Point getInitialSize() {
- Point initialSize = super.getInitialSize();
- initialSize.x = Math.max(initialSize.x, MIN_WIDTH);
- initialSize.y = Math.max(initialSize.y, MIN_HEIGHT);
- return initialSize;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#getBackgroundColorExclusions()
- */
- protected List getBackgroundColorExclusions() {
- List list = super.getBackgroundColorExclusions();
- list.add(fSashForm);
- return list;
- }
-
- /**
- * Inner class implementing IDetailPaneContainer methods. Handles changes to detail
- * pane and provides limited access to the detail pane proxy.
- */
- private class DetailPaneContainer implements IDetailPaneContainer{
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentPaneID()
- */
- public String getCurrentPaneID() {
- return fDetailPane.getCurrentPaneID();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentSelection()
- */
- public IStructuredSelection getCurrentSelection() {
- return (IStructuredSelection)fViewer.getSelection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#refreshDetailPaneContents()
- */
- public void refreshDetailPaneContents() {
- fDetailPane.display(getCurrentSelection());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getParentComposite()
- */
- public Composite getParentComposite() {
- return fDetailPaneComposite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getWorkbenchPartSite()
- */
- public IWorkbenchPartSite getWorkbenchPartSite() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#paneChanged(java.lang.String)
- */
- public void paneChanged(String newPaneID) {
- if (newPaneID.equals(DefaultDetailPane.ID)){
- applyBackgroundColor(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND), fDetailPane.getCurrentControl());
- }
- }
-
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
deleted file mode 100644
index a35fc7af6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
+++ /dev/null
@@ -1,487 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 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 org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.RefreshUtil;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
-import org.eclipse.debug.internal.ui.stringsubstitution.StringSubstitutionMessages;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetEditWizard;
-
-/**
- * A launch configuration tab which allows the user to specify
- * which resources should be refreshed when the launch
- * terminates.
- * <p>
- * This class may be instantiate.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class RefreshTab extends AbstractLaunchConfigurationTab {
-
- /**
- * Boolean attribute indicating if a refresh scope is recursive. Default
- * value is <code>true</code>.
- */
- public static final String ATTR_REFRESH_RECURSIVE = RefreshUtil.ATTR_REFRESH_RECURSIVE;
-
- /**
- * String attribute identifying the scope of resources that should be
- * refreshed after an external tool is run. The value is either a refresh
- * variable or the default value, <code>null</code>, indicating no refresh.
- */
- public static final String ATTR_REFRESH_SCOPE = RefreshUtil.ATTR_REFRESH_SCOPE;
-
- // Check Buttons
- private Button fRefreshButton;
- private Button fRecursiveButton;
-
- // Group box
- private Group fGroup;
-
- // Radio Buttons
- private Button fContainerButton;
- private Button fProjectButton;
- private Button fResourceButton;
- private Button fWorkingSetButton;
- private Button fWorkspaceButton;
-
- // Push Button
- private Button fSelectButton;
-
- // Working set
- private IWorkingSet fWorkingSet;
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite mainComposite = new Composite(parent, SWT.NONE);
- setControl(mainComposite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_REFRESH_TAB);
-
- GridLayout layout = new GridLayout();
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- mainComposite.setLayout(layout);
- mainComposite.setLayoutData(gd);
- mainComposite.setFont(parent.getFont());
-
- fRefreshButton = createCheckButton(mainComposite, StringSubstitutionMessages.RefreshTab_31);
- fRefreshButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateEnabledState();
- updateLaunchConfigurationDialog();
- }
- });
-
- fGroup = new Group(mainComposite, SWT.NONE);
- fGroup.setFont(mainComposite.getFont());
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.makeColumnsEqualWidth = false;
- fGroup.setLayout(layout);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fGroup.setLayoutData(gd);
-
- SelectionAdapter adapter = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (((Button)e.getSource()).getSelection()) {
- updateEnabledState();
- updateLaunchConfigurationDialog();
- }
- }
- };
-
- fWorkspaceButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_32);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fWorkspaceButton.setLayoutData(gd);
- fWorkspaceButton.addSelectionListener(adapter);
-
- fResourceButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_33);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fResourceButton.setLayoutData(gd);
- fResourceButton.addSelectionListener(adapter);
-
- fProjectButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_34);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fProjectButton.setLayoutData(gd);
- fProjectButton.addSelectionListener(adapter);
-
- fContainerButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_35);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fContainerButton.setLayoutData(gd);
- fContainerButton.addSelectionListener(adapter);
-
- fWorkingSetButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_36);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 1;
- fWorkingSetButton.setLayoutData(gd);
- fWorkingSetButton.addSelectionListener(adapter);
-
- fSelectButton = createPushButton(fGroup, StringSubstitutionMessages.RefreshTab_37, null);
- gd = (GridData)fSelectButton.getLayoutData();
- gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
- fSelectButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectResources();
- }
- });
-
- createVerticalSpacer(fGroup, 2);
- createRecursiveComponent(fGroup);
- }
-
- /**
- * Prompts the user to select the resources to refresh.
- */
- private void selectResources() {
- IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
-
- if (fWorkingSet == null){
- fWorkingSet = workingSetManager.createWorkingSet(StringSubstitutionMessages.RefreshTab_40, new IAdaptable[0]);
- }
- IWorkingSetEditWizard wizard = workingSetManager.createWorkingSetEditWizard(fWorkingSet);
- WizardDialog dialog = new WizardDialog(((LaunchConfigurationsDialog)LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog()).getShell(), wizard);
- dialog.create();
-
- if (dialog.open() == Window.CANCEL) {
- return;
- }
- fWorkingSet = wizard.getSelection();
- updateLaunchConfigurationDialog();
- }
-
- /**
- * Creates the controls needed to edit the refresh recursive
- * attribute of a launch configuration
- *
- * @param parent the composite to create the controls in
- */
- private void createRecursiveComponent(Composite parent) {
- fRecursiveButton = createCheckButton(parent, StringSubstitutionMessages.RefreshTab_0);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- fRecursiveButton.setLayoutData(data);
- fRecursiveButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- updateRefresh(configuration);
- updateRecursive(configuration);
- updateScope(configuration);
- updateEnabledState();
- }
-
- /**
- * Updates the tab to display the refresh scope specified by the launch config
- */
- private void updateScope(ILaunchConfiguration configuration) {
- String scope = null;
- try {
- scope= configuration.getAttribute(ATTR_REFRESH_SCOPE, (String)null);
- } catch (CoreException ce) {
- DebugUIPlugin.log(DebugUIPlugin.newErrorStatus("Exception reading launch configuration", ce)); //$NON-NLS-1$
- }
- fWorkspaceButton.setSelection(false);
- fResourceButton.setSelection(false);
- fContainerButton.setSelection(false);
- fProjectButton.setSelection(false);
- fWorkingSetButton.setSelection(false);
- if (scope == null) {
- // select the workspace by default
- fWorkspaceButton.setSelection(true);
- } else {
- if (scope.equals(RefreshUtil.MEMENTO_WORKSPACE)) {
- fWorkspaceButton.setSelection(true);
- } else if (scope.equals(RefreshUtil.MEMENTO_SELECTED_RESOURCE)) {
- fResourceButton.setSelection(true);
- } else if (scope.equals(RefreshUtil.MEMENTO_SELECTED_CONTAINER)) {
- fContainerButton.setSelection(true);
- } else if (scope.equals(RefreshUtil.MEMENTO_SELECTED_PROJECT)) {
- fProjectButton.setSelection(true);
- } else if (scope.startsWith("${resource:")) { //$NON-NLS-1$
- fWorkingSetButton.setSelection(true);
- try {
- IResource[] resources = getRefreshResources(scope);
- IWorkingSetManager workingSetManager= PlatformUI.getWorkbench().getWorkingSetManager();
- fWorkingSet = workingSetManager.createWorkingSet(StringSubstitutionMessages.RefreshTab_40, resources);
- } catch (CoreException e) {
- fWorkingSet = null;
- }
- } else if (scope.startsWith("${working_set:")) { //$NON-NLS-1$
- fWorkingSetButton.setSelection(true);
- fWorkingSet = getWorkingSet(scope);
- }
- }
- }
- /**
- * Method updateRecursive.
- * @param configuration
- */
- private void updateRecursive(ILaunchConfiguration configuration) {
- boolean recursive= true;
- try {
- recursive= configuration.getAttribute(ATTR_REFRESH_RECURSIVE, true);
- } catch (CoreException ce) {
- DebugUIPlugin.log(DebugUIPlugin.newErrorStatus("Exception reading launch configuration", ce)); //$NON-NLS-1$
- }
- fRecursiveButton.setSelection(recursive);
- }
- /**
- * Method updateRefresh.
- * @param configuration
- */
- private void updateRefresh(ILaunchConfiguration configuration) {
- String scope= null;
- try {
- scope= configuration.getAttribute(ATTR_REFRESH_SCOPE, (String)null);
- } catch (CoreException ce) {
- DebugUIPlugin.log(DebugUIPlugin.newErrorStatus("Exception reading launch configuration", ce)); //$NON-NLS-1$
- }
- fRefreshButton.setSelection(scope != null);
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- if (fRefreshButton.getSelection()) {
- String scope = generateScopeMemento();
- configuration.setAttribute(ATTR_REFRESH_SCOPE, scope);
- setAttribute(ATTR_REFRESH_RECURSIVE, configuration, fRecursiveButton.getSelection(), true);
- } else {
- //clear the refresh attributes
- configuration.setAttribute(ATTR_REFRESH_SCOPE, (String)null);
- setAttribute(ATTR_REFRESH_RECURSIVE, configuration, true, true);
- }
- }
-
- /**
- * Generates a memento for the refresh scope. This is based on old refresh
- * variables.
- *
- * @return a memento
- */
- private String generateScopeMemento() {
- if (fWorkspaceButton.getSelection()) {
- return RefreshUtil.MEMENTO_WORKSPACE;
- }
- if (fResourceButton.getSelection()) {
- return RefreshUtil.MEMENTO_SELECTED_RESOURCE;
- }
- if (fContainerButton.getSelection()) {
- return RefreshUtil.MEMENTO_SELECTED_CONTAINER;
- }
- if (fProjectButton.getSelection()) {
- return RefreshUtil.MEMENTO_SELECTED_PROJECT;
- }
- if (fWorkingSetButton.getSelection()) {
- return getRefreshAttribute(fWorkingSet);
- }
- return null;
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return StringSubstitutionMessages.RefreshTab_6;
- }
-
- /**
- * Updates the enablement state of the fields.
- */
- private void updateEnabledState() {
- boolean enabled= fRefreshButton.getSelection();
- fRecursiveButton.setEnabled(enabled);
- fGroup.setEnabled(enabled);
- fWorkspaceButton.setEnabled(enabled);
- fResourceButton.setEnabled(enabled);
- fContainerButton.setEnabled(enabled);
- fProjectButton.setEnabled(enabled);
- fWorkingSetButton.setEnabled(enabled);
- fSelectButton.setEnabled(enabled && fWorkingSetButton.getSelection());
- if (!enabled) {
- super.setErrorMessage(null);
- }
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJS_REFRESH_TAB);
- }
-
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
- setMessage(null);
- if (fRefreshButton.getSelection() && (fWorkingSetButton.getSelection() && (fWorkingSet == null || fWorkingSet.getElements().length == 0))) {
- setErrorMessage(StringSubstitutionMessages.RefreshTab_42);
- return false;
- }
- return true;
- }
-
- /**
- * Refreshes the resources as specified by the given launch configuration.
- *
- * @param configuration launch configuration
- * @param monitor progress monitor which may be <code>null</code>
- * @throws CoreException if an exception occurs while refreshing resources
- */
- public static void refreshResources(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
- RefreshUtil.refreshResources(configuration, monitor);
- }
-
- /**
- * Returns a collection of resources referred to by a refresh scope attribute.
- *
- * @param scope refresh scope attribute (<code>ATTR_REFRESH_SCOPE</code>)
- * @return collection of resources referred to by the refresh scope attribute
- * @throws CoreException if unable to resolve a set of resources
- */
- public static IResource[] getRefreshResources(String scope) throws CoreException {
- return RefreshUtil.toResources(scope);
- }
-
- /**
- * Returns the refresh scope attribute specified by the given launch configuration
- * or <code>null</code> if none.
- *
- * @param configuration launch configuration
- * @return refresh scope attribute (<code>ATTR_REFRESH_SCOPE</code>)
- * @throws CoreException if unable to access the associated attribute
- */
- public static String getRefreshScope(ILaunchConfiguration configuration) throws CoreException {
- return configuration.getAttribute(ATTR_REFRESH_SCOPE, (String) null);
- }
-
- /**
- * Returns whether the refresh scope specified by the given launch
- * configuration is recursive.
- *
- * @param configuration
- * @return whether the refresh scope is recursive
- * @throws CoreException if unable to access the associated attribute
- */
- public static boolean isRefreshRecursive(ILaunchConfiguration configuration) throws CoreException {
- return configuration.getAttribute(ATTR_REFRESH_RECURSIVE, true);
- }
-
- /**
- * Creates and returns a memento for the given working set, to be used as a
- * refresh attribute.
- *
- * @param workingSet a working set, or <code>null</code>
- * @return an equivalent refresh attribute
- */
- public static String getRefreshAttribute(IWorkingSet workingSet) {
- if (workingSet == null || workingSet.getElements().length == 0) {
- return RefreshUtil.toMemento(new IResource[0]);
- } else {
- IAdaptable[] elements = workingSet.getElements();
- IResource[] resources = new IResource[elements.length];
- for (int i = 0; i < resources.length; i++) {
- resources[i]= (IResource) elements[i].getAdapter(IResource.class);
- }
- return RefreshUtil.toMemento(resources);
- }
- }
-
- /**
- * Creates and returns a working set from the given refresh attribute created by
- * the method <code>getRefreshAttribute(IWorkingSet)</code>, or <code>null</code>
- * if none.
- *
- * @param refreshAttribute a refresh attribute that represents a working set
- * @return equivalent working set, or <code>null</code>
- */
- public static IWorkingSet getWorkingSet(String refreshAttribute) {
- if (refreshAttribute.startsWith("${working_set:")) { //$NON-NLS-1$
- try {
- IResource[] resources = RefreshUtil.toResources(refreshAttribute);
- IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSet workingSet = workingSetManager.createWorkingSet(StringSubstitutionMessages.RefreshTab_1, resources);
- return workingSet;
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing on activation
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing on deactivation
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
- *
- * @since 3.5
- */
- public String getId() {
- return "org.eclipse.debug.ui.refreshTab"; //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
deleted file mode 100644
index 66fa6cc90..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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 org.eclipse.core.variables.IDynamicVariable;
-import org.eclipse.core.variables.IStringVariable;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.stringsubstitution.IArgumentSelector;
-import org.eclipse.debug.internal.ui.stringsubstitution.StringSubstitutionMessages;
-import org.eclipse.debug.internal.ui.stringsubstitution.StringVariableLabelProvider;
-import org.eclipse.debug.internal.ui.stringsubstitution.StringVariablePresentationManager;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * A dialog that prompts the user to choose and configure a string
- * substitution variable.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 3.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class StringVariableSelectionDialog extends ElementListSelectionDialog {
-
- // button to configure variable's argument
- private Button fArgumentButton;
- // variable description
- private Text fDescriptionText;
- // the argument value
- private Text fArgumentText;
- private String fArgumentValue;
- private Button fEditVariablesButton;
-
- /**
- * Constructs a new string substitution variable selection dialog.
- *
- * @param parent parent shell
- */
- public StringVariableSelectionDialog(Shell parent) {
- super(parent, new StringVariableLabelProvider());
- setShellStyle(getShellStyle() | SWT.RESIZE);
- setTitle(StringSubstitutionMessages.StringVariableSelectionDialog_2);
- setMessage(StringSubstitutionMessages.StringVariableSelectionDialog_3);
- setMultipleSelection(false);
- setElements(VariablesPlugin.getDefault().getStringVariableManager().getVariables());
- }
-
- /**
- * Returns the variable expression the user generated from this
- * dialog, or <code>null</code> if none.
- *
- * @return variable expression the user generated from this
- * dialog, or <code>null</code> if none
- */
- public String getVariableExpression() {
- Object[] selected = getResult();
- if (selected != null && selected.length == 1) {
- IStringVariable variable = (IStringVariable)selected[0];
- StringBuffer buffer = new StringBuffer();
- buffer.append("${"); //$NON-NLS-1$
- buffer.append(variable.getName());
- if (fArgumentValue != null && fArgumentValue.length() > 0) {
- buffer.append(":"); //$NON-NLS-1$
- buffer.append(fArgumentValue);
- }
- buffer.append("}"); //$NON-NLS-1$
- return buffer.toString();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control ctrl = super.createContents(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(ctrl, IDebugHelpContextIds.VARIABLE_SELECTION_DIALOG);
- return ctrl;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Control control = super.createDialogArea(parent);
- createArgumentArea((Composite)control);
- return control;
- }
-
- /**
- * Creates an area to display a description of the selected variable
- * and a button to configure the variable's argument.
- *
- * @param parent parent widget
- */
- private void createArgumentArea(Composite parent) {
- Composite container = SWTFactory.createComposite(parent, parent.getFont(), 2, 1, GridData.FILL_HORIZONTAL, 0, 0);
- SWTFactory.createHorizontalSpacer(container, 1);
-
- fEditVariablesButton = SWTFactory.createPushButton(container, StringSubstitutionMessages.StringVariableSelectionDialog_0, null, GridData.HORIZONTAL_ALIGN_END);
- fEditVariablesButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- editVariables();
- }
- });
-
- SWTFactory.createWrapLabel(container, StringSubstitutionMessages.StringVariableSelectionDialog_6, 2);
-
- Composite args = SWTFactory.createComposite(container, container.getFont(), 2, 2, GridData.FILL_HORIZONTAL, 0, 0);
-
- fArgumentText = new Text(args, SWT.BORDER);
- fArgumentText.setFont(container.getFont());
- fArgumentText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- fArgumentButton = SWTFactory.createPushButton(args, StringSubstitutionMessages.StringVariableSelectionDialog_7, null);
- fArgumentButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- configureArgument();
- }
- });
-
- SWTFactory.createWrapLabel(container, StringSubstitutionMessages.StringVariableSelectionDialog_8, 2);
-
- fDescriptionText = new Text(container, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
- fDescriptionText.setFont(container.getFont());
- fDescriptionText.setEditable(false);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- gd.heightHint = 50;
- fDescriptionText.setLayoutData(gd);
- }
-
- /**
- * Opens the preference dialog to the correct page an allows editing of variables
- */
- protected void editVariables() {
- final Display display = DebugUIPlugin.getStandardDisplay();
- BusyIndicator.showWhile(display, new Runnable() {
- public void run() {
- SWTFactory.showPreferencePage("org.eclipse.debug.ui.StringVariablePreferencePage"); //$NON-NLS-1$
- final IStringVariable[] elements = VariablesPlugin.getDefault().getStringVariableManager().getVariables();
- display.asyncExec(new Runnable() {
- public void run() {
- setListElements(elements);
- }
- });
- }
- });
- }
-
- /**
- * Configures the argument for the selected variable.
- */
- protected void configureArgument() {
- Object[] objects = getSelectedElements();
- IStringVariable variable = (IStringVariable)objects[0];
- IArgumentSelector selector = StringVariablePresentationManager.getDefault().getArgumentSelector(variable);
- String value = selector.selectArgument(variable, getShell());
- if (value != null) {
- fArgumentText.setText(value);
- }
- }
-
- /**
- * Update variable description and argument button enablement.
- *
- * @see org.eclipse.ui.dialogs.AbstractElementListSelectionDialog#handleSelectionChanged()
- */
- protected void handleSelectionChanged() {
- super.handleSelectionChanged();
- Object[] objects = getSelectedElements();
- boolean buttonEnabled = false;
- boolean argEnabled = false;
- String text = null;
- if (objects.length == 1) {
- IStringVariable variable = (IStringVariable)objects[0];
- IArgumentSelector selector = StringVariablePresentationManager.getDefault().getArgumentSelector(variable);
- if (variable instanceof IDynamicVariable) {
- argEnabled = ((IDynamicVariable)variable).supportsArgument();
- }
- buttonEnabled = argEnabled && selector != null;
- text = variable.getDescription();
- }
- if (text == null) {
- text = IInternalDebugCoreConstants.EMPTY_STRING;
- }
- fArgumentText.setEnabled(argEnabled);
- fArgumentButton.setEnabled(buttonEnabled);
- fDescriptionText.setText(text);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- fArgumentValue = fArgumentText.getText().trim();
- super.okPressed();
- }
-
- /**
- * Returns the name of the section that this dialog stores its settings in
- *
- * @return String
- */
- private String getDialogSettingsSectionName() {
- return IDebugUIConstants.PLUGIN_ID + ".STRING_VARIABLE_SELECTION_DIALOG_SECTION"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
- */
- protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
- if (section == null) {
- section = settings.addNewSection(getDialogSettingsSectionName());
- }
- return section;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java
deleted file mode 100644
index f879120af..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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
- * Remy Chi Jian Suen <remy.suen@gmail.com>
- * - Bug 214696 Expose WorkingDirectoryBlock as API
- * - Bug 221973 Make WorkingDirectoryBlock from JDT a Debug API class
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import java.io.File;
-
-import org.eclipse.core.filesystem.URIUtil;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.variables.IStringVariableManager;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-
-/**
- * A control for setting the working directory associated with a launch
- * configuration.
- *
- * @since 3.5
- */
-public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
-
- // Local directory
- private Button fWorkspaceButton;
- private Button fFileSystemButton;
- private Button fVariablesButton;
-
- //bug 29565 fix
- private Button fUseDefaultDirButton = null;
- private Button fUseOtherDirButton = null;
- private Text fOtherWorkingText = null;
- private Text fWorkingDirText;
-
- /**
- * The last launch config this tab was initialized from
- */
- private ILaunchConfiguration fLaunchConfiguration;
-
- /**
- * A listener to update for text changes and widget selection
- */
- private class WidgetListener extends SelectionAdapter implements ModifyListener {
- public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
- }
- public void widgetSelected(SelectionEvent e) {
- Object source= e.getSource();
- if (source == fWorkspaceButton) {
- handleWorkspaceDirBrowseButtonSelected();
- }
- else if (source == fFileSystemButton) {
- handleWorkingDirBrowseButtonSelected();
- }
- else if (source == fVariablesButton) {
- handleWorkingDirVariablesButtonSelected();
- }
- else if(source == fUseDefaultDirButton) {
- //only perform the action if this is the button that was selected
- if(fUseDefaultDirButton.getSelection()) {
- setDefaultWorkingDir();
- }
- }
- else if(source == fUseOtherDirButton) {
- //only perform the action if this is the button that was selected
- if(fUseOtherDirButton.getSelection()) {
- handleUseOtherWorkingDirButtonSelected();
- }
- }
- }
- }
-
- private WidgetListener fListener = new WidgetListener();
-
- /**
- * The name of the launch configuration attribute that will be used to save
- * the location of the working directory.
- */
- private final String workingDirectoryAttribteName;
-
- /**
- * The help context id to use to connect this working directory block
- * to the help system.
- */
- private final String helpContextId;
-
- /**
- * Creates a new WorkingDirectoryBlock for setting a working directory.
- *
- * @param workingDirectoryAttribteName the name of the launch configuration attribute to set the working directory's location, cannot be <tt>null</tt>
- */
- protected WorkingDirectoryBlock(String workingDirectoryAttribteName) {
- this(workingDirectoryAttribteName, null);
- }
-
- /**
- * Creates a new WorkingDirectoryBlock for setting a working directory.
- *
- * @param workingDirectoryAttribteName the name of the launch configuration attribute to set the working directory's location, cannot be <tt>null</tt>
- * @param helpContextId the help context id to use to hook onto the help system
- */
- protected WorkingDirectoryBlock(String workingDirectoryAttribteName,
- String helpContextId) {
- Assert.isNotNull(workingDirectoryAttribteName);
- this.workingDirectoryAttribteName = workingDirectoryAttribteName;
- this.helpContextId = helpContextId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public final void createControl(Composite parent) {
- Font font = parent.getFont();
- Group group = SWTFactory.createGroup(parent, DebugUIMessages.WorkingDirectoryBlock_12, 2, 1, GridData.FILL_HORIZONTAL);
- setControl(group);
-
- if (helpContextId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, helpContextId);
- }
-
- //default choice
- Composite comp = SWTFactory.createComposite(group, font, 2, 2, GridData.FILL_BOTH, 0, 0);
- fUseDefaultDirButton = SWTFactory.createRadioButton(comp, DebugUIMessages.WorkingDirectoryBlock_18);
- fUseDefaultDirButton.addSelectionListener(fListener);
- fWorkingDirText = SWTFactory.createSingleText(comp, 1);
- fWorkingDirText.addModifyListener(fListener);
- fWorkingDirText.setEnabled(false);
- //user enter choice
- fUseOtherDirButton = SWTFactory.createRadioButton(comp, DebugUIMessages.WorkingDirectoryBlock_19);
- fUseOtherDirButton.addSelectionListener(fListener);
- fOtherWorkingText = SWTFactory.createSingleText(comp, 1);
- fOtherWorkingText.addModifyListener(fListener);
- //buttons
- Composite buttonComp = SWTFactory.createComposite(comp, font, 3, 2, GridData.HORIZONTAL_ALIGN_END);
- GridLayout ld = (GridLayout)buttonComp.getLayout();
- ld.marginHeight = 1;
- ld.marginWidth = 0;
- fWorkspaceButton = createPushButton(buttonComp, DebugUIMessages.WorkingDirectoryBlock_0, null);
- fWorkspaceButton.addSelectionListener(fListener);
- fFileSystemButton = createPushButton(buttonComp, DebugUIMessages.WorkingDirectoryBlock_1, null);
- fFileSystemButton.addSelectionListener(fListener);
- fVariablesButton = createPushButton(buttonComp, DebugUIMessages.WorkingDirectoryBlock_17, null);
- fVariablesButton.addSelectionListener(fListener);
- }
-
- /**
- * Show a dialog that lets the user select a working directory
- */
- private void handleWorkingDirBrowseButtonSelected() {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage(DebugUIMessages.WorkingDirectoryBlock_7);
- String currentWorkingDir = getWorkingDirectoryText();
- if (!currentWorkingDir.trim().equals("")) { //$NON-NLS-1$
- File path = new File(currentWorkingDir);
- if (path.exists()) {
- dialog.setFilterPath(currentWorkingDir);
- }
- }
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null) {
- fOtherWorkingText.setText(selectedDirectory);
- }
- }
-
- /**
- * Show a dialog that lets the user select a working directory from
- * the workspace
- */
- private void handleWorkspaceDirBrowseButtonSelected() {
- IContainer currentContainer= getContainer();
- if (currentContainer == null) {
- currentContainer = ResourcesPlugin.getWorkspace().getRoot();
- }
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), currentContainer, false, DebugUIMessages.WorkingDirectoryBlock_4);
- dialog.showClosedProjects(false);
- dialog.open();
- Object[] results = dialog.getResult();
- if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) {
- IPath path = (IPath)results[0];
- String containerName = path.makeRelative().toString();
- setOtherWorkingDirectoryText("${workspace_loc:" + containerName + "}"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Returns the selected workspace container,or <code>null</code>
- */
- protected IContainer getContainer() {
- String path = getWorkingDirectoryText();
- if (path.length() > 0) {
- IResource res = null;
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- if (path.startsWith("${workspace_loc:")) { //$NON-NLS-1$
- IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
- try {
- path = manager.performStringSubstitution(path, false);
- IPath uriPath = new Path(path).makeAbsolute();
- IContainer[] containers = root.findContainersForLocationURI(URIUtil.toURI(uriPath));
- if (containers.length > 0) {
- res = containers[0];
- }
- }
- catch (CoreException e) {
- log(e);
- }
- }
- else {
- res = root.findMember(path);
- }
- if (res instanceof IContainer) {
- return (IContainer)res;
- }
- }
- return null;
- }
-
- /**
- * The default working dir radio button has been selected.
- */
- private void handleUseDefaultWorkingDirButtonSelected() {
- fWorkspaceButton.setEnabled(false);
- fOtherWorkingText.setEnabled(false);
- fVariablesButton.setEnabled(false);
- fFileSystemButton.setEnabled(false);
- fUseOtherDirButton.setSelection(false);
- }
-
- /**
- * The other working dir radio button has been selected
- */
- private void handleUseOtherWorkingDirButtonSelected() {
- fOtherWorkingText.setEnabled(true);
- fWorkspaceButton.setEnabled(true);
- fVariablesButton.setEnabled(true);
- fFileSystemButton.setEnabled(true);
- updateLaunchConfigurationDialog();
- }
-
- /**
- * The working dir variables button has been selected
- */
- private void handleWorkingDirVariablesButtonSelected() {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
- dialog.open();
- String variableText = dialog.getVariableExpression();
- if (variableText != null) {
- fOtherWorkingText.insert(variableText);
- }
- }
-
- /**
- * Sets the default working directory.
- */
- protected void setDefaultWorkingDir() {
- try {
- ILaunchConfiguration config = getLaunchConfiguration();
- if (config != null) {
- IProject project = getProject(config);
- if (project != null) {
- setDefaultWorkingDirectoryText("${workspace_loc:" + project.getFullPath().makeRelative().toOSString() + "}"); //$NON-NLS-1$//$NON-NLS-2$
- return;
- }
- }
- }
- catch (CoreException ce) {
- log(ce);
- }
- setDefaultWorkingDirectoryText(System.getProperty("user.dir")); //$NON-NLS-1$
- }
-
- /**
- * Returns the project associated with the specified launch configuration or
- * <code>null</code> if none.
- *
- * @param configuration the launch configuration that has been set to this working directory block
- * @return the project specified by the launch configuration, or <tt>null</tt> if nothing has been set
- * @throws CoreException if an error occurred while retrieving the project from the launch configuration
- */
- protected abstract IProject getProject(ILaunchConfiguration configuration) throws CoreException;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration config) {
- setErrorMessage(null);
- setMessage(null);
- // if variables are present, we cannot resolve the directory
- String workingDirPath = getWorkingDirectoryText();
- if (workingDirPath.indexOf("${") >= 0) { //$NON-NLS-1$
- IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
- try {
- manager.validateStringVariables(workingDirPath);
- }
- catch (CoreException e) {
- setErrorMessage(e.getMessage());
- return false;
- }
- }
- else if (workingDirPath.length() > 0) {
- IContainer container = getContainer();
- if (container == null) {
- File dir = new File(workingDirPath);
- if (dir.isDirectory()) {
- return true;
- }
- setErrorMessage(DebugUIMessages.WorkingDirectoryBlock_10);
- return false;
- }
- } else if (workingDirPath.length() == 0) {
- setErrorMessage(DebugUIMessages.WorkingDirectoryBlock_20);
- return false;
- }
- return true;
- }
-
- /**
- * Sets the default working directory to be used by the launch configuration.
- * The default implementation has no default working directory.
- *
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setAttribute(workingDirectoryAttribteName, (String)null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- setLaunchConfiguration(configuration);
- try {
- String wd = configuration.getAttribute(workingDirectoryAttribteName, (String)null);
- setDefaultWorkingDir();
- if (wd != null) {
- setOtherWorkingDirectoryText(wd);
- }
- }
- catch (CoreException e) {
- setErrorMessage(DebugUIMessages.WorkingDirectoryBlock_Exception_occurred_reading_configuration___15 + e.getStatus().getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- if(fUseDefaultDirButton.getSelection()) {
- configuration.setAttribute(workingDirectoryAttribteName, (String)null);
- }
- else {
- configuration.setAttribute(workingDirectoryAttribteName, getWorkingDirectoryText());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return DebugUIMessages.WorkingDirectoryBlock_Working_Directory_8;
- }
-
- /**
- * Logs exceptions that have been caught by this working directory block.
- * Subclasses should reimplement if they wish to monitor such exceptions.
- * Default implementation does nothing.
- * @param e the exception to log
- */
- protected void log(CoreException e) {
- // nothing
- }
-
- /**
- * Retrieves the path from the text box that has been selected.
- * @return the working directory the user wishes to use
- */
- protected final String getWorkingDirectoryText() {
- if(fUseDefaultDirButton.getSelection()) {
- return fWorkingDirText.getText().trim();
- }
- return fOtherWorkingText.getText().trim();
- }
-
- /**
- * Sets the text of the default working directory.
- * @param dir the directory to set the widget to
- */
- protected final void setDefaultWorkingDirectoryText(String dir) {
- if(dir != null) {
- fWorkingDirText.setText(dir);
- fUseDefaultDirButton.setSelection(true);
- handleUseDefaultWorkingDirButtonSelected();
- }
- }
-
- /**
- * Sets the directory of the other working directory to be used.
- * @param dir the directory to set the widget to
- */
- protected final void setOtherWorkingDirectoryText(String dir) {
- if(dir != null) {
- fOtherWorkingText.setText(dir);
- fUseDefaultDirButton.setSelection(false);
- fUseOtherDirButton.setSelection(true);
- handleUseOtherWorkingDirButtonSelected();
- }
- }
-
- /**
- * Sets the launch configuration to be used by this working directory block.
- */
- protected void setLaunchConfiguration(ILaunchConfiguration config) {
- fLaunchConfiguration = config;
- }
-
- /**
- * Returns the launch configuration that this working directory block is using.
- * @return this working directory block's launch configuration
- */
- protected ILaunchConfiguration getLaunchConfiguration() {
- return fLaunchConfiguration;
- }
-
- /**
- * Allows this entire block to be enabled/disabled
- * @param enabled whether to enable it or not
- */
- public final void setEnabled(boolean enabled) {
- fUseDefaultDirButton.setEnabled(enabled);
- fUseOtherDirButton.setEnabled(enabled);
- if(fOtherWorkingText.isEnabled()) {
- fOtherWorkingText.setEnabled(enabled);
- fWorkspaceButton.setEnabled(enabled);
- fVariablesButton.setEnabled(enabled);
- fFileSystemButton.setEnabled(enabled);
- }
- // in the case where the 'other' text is selected and we want to enable
- if(fUseOtherDirButton.getSelection() && enabled == true) {
- fOtherWorkingText.setEnabled(enabled);
- }
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
deleted file mode 100644
index 462828642..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 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.actions;
-
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener;
-import org.eclipse.debug.internal.ui.ILaunchLabelChangedListener;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Abstract implementation of an action that displays a drop-down launch
- * history for a specific launch group.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see LaunchingResourceManager
- * @see ILaunchLabelChangedListener
- * @since 2.1
- */
-public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, IWorkbenchWindowPulldownDelegate2, ILaunchHistoryChangedListener {
-
- /**
- * The menu created by this action
- */
- private Menu fMenu;
-
- /**
- * The action used to render this delegate.
- */
- private IAction fAction;
-
- /**
- * The associated <code>ILaunchGroup</code>
- * @since 3.3
- */
- private ILaunchGroup fLaunchGroup = null;
-
- /**
- * Indicates whether the launch history has changed and
- * the sub menu needs to be recreated.
- */
- protected boolean fRecreateMenu = false;
-
- /**
- * Constructs a launch history action.
- *
- * @param launchGroupIdentifier unique identifier of the launch group
- * extension that this action displays a launch history for.
- */
- public AbstractLaunchHistoryAction(String launchGroupIdentifier) {
- fLaunchGroup = getLaunchConfigurationManager().getLaunchGroup(launchGroupIdentifier);
- }
-
- /**
- * A listener to be notified of launch label updates
- * @since 3.3
- */
- private ILaunchLabelChangedListener fLabelListener = new ILaunchLabelChangedListener() {
- public ILaunchGroup getLaunchGroup() {
- return fLaunchGroup;
- }
- public void labelChanged() {
- updateTooltip();
- }
- };
-
- /**
- * Sets the action used to render this delegate.
- *
- * @param action the action used to render this delegate
- */
- private void setAction(IAction action) {
- fAction = action;
- }
-
- /**
- * Returns the action used to render this delegate.
- *
- * @return the action used to render this delegate
- */
- protected IAction getAction() {
- return fAction;
- }
-
- /**
- * Adds the given action to the specified menu with an accelerator specified
- * by the given number.
- *
- * @param menu the menu to add the action to
- * @param action the action to add
- * @param accelerator the number that should appear as an accelerator
- */
- protected void addToMenu(Menu menu, IAction action, int accelerator) {
- StringBuffer label= new StringBuffer();
- if (accelerator >= 0 && accelerator < 10) {
- //add the numerical accelerator
- label.append('&');
- label.append(accelerator);
- label.append(' ');
- }
- label.append(action.getText());
- action.setText(label.toString());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
-
- /**
- * Initialize this action so that it can dynamically set its tool-tip. Also set the enabled state
- * of the underlying action based on whether there are any registered launch configuration types that
- * understand how to launch in the mode of this action.
- */
- private void initialize(IAction action) {
- getLaunchConfigurationManager().addLaunchHistoryListener(this);
- setAction(action);
- updateTooltip();
- action.setEnabled(existsConfigTypesForMode());
- }
-
- /**
- * Return whether there are any registered launch configuration types for
- * the mode of this action.
- *
- * @return whether there are any registered launch configuration types for
- * the mode of this action
- */
- private boolean existsConfigTypesForMode() {
- ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- if (configTypes[i].supportsMode(getMode())) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Updates this action's tool-tip. The tooltip is based on user preference settings
- * for launching - either the previous launch, or based on the selection and which
- * configuration will be launched.
- * <p>
- * Subclasses may override as required.
- * </p>
- */
- protected void updateTooltip() {
- getAction().setToolTipText(getToolTip());
- }
-
- /**
- * Returns the tooltip specific to a configuration.
- *
- * @param configuration a <code>ILauncConfiguration</code>
- * @return the string for the tool tip
- */
- protected String getToolTip(ILaunchConfiguration configuration) {
- String launchName= configuration.getName();
- String mode= getMode();
- String label;
- if (mode.equals(ILaunchManager.RUN_MODE)) {
- label= ActionMessages.AbstractLaunchHistoryAction_1;
- } else if (mode.equals(ILaunchManager.DEBUG_MODE)){
- label= ActionMessages.AbstractLaunchHistoryAction_2;
- } else if (mode.equals(ILaunchManager.PROFILE_MODE)){
- label= ActionMessages.AbstractLaunchHistoryAction_3;
- } else {
- label= ActionMessages.AbstractLaunchHistoryAction_4;
- }
- return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new String[] {label, launchName});
- }
-
- /**
- * Returns this action's tooltip. The tooltip is retrieved from the launch resource manager
- * which builds tool tips asynchronously for context launching support.
- *
- * @return the string for the tool tip
- */
- private String getToolTip() {
- String launchName = getLaunchingResourceManager().getLaunchLabel(fLaunchGroup);
- if(launchName == null) {
- return DebugUIPlugin.removeAccelerators(internalGetHistory().getLaunchGroup().getLabel());
- }
- String label = null;
- String mode = getMode();
- if (mode.equals(ILaunchManager.RUN_MODE)) {
- label = ActionMessages.AbstractLaunchHistoryAction_1;
- } else if (mode.equals(ILaunchManager.DEBUG_MODE)){
- label = ActionMessages.AbstractLaunchHistoryAction_2;
- } else if (mode.equals(ILaunchManager.PROFILE_MODE)){
- label = ActionMessages.AbstractLaunchHistoryAction_3;
- } else {
- label = ActionMessages.AbstractLaunchHistoryAction_4;
- }
- if(IInternalDebugCoreConstants.EMPTY_STRING.equals(launchName)) {
- return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_5, new String[] {label});
- }
- else {
- return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new String[] {label, launchName});
- }
- }
-
- /**
- * @see ILaunchHistoryChangedListener#launchHistoryChanged()
- */
- public void launchHistoryChanged() {
- fRecreateMenu = true;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- setMenu(null);
- getLaunchConfigurationManager().removeLaunchHistoryListener(this);
- getLaunchingResourceManager().removeLaunchLabelChangedListener(fLabelListener);
- }
-
- /**
- * Return the last launch in this action's launch history.
- *
- * @return the most recent configuration that was launched from this
- * action's launch history that is not filtered from the menu
- */
- protected ILaunchConfiguration getLastLaunch() {
- return getLaunchConfigurationManager().getFilteredLastLaunch(getLaunchGroupIdentifier());
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowPulldownDelegate#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- setMenu(new Menu(parent));
- fillMenu(fMenu);
- initMenu();
- return fMenu;
- }
-
- /**
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- setMenu(new Menu(parent));
- fillMenu(fMenu);
- initMenu();
- return fMenu;
- }
-
- /**
- * Creates the menu for the action
- */
- private void initMenu() {
- // Add listener to re-populate the menu each time
- // it is shown because of dynamic history list
- fMenu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- if (fRecreateMenu) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- fRecreateMenu= false;
- }
- }
- });
- }
-
- /**
- * Sets this action's drop-down menu, disposing the previous menu.
- *
- * @param menu the new menu
- */
- private void setMenu(Menu menu) {
- if (fMenu != null) {
- fMenu.dispose();
- }
- fMenu = menu;
- }
-
- /**
- * Fills the drop-down menu with favorites and launch history
- *
- * @param menu the menu to fill
- */
- protected void fillMenu(Menu menu) {
- ILaunchConfiguration[] historyList= getHistory();
- ILaunchConfiguration[] favoriteList = getFavorites();
-
- // Add favorites
- int accelerator = 1;
- for (int i = 0; i < favoriteList.length; i++) {
- ILaunchConfiguration launch= favoriteList[i];
- LaunchAction action= new LaunchAction(launch, getMode());
- addToMenu(menu, action, accelerator);
- accelerator++;
- }
-
- // Separator between favorites and history
- if (favoriteList.length > 0 && historyList.length > 0) {
- addSeparator(menu);
- }
-
- // Add history launches next
- for (int i = 0; i < historyList.length; i++) {
- ILaunchConfiguration launch= historyList[i];
- LaunchAction action= new LaunchAction(launch, getMode());
- addToMenu(menu, action, accelerator);
- accelerator++;
- }
-
- if(accelerator == 1) {
- IAction action = new Action(ActionMessages.AbstractLaunchHistoryAction_6) {};
- action.setEnabled(false);
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
- }
-
- /**
- * Adds a separator to the given menu
- *
- * @param menu
- */
- protected void addSeparator(Menu menu) {
- new MenuItem(menu, SWT.SEPARATOR);
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // do nothing - this is just a menu
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- * @since 3.6
- */
- public void runWithEvent(IAction action, Event event) {
- if((event.stateMask & SWT.MOD1) > 0) {
- ILaunchConfiguration config = getLastLaunch();
- IStructuredSelection selection = null;
- if (config != null){
- selection = new StructuredSelection(config);
- }
- DebugUITools.openLaunchConfigurationDialogOnGroup(
- DebugUIPlugin.getShell(),
- selection,
- getLaunchGroupIdentifier());
- return;
- }
- run(action);
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- * @since 3.6
- */
- public void init(IAction action) {
- // do nothing by default
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection){
- if (fAction == null) {
- initialize(action);
- }
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- if (this instanceof AbstractLaunchToolbarAction) {
- getLaunchingResourceManager().addLaunchLabelUpdateListener(fLabelListener);
- }
- }
-
- /**
- * Returns the launch history associated with this action's launch group.
- *
- * @return the launch history associated with this action's launch group
- * @deprecated this method returns a class that is not API and is not intended
- * for clients of the debug platform. Instead, use <code>getHistory()</code>,
- * <code>getFavorites()</code>, and <code>getLastLaunch()</code>.
- */
- protected LaunchHistory getLaunchHistory() {
- return getLaunchConfigurationManager().getLaunchHistory(getLaunchGroupIdentifier());
- }
-
- /**
- * Returns the launch history associated with this action's launch group.
- *
- * @return the launch history associated with this action's launch group
- * @since 3.3
- */
- private LaunchHistory internalGetHistory() {
- return getLaunchConfigurationManager().getLaunchHistory(getLaunchGroupIdentifier());
- }
-
- /**
- * Returns the launch history associated with this action's launch mode and group in most
- * recently launched order. Configurations associated with disabled activities are not included
- * in the list. As well, configurations are filtered based on workspace preference settings
- * to filter configurations from closed projects, deleted projects, working sets and to filter
- * specific launch configuration types.
- *
- * @return launch history
- * @since 3.3
- */
- protected ILaunchConfiguration[] getHistory() {
- return LaunchConfigurationManager.filterConfigs(internalGetHistory().getHistory());
- }
-
- /**
- * Returns the launch favorites associated with this action's launch mode and group in user
- * preference order. Configurations associated with disabled activities are not included
- * in the list. As well, configurations are filtered based on workspace preference settings
- * to filter configurations from closed projects, deleted projects, working sets and to filter
- * specific launch configuration types.
- *
- * @return favorite launch configurations
- * @since 3.3
- */
- protected ILaunchConfiguration[] getFavorites() {
- return LaunchConfigurationManager.filterConfigs(internalGetHistory().getFavorites());
- }
-
- /**
- * Returns the mode (e.g., 'run' or 'debug') of this drop down.
- *
- * @return the mode of this action
- */
- protected String getMode() {
- return internalGetHistory().getLaunchGroup().getMode();
- }
-
- /**
- * Returns the launch configuration manager.
- *
- * @return launch configuration manager
- */
- private LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * Returns the <code>ContextualLaunchingResourceManager</code>
- *
- * @return <code>ContextualLaunchingResourceManager</code>
- */
- private LaunchingResourceManager getLaunchingResourceManager() {
- return DebugUIPlugin.getDefault().getLaunchingResourceManager();
- }
-
- /**
- * Returns the identifier of the launch group this action is associated
- * with.
- *
- * @return the identifier of the launch group this action is associated
- * with
- */
- protected String getLaunchGroupIdentifier() {
- return fLaunchGroup.getIdentifier();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
deleted file mode 100644
index d7f41bbdf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 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.actions;
-
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.contextlaunching.ContextRunner;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.OrganizeFavoritesAction;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Menu;
-
-/**
- * A launch history action that also includes launch shortcut actions (run/debug
- * as), and an action to open the launch configuration dialog.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 2.1
- */
-public class AbstractLaunchToolbarAction extends AbstractLaunchHistoryAction {
-
-
- /**
- * Constructs a launch toolbar action.
- *
- * @param launchGroupIdentifier unique identifier of the launch group
- * extension that this action displays a launch history, shortcuts, and
- * launch configuration dialog for.
- */
- public AbstractLaunchToolbarAction(String launchGroupIdentifier) {
- super(launchGroupIdentifier);
- }
-
- /**
- * Fills the drop-down menu with favorites and launch history,
- * launch shortcuts, and an action to open the launch configuration dialog.
- *
- * @param menu the menu to fill
- */
- protected void fillMenu(Menu menu) {
- super.fillMenu(menu);
- // Separator between history and common actions
- if (menu.getItemCount() > 0) {
- addSeparator(menu);
- }
- addToMenu(menu, new LaunchShortcutsAction(getLaunchGroupIdentifier()), -1);
- addToMenu(menu, getOpenDialogAction(), -1);
- addToMenu(menu, new OrganizeFavoritesAction(getLaunchGroupIdentifier()), -1);
- }
-
- /**
- * Returns an action to open the launch dialog
- * @since 3.1
- */
- protected IAction getOpenDialogAction() {
- return new OpenLaunchDialogAction(getLaunchGroupIdentifier());
- }
-
- /**
- * Launch the last launch, or open the launch config dialog if none.
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- //always ignore external tools during context launching
- if(LaunchingResourceManager.isContextLaunchEnabled() &&
- !getLaunchGroupIdentifier().equals("org.eclipse.ui.externaltools.launchGroup")) { //$NON-NLS-1$
- ContextRunner.getDefault().launch(DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(getLaunchGroupIdentifier()));
- }
- else {
- ILaunchConfiguration configuration = getLastLaunch();
- if (configuration == null) {
- DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(), getLaunchGroupIdentifier());
- } else {
- DebugUITools.launch(configuration, getMode());
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
deleted file mode 100644
index 2e180cd05..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 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
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- *******************************************************************************/
-
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * A cascade menu to add a memory rendering to the memory view. This action delegate can be
- * contributed to a an editor, view or object via standard workbench extension points.
- * The action works on the {@link IAddMemoryRenderingsTarget} adapter provided
- * by the active debug context, creating a context menu to add applicable renderings
- * to the memory view.
- * <p>
- * Clients may reference/contribute this class as an action delegate
- * in plug-in XML.
- * </p>
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class AddMemoryRenderingActionDelegate extends Action implements IViewActionDelegate, IEditorActionDelegate, IObjectActionDelegate, IActionDelegate2{
-
- private IAction fAction;
- private IWorkbenchPart fPart;
- private ISelection fCurrentSelection;
- private IAddMemoryRenderingsTarget fActionDelegate;
- private IMenuCreator fMenuCreator;
- private IAdaptable fDebugContext;
- private IWorkbenchWindow fWindow;
- private DebugContextListener fDebugContextListener = new DebugContextListener();
-
- private class AddMemoryRenderingAction extends Action
- {
- private IMemoryRenderingType fRenderingType; // type of rendering to add
- AddMemoryRenderingAction(IMemoryRenderingType renderingType)
- {
- super(renderingType.getLabel());
- fRenderingType = renderingType;
- }
-
- public void runWithEvent(Event event) {
- if (fActionDelegate != null)
- {
- try {
- fActionDelegate.addMemoryRenderings(fPart, fCurrentSelection, new IMemoryRenderingType[]{fRenderingType});
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), ActionMessages.AddMemoryRenderingActionDelegate_0, ActionMessages.AddMemoryRenderingActionDelegate_1, e);
- }
- }
- }
- }
-
- private class AddMemoryRenderingMenuCreator implements IMenuCreator
- {
-
- public void dispose() {
-
- }
-
- public Menu getMenu(Control parent) {
- return null;
- }
-
- public Menu getMenu(Menu parent) {
- Menu menu = new Menu(parent);
- menu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- }
- });
- return menu;
- }
-
- private void fillMenu(Menu parent)
- {
- if (fActionDelegate != null)
- {
- IMemoryRenderingType[] types = fActionDelegate.getMemoryRenderingTypes(fPart, fCurrentSelection);
-
- for (int i=0; i<types.length; i++)
- {
- AddMemoryRenderingAction action = new AddMemoryRenderingAction(types[i]);
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(parent, -1);
- }
- }
- }
- }
-
- private class DebugContextListener implements IDebugContextListener
- {
-
- private void contextActivated(ISelection selection) {
- setupActionDelegate(selection);
- updateAction(fAction, fCurrentSelection);
-
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- contextActivated(event.getContext());
- }
-
-
- }
-
- private void setupActionDelegate(ISelection context)
- {
- IAdaptable debugContext = null;
- if (context instanceof IStructuredSelection)
- {
- if (((IStructuredSelection)context).getFirstElement() instanceof IAdaptable)
- debugContext = (IAdaptable)((IStructuredSelection)context).getFirstElement();
- }
-
- if (debugContext == null)
- fActionDelegate = null;
-
- if (debugContext == fDebugContext)
- return;
-
- fDebugContext = debugContext;
-
- if (fDebugContext == null)
- return;
-
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(fDebugContext);
-
- if (retrieval == null)
- return;
-
- IAddMemoryRenderingsTarget target = null;
- if (fCurrentSelection instanceof IStructuredSelection)
- {
- // get target from current selection
- IStructuredSelection strucSel = (IStructuredSelection)fCurrentSelection;
- Object obj = strucSel.getFirstElement();
- target = getAddMemoryRenderingTarget(obj);
- }
- if (target == null)
- {
- // get the target from Debug View
- target = getAddMemoryRenderingTarget(fDebugContext);
- }
- if (target == null)
- {
- // try to get target from memory block retrieval
- target = getAddMemoryRenderingTarget(retrieval);
- }
-
- fActionDelegate = target;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- bindPart(view);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- bindAction(action);
- fCurrentSelection = selection;
- updateAction(action, selection);
- }
-
- private void updateAction(IAction action, ISelection selection)
- {
- if (fActionDelegate != null)
- {
- action.setEnabled(fActionDelegate.canAddMemoryRenderings(fPart, selection));
- bindAction(action);
- }
- else
- {
- action.setEnabled(false);
- }
- }
-
- private void bindAction(IAction action) {
- if (action == null)
- return;
-
- if (action != fAction) {
- if (fMenuCreator == null)
- fMenuCreator = new AddMemoryRenderingMenuCreator();
- action.setMenuCreator(fMenuCreator);
- fAction= action;
- }
- }
-
- private IAddMemoryRenderingsTarget getAddMemoryRenderingTarget(Object elmt) {
- IAddMemoryRenderingsTarget target = null;
-
- if (elmt instanceof IAddMemoryRenderingsTarget)
- {
- target = (IAddMemoryRenderingsTarget)elmt;
- }
- else if (elmt instanceof IAdaptable)
- {
- target = (IAddMemoryRenderingsTarget)((IAdaptable)elmt).getAdapter(IAddMemoryRenderingsTarget.class);
- }
- return target;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- bindPart(targetEditor);
- bindAction(action);
- updateAction(action, fCurrentSelection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- bindPart(targetPart);
- bindAction(action);
- updateAction(action, fCurrentSelection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- bindAction(action);
- if (action != null)
- {
- action.setText(ActionMessages.AddMemoryRenderingActionDelegate_2);
- action.setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION));
- action.setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_MONITOR_EXPRESSION));
- action.setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_MONITOR_EXPRESSION));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- // remove as debug context listener
- fAction = null;
- fPart = null;
- fCurrentSelection = null;
- fActionDelegate = null;
-
- // remove debug context listener
- bindPart(null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- // do nothing
- }
-
- private void bindPart(IWorkbenchPart part)
- {
- IWorkbenchWindow window = null;
- if (part != null)
- {
- window = part.getSite().getWorkbenchWindow();
- }
- if (window != fWindow)
- {
-
- if (fWindow != null)
- {
- DebugUITools.getDebugContextManager().getContextService(fWindow).removeDebugContextListener(fDebugContextListener);
- }
-
- if (window != null)
- {
- DebugUITools.getDebugContextManager().getContextService(window).addDebugContextListener(fDebugContextListener);
- }
- fWindow = window;
- }
-
- if (part != fPart)
- fPart = part;
-
- if (fWindow != null)
- setupActionDelegate(DebugUITools.getDebugContextManager().getContextService(fWindow).getActiveContext());
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
deleted file mode 100644
index 368f8cc39..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 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.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.LaunchConfigurationAction;
-import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * An action delegate that builds a context menu with applicable launch shortcuts
- * for a specific launch mode.
- * <p>
- * This class can be sub-classed and contributed as an object contribution pop-up
- * menu extension action. When invoked, it becomes a sub-menu that dynamically
- * builds a list of applicable launch shortcuts for the current selection.
- * Each launch shortcut may have optional information to support a context menu action.
- * </p>
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 3.0
- */
-public abstract class ContextualLaunchAction implements IObjectActionDelegate, IMenuCreator {
-
- private IAction fDelegateAction;
- private String fMode;
- // default launch group for this mode (null category)
- private ILaunchGroup fGroup = null;
- // map of launch groups by (non-null) categories, for this mode
- private Map fGroupsByCategory = null;
- // whether to re-fill the menu (reset on selection change)
- private boolean fFillMenu = true;
-
- /**
- * Constructs a contextual launch action for the given launch mode.
- *
- * @param mode launch mode
- */
- public ContextualLaunchAction(String mode) {
- fMode = mode;
- ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
- fGroupsByCategory = new HashMap(3);
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup group = groups[i];
- if (group.getMode().equals(mode)) {
- if (group.getCategory() == null) {
- fGroup = group;
- } else {
- fGroupsByCategory.put(group.getCategory(), group);
- }
- }
- }
- }
-
- /*
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // We don't have a need for the active part.
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- // nothing to do
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- // never called
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- //Create the new menu. The menu will get filled when it is about to be shown. see fillMenu(Menu).
- Menu menu = new Menu(parent);
- /**
- * Add listener to re-populate the menu each time
- * it is shown because MenuManager.update(boolean, boolean)
- * doesn't dispose pull-down ActionContribution items for each popup menu.
- */
- menu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- if (fFillMenu) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- fFillMenu = false;
- }
- }
- });
- return menu;
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // Never called because we become a menu.
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- // if the selection is an IResource, save it and enable our action
- if (selection instanceof IStructuredSelection) {
- fFillMenu = true;
- if (fDelegateAction != action) {
- fDelegateAction = action;
- fDelegateAction.setMenuCreator(this);
- }
- //enable our menu
- action.setEnabled(true);
- return;
- }
- action.setEnabled(false);
- }
-
- /**
- * Returns the launch manager
- * @return the launch manager
- * @since 3.3
- */
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Fills the menu with applicable launch shortcuts
- * @param menu The menu to fill
- */
- protected void fillMenu(Menu menu) {
- IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
- int accelerator = 1;
- if(!ss.isEmpty()) {
- try {
- //try to add the shared config it the context is one.
- ILaunchConfiguration config = getLaunchConfigurationManager().isSharedConfig(ss.getFirstElement());
- if(config != null && config.exists() && config.supportsMode(fMode)) {
- IAction action = new LaunchConfigurationAction(config, fMode, config.getName(), DebugUITools.getDefaultImageDescriptor(config), accelerator++);
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(menu, -1);
- }
- }
- catch (CoreException ce) {}
- }
-
- List allShortCuts = getLaunchConfigurationManager().getLaunchShortcuts();
- Iterator iter = allShortCuts.iterator();
- List filteredShortCuts = new ArrayList(10);
-
- //create a context
- List selection = ss.toList();
- //in 3.4 we are correctly passing the IEditorPart and ISelection, so we have to perform
- //some sneekyness to make sure the IEditorInput is passed to the eval expressions
- //for backwards compatibility
- Object o = ss.getFirstElement();
- if(o instanceof IEditorPart) {
- selection.set(0, ((IEditorPart)o).getEditorInput());
- }
- IEvaluationContext context = new EvaluationContext(null, selection);
- context.setAllowPluginActivation(true);
- context.addVariable("selection", selection); //$NON-NLS-1$
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- try {
- if (!WorkbenchActivityHelper.filterItem(ext) && isApplicable(ext, context)) {
- filteredShortCuts.add(ext);
- }
- }
- catch (CoreException e) {}
- }
- iter = filteredShortCuts.iterator();
-
- //we need a separator iff the shared config entry has been added and there are following shortcuts
- if(menu.getItemCount() > 0 && filteredShortCuts.size() > 0) {
- new MenuItem(menu, SWT.SEPARATOR);
- }
- List categories = new ArrayList();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- Set modes = ext.getModes(); // supported launch modes
- Iterator modeIter = modes.iterator();
- while (modeIter.hasNext()) {
- String mode = (String) modeIter.next();
- if (mode.equals(fMode)) {
- String category = ext.getCategory();
- // NOTE: category can be null
- if (categories!= null && !categories.contains(category)) {
- categories.add(category);
- }
- populateMenuItem(mode, ext, menu, accelerator++);
- }
- }
- }
-
- // add in the open ... dialog shortcut(s)
- if (categories.isEmpty()) {
- if (accelerator > 1) {
- new MenuItem(menu, SWT.SEPARATOR);
- }
- IAction action = new OpenLaunchDialogAction(fGroup.getIdentifier());
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(menu, -1);
- } else {
- boolean addedSep = false;
- iter = categories.iterator();
- while (iter.hasNext()) {
- // NOTE: category can be null
- String category = (String) iter.next();
- ILaunchGroup group = fGroup;
- if (category != null) {
- group = (ILaunchGroup) fGroupsByCategory.get(category);
- }
- if (group != null) {
- if (accelerator > 1 && !addedSep) {
- new MenuItem(menu, SWT.SEPARATOR);
- addedSep = true;
- }
- IAction action = new OpenLaunchDialogAction(group.getIdentifier());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
- }
- }
-
- }
-
- /**
- * Evaluate the enablement logic in the contextualLaunch
- * element description. A true result means that we should
- * include this shortcut in the context menu.
- * @return true iff shortcut should appear in context menu
- */
- private boolean isApplicable(LaunchShortcutExtension ext, IEvaluationContext context) throws CoreException {
- Expression expr = ext.getContextualLaunchEnablementExpression();
- return ext.evalEnablementExpression(context, expr);
- }
-
- /**
- * Add the shortcut to the context menu's launch sub-menu.
- */
- private void populateMenuItem(String mode, LaunchShortcutExtension ext, Menu menu, int accelerator) {
- LaunchShortcutAction action = new LaunchShortcutAction(mode, ext);
- action.setActionDefinitionId(ext.getId() + "." + mode); //$NON-NLS-1$
- String helpContextId = ext.getHelpContextId();
- if (helpContextId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(action, helpContextId);
- }
- StringBuffer label= new StringBuffer();
- if (accelerator >= 0 && accelerator < 10) {
- //add the numerical accelerator
- label.append('&');
- label.append(accelerator);
- label.append(' ');
- }
- String contextLabel= ext.getContextLabel(mode);
- // replace default action label with context label if specified.
- label.append((contextLabel != null) ? contextLabel : action.getText());
- action.setText(label.toString());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
-
- /**
- * Returns the launch configuration manager.
- *
- * @return launch configuration manager
- */
- private LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
deleted file mode 100644
index 3423222e1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.actions;
-
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.actions.ExecutionAction;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Action to launch the last launch configuration that was successfully
- * launched, in debug mode. If no configurations have been launched, the launch
- * configuration dialog is opened.
- * <p>
- * This class may be instantiated.
- * </p>
- * @since 2.0
- */
-public final class DebugAction extends ExecutionAction {
-
- public DebugAction() {
- super(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
- }
-
- /**
- * @see ExecutionAction#getMode()
- */
- protected String getMode() {
- return ILaunchManager.DEBUG_MODE;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
deleted file mode 100644
index 7877022d3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 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.actions;
-
-import org.eclipse.debug.core.IRequest;
-import org.eclipse.debug.internal.ui.commands.actions.DebugCommandService;
-import org.eclipse.debug.internal.ui.commands.actions.ICommandParticipant;
-import org.eclipse.debug.internal.ui.commands.actions.IEnabledTarget;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Abstract base class for re-targeting actions which delegate execution to
- * {@link org.eclipse.debug.core.commands.IDebugCommandHandler} handlers.
- * The specific type of <code>IDebugCommandHandler</code> is determined by the
- * abstract {@link #getCommandType()} method.
- * <p>
- * This base class is an action which can be instantiated directly by views,
- * etc. In order to contribute an action using an extension point, a class
- * implementing {@link org.eclipse.ui.IActionDelegate} should be created first.
- * The delegate should then use a <code>DebugCommandAction</code> to implement
- * the needed functionality. The IActionDelegate must use {@link #setActionProxy(IAction)}
- * specifying the workbench's action that is a proxy to the action delegate. This
- * way, the workbench action can be updated visually as needed.<br>
- * Note: <code>IDebugCommandHandler</code> command typically act on the active
- * debug context as opposed to the active selection in view or window. The
- * action delegate should ignore the active window selection, and instead allow
- * the <code>DebugCommandAction</code> to update itself based on the active
- * debug context.
- * </p>
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see org.eclipse.debug.core.commands.IDebugCommandHandler
- * @since 3.6
- */
-public abstract class DebugCommandAction extends Action implements IDebugContextListener {
-
- private boolean fInitialized = false;
-
- /**
- * The window this action is working for.
- */
- private IWorkbenchWindow fWindow;
-
- /**
- * The part this action is working for, or <code>null</code> if global to
- * a window.
- */
- private IWorkbenchPart fPart;
-
- /**
- * Command service.
- */
- private DebugCommandService fUpdateService;
-
- /**
- * Delegate this action is working for or <code>null</code> if none.
- */
- private IAction fAction;
-
- private IEnabledTarget fEnabledTarget = new IEnabledTarget() {
- public void setEnabled(boolean enabled) {
- DebugCommandAction.this.setEnabled(enabled);
- }
- };
-
- /**
- * Constructor
- */
- public DebugCommandAction() {
- super();
- String helpContextId = getHelpContextId();
- if (helpContextId != null)
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, helpContextId);
- setEnabled(false);
- }
-
- /**
- * Sets the current workbench action that is a proxy to an {@link org.eclipse.ui.IActionDelegate}
- * that is using this action to perform its actual work. This only needs to be called when
- * an {@link org.eclipse.ui.IActionDelegate} is using one of these actions to perform its
- * function.
- *
- * @param action workbench proxy action
- */
- public void setActionProxy(IAction action) {
- fAction = action;
- fAction.setEnabled(isEnabled());
- }
-
- /**
- * Executes this action on the given target object
- *
- * @param target the target to perform the action on
- */
- private boolean execute(final Object[] targets) {
- return fUpdateService.executeCommand(
- getCommandType(), targets,
- new ICommandParticipant() {
- public void requestDone(org.eclipse.debug.core.IRequest request) {
- DebugCommandAction.this.postExecute(request, targets);
- }
- });
- }
-
- /**
- * This method is called after the completion of the execution of this
- * command. Extending classes may override this method to perform additional
- * operation after command execution.
- *
- * @param request The completed request object which was given to the
- * debug command handler.
- * @param targets Objects which were the targets of this action
- */
- protected void postExecute(IRequest request, Object[] targets) {
- // do nothing by default
- }
-
- /**
- * Returns the {@link org.eclipse.debug.core.commands.IDebugCommandHandler}
- * command handler that type this action executes.
- *
- * @return command class.
- *
- * @see org.eclipse.debug.core.commands.IDebugCommandHandler
- */
- abstract protected Class getCommandType();
-
- /**
- * @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- fUpdateService.postUpdateCommand(getCommandType(), fEnabledTarget);
- }
-
- /**
- * @see org.eclipse.jface.action.Action#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- synchronized (this) {
- if (!fInitialized) {
- fInitialized = true;
- notifyAll();
- }
- }
- super.setEnabled(enabled);
- if (fAction != null) {
- fAction.setEnabled(enabled);
- }
- }
-
- /**
- * Initializes this action for a specific part.
- *
- * @param part workbench part
- */
- public void init(IWorkbenchPart part) {
- fPart = part;
- fWindow = part.getSite().getWorkbenchWindow();
- fUpdateService = DebugCommandService.getService(fWindow);
- IDebugContextService service = getDebugContextService();
- String partId = part.getSite().getId();
- service.addDebugContextListener(this, partId);
- ISelection activeContext = service.getActiveContext(partId);
- if (activeContext != null) {
- fUpdateService.updateCommand(getCommandType(), fEnabledTarget);
- } else {
- setEnabled(getInitialEnablement());
- }
- }
-
- /**
- * Initializes the context action
- * @param window the window
- */
- public void init(IWorkbenchWindow window) {
- fWindow = window;
- fUpdateService = DebugCommandService.getService(fWindow);
- IDebugContextService contextService = getDebugContextService();
- contextService.addDebugContextListener(this);
- ISelection activeContext = contextService.getActiveContext();
- if (activeContext != null) {
- fUpdateService.updateCommand(getCommandType(), fEnabledTarget);
- } else {
- setEnabled(getInitialEnablement());
- }
- }
-
- /**
- * Returns whether this action should be enabled when initialized
- * and there is no active debug context. By default, <code>false</code>
- * is returned.
- *
- * @return initial enabled state when there is no active context.
- */
- protected boolean getInitialEnablement() {
- return false;
- }
-
- /**
- * Returns the context this action operates on as a selection.
- *
- * @return the context this action operates on
- */
- private ISelection getContext() {
- if (fPart != null) {
- getDebugContextService().getActiveContext(fPart.getSite().getId());
- }
- return getDebugContextService().getActiveContext();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- synchronized (this) {
- if (!fInitialized) {
- try {
- wait();
- } catch (InterruptedException e) {
- }
- }
- }
-
- ISelection selection = getContext();
- if (selection instanceof IStructuredSelection && isEnabled()) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- boolean enabled = execute(ss.toArray());
- // disable the action according to the command
- setEnabled(enabled);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- run();
- }
-
- /**
- * Clean up when removing
- */
- public void dispose() {
- IDebugContextService service = getDebugContextService();
- if (fPart != null) {
- service.removeDebugContextListener(this, fPart.getSite().getId());
- } else {
- service.removeDebugContextListener(this);
- }
- fWindow = null;
- fPart = null;
- }
-
- /**
- * Returns the context service this action linked to. By default, this actions is
- * associated with the context service for the window this action is operating in.
- *
- * @return associated context service
- */
- protected IDebugContextService getDebugContextService() {
- return DebugUITools.getDebugContextManager().getContextService(fWindow);
- }
-
- /**
- * Returns the help context id for this action or <code>null</code> if none.
- *
- * @return The help context id for this action or <code>null</code>
- */
- public abstract String getHelpContextId();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getId()
- */
- public abstract String getId();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getText()
- */
- public abstract String getText();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getToolTipText()
- */
- public abstract String getToolTipText();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
- */
- public abstract ImageDescriptor getDisabledImageDescriptor();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getHoverImageDescriptor()
- */
- public abstract ImageDescriptor getHoverImageDescriptor();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getImageDescriptor()
- */
- public abstract ImageDescriptor getImageDescriptor();
-
- /**
- * Returns the workbench proxy associated with this action or <code>null</code>
- * if none. This is the workbench proxy to an {@link org.eclipse.ui.IActionDelegate}
- * that is using this action to perform its actual work. This is only used when
- * an {@link org.eclipse.ui.IActionDelegate} is using one of these actions to perform its
- * function.
- *
- * @return workbench proxy action or <code>null</code>
- */
- protected IAction getActionProxy() {
- return fAction;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
deleted file mode 100644
index 5ec94d494..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.actions;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.HandlerEvent;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.debug.core.IRequest;
-import org.eclipse.debug.internal.ui.commands.actions.DebugCommandService;
-import org.eclipse.debug.internal.ui.commands.actions.ICommandParticipant;
-import org.eclipse.debug.internal.ui.commands.actions.IEnabledTarget;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Abstract base class for re-targeting command framework handlers, which
- * delegate execution to {@link org.eclipse.debug.core.commands.IDebugCommandHandler}
- * handlers. The specific type of <code>IDebugCommandHandler</code> is
- * determined by the abstract {@link #getCommandType()} method.
- *
- * <p> Note: This class is not an implementation of the <code>IDebugCommandHandler</code>
- * interface, which was somewhat unfortunately named. <code>IDebugCommandHandler</code>
- * is an interface that used only by the debugger plug-ins. This class implements
- * {@link org.eclipse.core.commands.IHandler} interface and is to be used with the
- * platform commands framework. </p>
- *
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see org.eclipse.debug.core.commands.IDebugCommandHandler
- * @see org.eclipse.core.commands.IHandler
- *
- * @since 3.6
- */
-public abstract class DebugCommandHandler extends AbstractHandler {
-
- /**
- * The DebugCommandService is able to evaluate the command handler
- * enablement in each workbench window separately, however the workbench
- * command framework uses only a single handler instance for all windows.
- * This IEnabledTarget implementation tracks enablement of the command
- * for a given window. When the handler enablement is tested, the
- * currently active window is used to determine which enabled target
- * to use.
- */
- private class EnabledTarget implements IEnabledTarget, IDebugContextListener {
- boolean fEnabled = getInitialEnablement();
- IWorkbenchWindow fWindow;
-
- EnabledTarget(IWorkbenchWindow window) {
- fWindow = window;
- DebugCommandService.getService(fWindow).updateCommand(getCommandType(), this);
- getContextService(fWindow).addDebugContextListener(this);
- }
-
- public void setEnabled(boolean enabled) {
- boolean oldEnabled = fEnabled;
- fEnabled = enabled;
- if (fEnabled != oldEnabled && fCurrentEnabledTarget == this) {
- fireHandlerChanged(new HandlerEvent(DebugCommandHandler.this, true, false));
- }
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- DebugCommandService.getService(fWindow).postUpdateCommand(getCommandType(), this);
- }
-
- void dispose() {
- if (isDisposed()) {
- return;
- }
- getContextService(fWindow).removeDebugContextListener(this);
- fWindow = null;
- }
-
- boolean isDisposed() {
- return fWindow == null;
- }
- }
-
- /**
- * Window listener is used to make sure that the handler enablement
- * is updated when the active workbench window is changed.
- */
- private IWindowListener fWindowListener = new IWindowListener() {
-
- public void windowOpened(IWorkbenchWindow w) {
- }
-
- public void windowDeactivated(IWorkbenchWindow w) {
- }
-
- public void windowClosed(IWorkbenchWindow w) {
- EnabledTarget enabledTarget = (EnabledTarget)fEnabledTargetsMap.get(w);
- if (enabledTarget != null) {
- enabledTarget.dispose();
- }
- }
-
- public void windowActivated(IWorkbenchWindow w) {
- fCurrentEnabledTarget = (EnabledTarget)fEnabledTargetsMap.get(w);
- fireHandlerChanged(new HandlerEvent(DebugCommandHandler.this, true, false));
- }
- };
-
- /**
- * Map of enabled targets keyed by workbench window.
- */
- private Map fEnabledTargetsMap = new WeakHashMap();
-
- /**
- * The current enabled target, based on the active
- * workbench window.
- */
- private EnabledTarget fCurrentEnabledTarget = null;
-
- /**
- * The constructor adds the handler as the
- */
- public DebugCommandHandler() {
- super();
- PlatformUI.getWorkbench().addWindowListener(fWindowListener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
- */
- public void setEnabled(Object evaluationContext) {
- // This method is called with the current evaluation context
- // just prior to the isEnabled() being called. Check the active
- // window and update the current enabled target based on it
- fCurrentEnabledTarget = null;
-
- if (!(evaluationContext instanceof IEvaluationContext)) {
- return;
- }
- IEvaluationContext context = (IEvaluationContext) evaluationContext;
- Object _window = context.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
- if (_window instanceof IWorkbenchWindow) {
- IWorkbenchWindow window = (IWorkbenchWindow)_window;
- fCurrentEnabledTarget = getEnabledTarget(window);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- */
- public boolean isEnabled() {
- if (fCurrentEnabledTarget == null) {
- return false;
- }
- return fCurrentEnabledTarget.fEnabled;
- }
-
- private EnabledTarget getEnabledTarget(IWorkbenchWindow window) {
- EnabledTarget target = (EnabledTarget)fEnabledTargetsMap.get(window);
- if (target == null) {
- target = new EnabledTarget(window);
- fEnabledTargetsMap.put(window, target);
- }
- return target;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
- if (window == null) {
- throw new ExecutionException("No active workbench window."); //$NON-NLS-1$
- }
- fCurrentEnabledTarget = getEnabledTarget(window);
-
- ISelection selection = getContextService(window).getActiveContext();
- if (selection instanceof IStructuredSelection && isEnabled()) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- boolean enabledAfterExecute = execute(window, ss.toArray());
-
- // enable/disable the action according to the command
- fCurrentEnabledTarget.setEnabled(enabledAfterExecute);
- }
-
- return null;
- }
-
- private IDebugContextService getContextService(IWorkbenchWindow window) {
- return DebugUITools.getDebugContextManager().getContextService(window);
- }
-
- /**
- * Executes this action on the given target object
- *
- * @param target the target to perform the action on
- */
- private boolean execute(IWorkbenchWindow window, final Object[] targets) {
- DebugCommandService service = DebugCommandService.getService(window);
- return service.executeCommand(
- getCommandType(), targets,
- new ICommandParticipant() {
- public void requestDone(org.eclipse.debug.core.IRequest request) {
- DebugCommandHandler.this.postExecute(request, targets);
- }
- });
- }
-
- /**
- * This method is called after the completion of the execution of this
- * command. Extending classes may override this method to perform additional
- * operation after command execution.
- *
- * @param request The completed request object which was given the the
- * debug command handler.
- * @param targets Objects which were the targets of this action
- */
- protected void postExecute(IRequest request, Object[] targets) {
- // do nothing by default
- }
-
- /**
- * Returns the {@link org.eclipse.debug.core.commands.IDebugCommandHandler}
- * command handler that type this action executes.
- *
- * @return command class.
- *
- * @see org.eclipse.debug.core.commands.IDebugCommandHandler
- */
- abstract protected Class getCommandType();
-
-
- /**
- * Returns whether this action should be enabled when initialized
- * and there is no active debug context.
- *
- * @return false, by default
- */
- protected boolean getInitialEnablement() {
- return false;
- }
-
-
- /**
- * Clean up when removing
- */
- public void dispose() {
- PlatformUI.getWorkbench().removeWindowListener(fWindowListener);
- for (Iterator itr = fEnabledTargetsMap.values().iterator(); itr.hasNext();) {
- EnabledTarget target = (EnabledTarget)itr.next();
- if (!target.isDisposed()) {
- target.dispose();
- }
- }
- fEnabledTargetsMap.clear();
- fCurrentEnabledTarget = null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
deleted file mode 100644
index 4ab6983ec..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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.actions;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.IImportExportConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.ImportExportMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.XMLMemento;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Exports breakpoints to a file or string buffer.
- * <p>
- * This class may be instantiated.
- * <p>
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class ExportBreakpointsOperation implements IRunnableWithProgress {
-
- private IBreakpoint[] fBreakpoints = null;
- /**
- * Only one of file name or writer is used depending how the operation is
- * created.
- */
- private String fFileName = null;
- private StringWriter fWriter = null;
-
- /**
- * Constructs an operation to export breakpoints to a file.
- *
- * @param breakpoints the breakpoints to export
- * @param fileName absolute path of file to export breakpoints to - the file
- * will be overwritten if it already exists
- */
- public ExportBreakpointsOperation(IBreakpoint[] breakpoints, String fileName) {
- fBreakpoints = breakpoints;
- fFileName = fileName;
- }
-
- /**
- * Constructs an operation to export breakpoints to a string buffer. The buffer
- * is available after the operation is run via {@link #getBuffer()}.
- *
- * @param breakpoints the breakpoints to export
- * @since 3.5
- */
- public ExportBreakpointsOperation(IBreakpoint[] breakpoints) {
- fBreakpoints = breakpoints;
- fWriter = new StringWriter();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- SubMonitor localmonitor = SubMonitor.convert(monitor, ImportExportMessages.ExportOperation_0, fBreakpoints.length);
- XMLMemento memento = XMLMemento.createWriteRoot(IImportExportConstants.IE_NODE_BREAKPOINTS);
- Writer writer = fWriter;
- try {
- for (int i = 0; i < fBreakpoints.length; i++) {
- if(localmonitor.isCanceled()) {
- return;
- }
- IBreakpoint breakpoint = fBreakpoints[i];
- //in the event we are in working set view, we can have multiple selection of the same breakpoint
- //so do a simple check for it
- IMarker marker = breakpoint.getMarker();
- IMemento root = memento.createChild(IImportExportConstants.IE_NODE_BREAKPOINT);
- root.putString(IImportExportConstants.IE_BP_ENABLED, Boolean.toString(breakpoint.isEnabled()));
- root.putString(IImportExportConstants.IE_BP_REGISTERED, Boolean.toString(breakpoint.isRegistered()));
- root.putString(IImportExportConstants.IE_BP_PERSISTANT, Boolean.toString(breakpoint.isPersisted()));
- //write out the resource information
- IResource resource = marker.getResource();
- IMemento child = root.createChild(IImportExportConstants.IE_NODE_RESOURCE);
- child.putString(IImportExportConstants.IE_NODE_PATH, resource.getFullPath().toPortableString());
- child.putInteger(IImportExportConstants.IE_NODE_TYPE, resource.getType());
- //a generalized (name, value) pairing for attributes each stored as an ATTRIB element
- root = root.createChild(IImportExportConstants.IE_NODE_MARKER);
- root.putString(IImportExportConstants.IE_NODE_TYPE, marker.getType());
- Object val = marker.getAttribute(IMarker.LINE_NUMBER);
- root.putString(IMarker.LINE_NUMBER, (val != null) ? val.toString() : null);
- val = marker.getAttribute(IImportExportConstants.CHARSTART);
- root.putString(IImportExportConstants.CHARSTART, (val != null) ? val.toString() : null);
- String value = null;
- boolean wsattrib = false;
- for(java.util.Iterator iter = marker.getAttributes().keySet().iterator(); iter.hasNext();) {
- String iterval = iter.next().toString();
- value = marker.getAttribute(iterval).toString();
- if(!iterval.equals(IMarker.LINE_NUMBER)) {
- child = root.createChild(IImportExportConstants.IE_NODE_ATTRIB);
- if(iterval.equals(IInternalDebugUIConstants.WORKING_SET_NAME)) {
- wsattrib = true;
- value = getWorkingSetsAttribute(breakpoint);
- }
- child.putString(IImportExportConstants.IE_NODE_NAME, iterval);
- child.putString(IImportExportConstants.IE_NODE_VALUE, value);
- }
- }
- if(!wsattrib) {
- //ensure the working set infos are present if not previously updated
- child = root.createChild(IImportExportConstants.IE_NODE_ATTRIB);
- child.putString(IImportExportConstants.IE_NODE_NAME, IInternalDebugUIConstants.WORKING_SET_NAME);
- child.putString(IImportExportConstants.IE_NODE_VALUE, getWorkingSetsAttribute(breakpoint));
- child = root.createChild(IImportExportConstants.IE_NODE_ATTRIB);
- child.putString(IImportExportConstants.IE_NODE_NAME, IInternalDebugUIConstants.WORKING_SET_ID);
- child.putString(IImportExportConstants.IE_NODE_VALUE, IDebugUIConstants.BREAKPOINT_WORKINGSET_ID);
- }
- localmonitor.worked(1);
- }
- if (writer == null) {
- writer = new OutputStreamWriter(new FileOutputStream(fFileName), "UTF-8"); //$NON-NLS-1$
- }
- memento.save(writer);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- } catch (IOException e) {
- throw new InvocationTargetException(e,
- MessageFormat.format("There was a problem writing file: {0}", new String[] {fFileName})); //$NON-NLS-1$
- }
- finally {
- localmonitor.done();
- if(writer != null) {
- try {
- writer.close();
- } catch (IOException e) {
- throw new InvocationTargetException(e);
- }
- }
- }
- }
-
- /**
- * Collects all of the breakpoint working sets that contain the given {@link IBreakpoint}
- * in the given list
- *
- * @param breakpoint
- * @param collector
- * @since 3.5
- */
- private String getWorkingSetsAttribute(IBreakpoint breakpoint) {
- IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
- StringBuffer buffer = new StringBuffer();
- IWorkingSet[] sets = mgr.getWorkingSets();
- for (int i = 0; i < sets.length; i++) {
- if(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(sets[i].getId()) &&
- containsBreakpoint(sets[i], breakpoint)) {
- buffer.append(IImportExportConstants.DELIMITER).append(sets[i].getName());
- }
- }
- return buffer.toString();
- }
-
- /**
- * Method to ensure markers and breakpoints are not both added to the working set
- * @param set the set to check
- * @param breakpoint the breakpoint to check for existence
- * @return true if it is present false otherwise
- * @since 3.5
- */
- private boolean containsBreakpoint(IWorkingSet set, IBreakpoint breakpoint) {
- IAdaptable[] elements = set.getElements();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].equals(breakpoint)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns a string buffer containing a memento of the exported breakpoints
- * or <code>null</code> if the operation was configured to export to a file.
- * The memento can be used to import breakpoints into the workspace using an
- * {@link ImportBreakpointsOperation}.
- *
- * @return a string buffer containing a memento of the exported breakpoints
- * or <code>null</code> if the operation was configured to export to a file
- * @since 3.5
- */
- public StringBuffer getBuffer() {
- if (fWriter != null) {
- return fWriter.getBuffer();
- }
- return null;
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryBlocksTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryBlocksTarget.java
deleted file mode 100644
index aad493cb1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryBlocksTarget.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * An adapter for an "add memory block" operation. The Memory View provides
- * a retargettable "add memory block" action that debuggers may plug into
- * by providing an adapter (see <code>IAdaptable</code>) of this type.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.2
- */
-public interface IAddMemoryBlocksTarget {
-
- /**
- * Returns whether an add memory block operation can be performed from the specified
- * part and the given selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection the selection on which the action has been invoked
- * @throws CoreException if unable to perform the action
- */
- public boolean canAddMemoryBlocks(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether this target will support adding memory block from the specified
- * part.
- * @param part
- * @return true if the target wants to support adding memory block from the given
- * part, false otherwise.
- */
- public boolean supportsAddMemoryBlocks(IWorkbenchPart part);
-
-
- /**
- * Perform an add memory block on the given element that is
- * currently selected in the Debug view. If a memory block can be successfully
- * created, implementations must add the resulted memory block to <code>IMemoryBlockManager</code>
- * In addition, implementations must query to see if default renderings should be created
- * for the given memory block and add these renderings accordingly.
- *
- * @param part the part on which the action has been invoked
- * @param selection the selection on which the action has been invoked
- * @throws CoreException if unable to perform the action
- *
- * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager
- * @see org.eclipse.debug.core.IMemoryBlockManager
- */
- public void addMemoryBlocks(IWorkbenchPart part, ISelection selection) throws CoreException;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryRenderingsTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryRenderingsTarget.java
deleted file mode 100644
index 5d912ffa6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryRenderingsTarget.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Adapter for the platform's retargettable "add memory rendering" action.
- * Clients implementing this adapter are expected to add the necessary memory blocks
- * and renderings when the adapter is invoked.
- * <p>
- * Typically, to add a memory rendering, client needs to do the following:
- * <ol>
- * <li>Create a new memory block</li>
- * <li>Add the new memory block to the Memory Block Manager. (<code>IMemoryBlockManager</code>)</li>
- * <li>Create the new rendering from <code>IMemoryRenderingTypeDelegate</code></li>
- * <li>Bring the required memory view to the top. (<code>IMemoryRenderingSite</code>)</li>
- * <li>Find the container from the memory view to host the new memory rendering.
- * (<code>IMemoryRenderingContainer</code>)</li>
- * <li>Initialize the new rendering with the appropriate memory block and container.</li>
- * <li>Add the new rendering to the container.</li>
- * </ol>
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.2
- * @see AddMemoryRenderingActionDelegate
- */
-public interface IAddMemoryRenderingsTarget {
- /**
- * Returns whether a memory rendering can be added from the specified
- * part, based on the the given selection, which is the active debug context
- * in the current workbench window.
- *
- * @param part the part on which the action has been invoked
- * @param selection the active debug context in the active workbench window
- * @throws CoreException if an error has occurred
- */
- public boolean canAddMemoryRenderings(IWorkbenchPart part, ISelection selection);
-
- /**
- * Adds memory renderings. Based on the part and selection (active debug context), this
- * adapter does the following:
- * <ol>
- * <li>creates and adds the required memory block to the memory block manager</li>
- * <li>creates the specified renderings and add the them
- * to the appropriate memory rendering containers</li>
- * </ol>
- * @param part the part on which the action has been invoked
- * @param selection the active debug context
- * @param renderingTypes renderings to add
- * @throws CoreException if unable to perform the action
- *
- * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager
- * @see org.eclipse.debug.core.IMemoryBlockManager
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSite
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingContainer
- */
- public void addMemoryRenderings(IWorkbenchPart part, ISelection selection, IMemoryRenderingType[] renderingTypes) throws CoreException;
-
- /**
- * Returns a list of rendering types that can be added from the given workbench part and active
- * debug context, possibly empty.
- *
- * @param part the part on which the action has been invoked
- * @param selection the active debug context
- * @return a list of rendering types that can be added, possibly empty
- */
- public IMemoryRenderingType[] getMemoryRenderingTypes(IWorkbenchPart part, ISelection selection);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ILaunchable.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ILaunchable.java
deleted file mode 100644
index 1fa3abc19..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ILaunchable.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.actions;
-
-/**
- * Interface used to tag objects as launchable. Objects that provide
- * an adapter of this type will be considered by the contextual
- * launch support.
- * <p>
- * Clients may contribute an adapter of this type for launchable objects
- * via the <code>org.eclipse.core.runtime.adapters</code> extension
- * point. A factory and implementation of this interface are not actually
- * required.
- * </p>
- * @see org.eclipse.debug.ui.actions.ContextualLaunchAction
- * @since 3.0
- */
-public interface ILaunchable {
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IRunToLineTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IRunToLineTarget.java
deleted file mode 100644
index 234c6fde8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IRunToLineTarget.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * An adapter for a "run to line" operation. The debug platform provides
- * a retargettable "run to line" action that debuggers may plug into
- * by providing an adapter (see <code>IAdaptable</code>) of this type.
- * This allows the platform to provide one command and key binding for
- * the "run to line" function to be shared by many debuggers.
- * <p>
- * When a part is activated, a retargettable action asks the part
- * for its <code>IRunToLineTarget</code> adapter. If one exists,
- * that adapter is delegated to to perform "run to line" operations when
- * the user invokes an associated action. If an adapter does not exist
- * for the part, the retargettable actions asks selected objects in the
- * active part for an adapter. Generally, a debug implementation will
- * provide breakpoint adapters for relevant editors and model objects.
- * </p>
- * <p>
- * Clients are intended to implement this interface and provide instances as
- * an adapter on applicable parts (for example, editors) that support the
- * operation.
- * </p>
- * @since 3.0
- */
-public interface IRunToLineTarget {
-
- /**
- * Perform a run to line operation on the given element that is
- * currently selected and suspended in the Debug view. Implementations
- * must honor the user preference of whether to skip breakpoints
- * during the operation -
- * see <code>IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE</code>.
- *
- * @param part the part on which the action has been invoked
- * @param selection the selection on which the action has been invoked
- * @param target suspended element to perform the "run to line" action on
- * @throws CoreException if unable to perform the action
- */
- public void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException;
-
- /**
- * Returns whether a run to line operation can be performed on the given
- * element that is currently selected and suspended in the Debug view.
- *
- * @param part the part on which the action has been invoked
- * @param selection the selection on which the action has been invoked
- * @param target suspended element to perform the "run to line" action on
- * @throws CoreException if unable to perform the action
- */
- public boolean canRunToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTarget.java
deleted file mode 100644
index c0f9c8bf7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTarget.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * An adapter to support breakpoint creation/deletion for an active part
- * or selection within an active part. The debug platform provides
- * retargettable actions for toggling line breakpoints, method breakpoints,
- * and watchpoints. A debug implementation can plug into the global actions
- * by providing an adapter of this type on relevant parts and objects.
- * The debug platform provides one command and key binding for each breakpoint
- * operation.
- * <p>
- * When a part is activated, a retargettable action asks the part
- * for its <code>IToggleBreakpointTarget</code> adapter. If one exists,
- * that adapter is delegated to to perform breakpoint operations when
- * the user invokes an associated action. If an adapter does not exist
- * for the part, the retargettable actions asks selected objects in the
- * active part for an adapter. Generally, a debug implementation will
- * provide breakpoint adapters for relevant editors and model objects.
- * </p>
- * <p>
- * Clients are intended to implement this interface and provide instances as
- * an adapter on applicable parts (for example, editors) and objects (for
- * example, methods and fields) that support breakpoint toggling.
- * </p>
- * @since 3.0
- */
-public interface IToggleBreakpointsTarget {
-
- /**
- * Creates new line breakpoints or removes existing breakpoints.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which line breakpoints should be toggled
- * @throws CoreException if unable to perform the action
- */
- public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether line breakpoints can be toggled on the given selection.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which line breakpoints may be toggled
- * @return whether line breakpoints can be toggled on the given selection
- */
- public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection);
-
- /**
- * Creates new method breakpoints or removes existing breakpoints.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which method breakpoints should be toggled
- * @throws CoreException if unable to perform the action
- */
- public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether method breakpoints can be toggled on the given selection.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which method breakpoints may be toggled
- * @return whether method breakpoints can be toggled on the given selection
- */
- public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection);
-
- /**
- * Creates new watchpoints or removes existing breakpoints.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which watchpoints should be toggled
- * @throws CoreException if unable to perform the action
- */
- public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether watchpoints can be toggled on the given selection.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which watchpoints may be toggled
- * @return whether watchpoints can be toggled on the given selection
- */
- public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension.java
deleted file mode 100644
index 99e7e0879..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Extension interface for {@link org.eclipse.debug.ui.actions.IToggleBreakpointsTarget}.
- * This interface provides the ability to selectively create any type of breakpoint
- * when invoked, rather than a specific type of breakpoint (for example, a line
- * breakpoint). This allows targets to choose the type of breakpoint to create
- * when the user double-clicks in the vertical ruler.
- * <p>
- * Clients implementing <code>IToggleBreakpointsTarget</code> may optionally
- * implement this interface.
- * </p>
- * @since 3.1
- * @see org.eclipse.debug.ui.actions.ToggleBreakpointAction
- */
-public interface IToggleBreakpointsTargetExtension extends IToggleBreakpointsTarget {
-
- /**
- * Creates new line breakpoints or removes existing breakpoints.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which line breakpoints should be toggled
- * @throws CoreException if unable to perform the action
- */
- public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether line breakpoints can be toggled on the given selection.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which line breakpoints may be toggled
- * @return whether line breakpoints can be toggled on the given selection
- */
- public boolean canToggleBreakpoints(IWorkbenchPart part, ISelection selection);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java
deleted file mode 100644
index cb644d3e0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems 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
- * Wind River Systems - adapted to use with IToggleBreakpiontsTargetFactory extension
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import java.util.Set;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * A toggle breakpoints target factory creates one or more toggle breakpoint
- * targets. The toggle breakpoints targets are used by toggle breakpoint actions
- * to create breakpoints appropriate for the active editor, debug session, project,
- * or selection.
- *
- * <p>
- * Toggle breakpoints target factories are contributed via the
- * <code>org.eclipse.debug.ui.toggleBreakpointsTargetFactories</code>
- * extension point. Following is an example of a detail pane factory extension:
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.toggleBreakpointsTargetFactories"&gt;
- * &lt;toggleTargetFactory
- * id="com.example.ExampleBreakpointToggleTargetFactory"
- * class="com.example.BreakpointToggleTargetFactory"&gt;
- * &lt;enablement&gt;
- * &lt;!-- Test the active debug context. Enable only if the active context
- * is an element from "Example" debugger, or if there is no debug context
- * associated with the context element. Also enable if debug context is
- * empty --&gt;
- * &lt;with variable="debugContext"&gt;
- * &lt;iterate&gt;
- * &lt;or&gt;
- * &lt;test property="org.eclipse.debug.ui.getModelIdentifier" value="com.example.model"/&gt;
- * &lt;test property="org.eclipse.debug.ui.getModelIdentifier" value=""/&gt;
- * &lt;/or&gt;
- * &lt;/iterate&gt;
- * &lt;/with&gt;
- * &lt;!-- If there is no active debug context. Enable the breakpoint toggle for
- * the "Example" editors --&gt;
- * &lt;instanceof value="com.example.Editor"/&gt;
- * &lt;/enablement&gt;
- * &lt;/toggleTargetFactory&gt;
- * &lt;/extension&gt;
- * </pre>
- * </p>
- * <p>
- * <p>
- * Clients contributing a toggle breakpoints target factory are intended to
- * implement this interface.
- *
- * @see IToggleBreakpointsTarget
- * @see IToggleBreakpointsTargetExtension
- * @see org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager
- * @since 3.5
- */
-public interface IToggleBreakpointsTargetFactory {
- /**
- * Returns all possible types of toggle breakpoints targets that this
- * factory can create for the given selection and part, possibly empty.
- * Toggle breakpoints targets are returned as a set of IDs.
- *
- * @param part The active part.
- * @param selection The current selection
- * @return Set of <code>String</code> IDs for possible toggle breakpoint
- * targets, possibly empty
- */
- public Set getToggleTargets(IWorkbenchPart part, ISelection selection);
-
- /**
- * Returns the identifier of the default toggle breakpoints target to use
- * for the given selection, or <code>null</code> if this factory has no
- * preference.
- *
- * @param part The active part.
- * @param selection The current selection
- * @return a breakpoint toggle target identifier or <code>null</code>
- */
- public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection);
-
- /**
- * Creates and returns a toggle breakpoint target corresponding to the
- * given identifier that this factory can produce (according to
- * {@link #getToggleTargets}).
- *
- * @param targetID The id of the toggle target to be created
- * @return toggle target or <code>null</code> if one could not be created
- */
- public IToggleBreakpointsTarget createToggleTarget(String targetID);
-
- /**
- * Returns a human readable name for the breakpoint toggle target associated with the
- * given ID. Used to populate the context menu with meaningful names of the types of
- * breakpoints created by the given target.
- *
- * @param targetID toggle breakpoints target identifier
- * @return toggle target name
- */
- public String getToggleTargetName(String targetID);
-
- /**
- * Returns a description for the breakpoint toggle target associated with the
- * given ID or <code>null</code> if none.
- *
- * @param targetID toggle breakpoints target identifier
- * @return toggle target name or <code>null</code> if none
- */
- public String getToggleTargetDescription(String targetID);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java
deleted file mode 100644
index 0fc8f9813..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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 implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * A variable value editor allows the user to edit a variable's value.
- * Variable value editors are contributed for a debug model via the
- * <code>org.eclipse.debug.ui.variableValueEditors</code> extension point.
- * <p>
- * Following is example plug-in XML for contributing a variable value editor.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.variableValueEditors"&gt;
- * &lt;variableEditor
- * modelId="com.examples.myDebugModel"
- * class="com.examples.variables.MyVariableValueEditor"/&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>modelId</code> the debug model identifier for which the given
- * variable value editor is applicable</li>
- * <li><code>class</code> fully qualified name of a class that implements
- * {@link IVariableValueEditor}</li>
- * </ul>
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.1
- */
-public interface IVariableValueEditor {
-
- /**
- * Edits the given variable, if appropriate. If this editor does not apply to
- * the given variable this method returns false, which indicates that the
- * Debug Platform's default variable edit dialog should be used.
- *
- * @param variable the variable to edit
- * @param shell the currently active shell, which can be used to open a dialog
- * for the user
- * @return whether this editor has completed the edit operation for the given variable.
- * <code>true</code> if no more work should be done, <code>false</code> if the debug
- * platform should prompt the user to edit the given variable using the default
- * variable editor
- */
- public boolean editVariable(IVariable variable, Shell shell);
-
- /**
- * Saves the given expression to the given variable, if appropriate. If this
- * editor does not set the given variable's value from the given expression, this
- * method returns false. Returning false indicates that the Debug Platform should
- * perform the default operation to set a variable's value based on a String.
- *
- * @param variable the variable to edit
- * @param expression the expression to assign to the given variable
- * @param shell the currently active shell, which can be used to report errors to the
- * user. May be <code>null</code> if no active shell could be found.
- * @return whether this editor has completed the save operation for the given variable.
- * <code>true</code> if no more work should be done, <code>false</code> if the debug
- * platform should perform the default save operation
- */
- public boolean saveVariable(IVariable variable, String expression, Shell shell);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter.java
deleted file mode 100644
index d6199cdfb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * 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.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IVariable;
-
-/**
- * An optional adapter used to create a watch expression for a selected variable.
- * <p>
- * The 'Create Watch Expression' action is enabled for instances of
- * {@link org.eclipse.debug.core.model.IVariable} that have an associated
- * {@link org.eclipse.debug.core.model.IWatchExpressionDelegate} registered
- * for that debug model.
- * When a watch expression factory adapter is available for a variable, the factory is
- * consulted to create a watch expression for that variable. When no adapter is provided,
- * the watch expression is generated based on the variable's name.
- * </p>
- * <p>
- * Also see the optional interface {@link IWatchExpressionFactoryAdapterExtension}.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.2
- */
-public interface IWatchExpressionFactoryAdapter {
-
- /**
- * Creates and returns an expression for the specified variable
- * which is used to created an {@link org.eclipse.debug.core.model.IWatchExpression}.
- *
- * @param variable variable a watch expression is required for
- * @return text used to create a watch expression
- * @exception org.eclipse.core.runtime.CoreException if unable to create a watch
- * expression
- */
- public String createWatchExpression(IVariable variable) throws CoreException;
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java
deleted file mode 100644
index 552d1eb8b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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
- * Wind River Systems - integration with non-standard debug models (Bug 209883)
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * An optional adapter used to create a watch expression for a selected element.
- * <p>
- * The 'Create Watch Expression' action is enabled for an adaptable element
- * that have an associated <code>IWatchExpressionFactoryAdapter2</code>.
- *
- * When a watch expression factory adapter is available for an element, the factory is
- * consulted to create a watch expression for that element.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.4
- */
-public interface IWatchExpressionFactoryAdapter2 {
-
- /**
- * Creates and returns an expression for the specified variable
- * which is used to created an {@link org.eclipse.debug.core.model.IWatchExpression}.
- *
- * @param element element a watch expression is required for
- * @return text used to create a watch expression
- * @exception org.eclipse.core.runtime.CoreException if unable to create a watch
- * expression
- */
- public String createWatchExpression(Object element) throws CoreException;
-
- /**
- * Returns whether a watch expression can be created for the specified variable.
- *
- * @param variable the specified variable
- * @return whether an expression can be created
- * @exception org.eclipse.core.runtime.CoreException if unable to create a watch
- * expression
- */
- public boolean canCreateWatchExpression(Object variable);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapterExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapterExtension.java
deleted file mode 100644
index fd277f1aa..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapterExtension.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * 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.actions;
-
-import org.eclipse.debug.core.model.IVariable;
-
-/**
- * Optional extension to the watch expression factory adapter to dynamically enable the
- * 'Create Watch Expression' action, based on the selected variable.
- * <p>
- * By default, the 'Create Watch Expression' action is enabled for instances of
- * {@link org.eclipse.debug.core.model.IVariable} that have an associated
- * {@link org.eclipse.debug.core.model.IWatchExpressionDelegate} registered
- * for that debug model.
- * When a watch expression factory adapter is available for a variable that implements
- * this interface, the factory is consulted to enable the action.
- * </p>
- * <p>
- * Clients may implementing {@link IWatchExpressionFactoryAdapter} may also implement
- * this interface.
- * </p>
- * @since 3.3
- */
-public interface IWatchExpressionFactoryAdapterExtension extends IWatchExpressionFactoryAdapter {
-
- /**
- * Returns whether a watch expression can be created for the specified variable.
- *
- * @param variable variable a watch expression is required for
- * @return whether an expression can be created
- * @exception org.eclipse.core.runtime.CoreException if unable to create a watch
- * expression
- */
- public boolean canCreateWatchExpression(IVariable variable);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
deleted file mode 100644
index b858f583f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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.actions;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IBreakpointImportParticipant;
-import org.eclipse.debug.internal.core.BreakpointManager;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.IImportExportConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.ImportExportMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.XMLMemento;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Imports breakpoints from a file or string buffer into the workspace.
- * <p>
- * This class may be instantiated.
- * <p>
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class ImportBreakpointsOperation implements IRunnableWithProgress {
-
- private boolean fOverwriteAll = false;
-
- private String fFileName = null;
-
- private boolean fCreateWorkingSets = false;
-
- private ArrayList fAdded = new ArrayList();
-
- private String fCurrentWorkingSetProperty = null;
-
- private BreakpointManager fManager = (BreakpointManager) DebugPlugin.getDefault().getBreakpointManager();
-
- /**
- * When a buffer is specified, a file is not used.
- */
- private StringBuffer fBuffer = null;
-
- /**
- * Constructs an operation to import breakpoints.
- *
- * @param fileName the file to read breakpoints from - the file should have been
- * created from an export operation
- * @param overwrite whether imported breakpoints will overwrite existing equivalent breakpoints
- * @param createWorkingSets whether breakpoint working sets should be created. Breakpoints
- * are exported with information about the breakpoint working sets they belong to. Those
- * working sets can be optionally re-created on import if they do not already exist in the
- * workspace.
- */
- public ImportBreakpointsOperation(String fileName, boolean overwrite, boolean createWorkingSets) {
- fFileName = fileName;
- fOverwriteAll = overwrite;
- fCreateWorkingSets = createWorkingSets;
- }
-
- /**
- * Constructs an operation to import breakpoints from a string buffer. The buffer
- * must contain a memento created an {@link ExportBreakpointsOperation}.
- *
- * @param buffer the string buffer to read breakpoints from - the file should have been
- * created from an export operation
- * @param overwrite whether imported breakpoints will overwrite existing equivalent breakpoints
- * @param createWorkingSets whether breakpoint working sets should be created. Breakpoints
- * are exported with information about the breakpoint working sets they belong to. Those
- * working sets can be optionally re-created on import if they do not already exist in the
- * workspace.
- * @since 3.5
- */
- public ImportBreakpointsOperation(StringBuffer buffer, boolean overwrite, boolean createWorkingSets) {
- fBuffer = buffer;
- fOverwriteAll = overwrite;
- fCreateWorkingSets = createWorkingSets;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void run(final IProgressMonitor monitor) throws InvocationTargetException {
- SubMonitor localmonitor = SubMonitor.convert(monitor, ImportExportMessages.ImportOperation_0, 1);
- Reader reader = null;
- try {
- if (fBuffer == null) {
- reader = new InputStreamReader(new FileInputStream(fFileName), "UTF-8"); //$NON-NLS-1$
- } else {
- reader = new StringReader(fBuffer.toString());
- }
- XMLMemento memento = XMLMemento.createReadRoot(reader);
- IMemento[] nodes = memento.getChildren(IImportExportConstants.IE_NODE_BREAKPOINT);
- IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
- localmonitor.setWorkRemaining(nodes.length);
- Map attributes = null;
- IBreakpointImportParticipant[] participants = null;
- for(int i = 0; i < nodes.length; i++) {
- if(localmonitor.isCanceled()) {
- return;
- }
- attributes = collectBreakpointProperties(nodes[i]);
- IResource resource = workspace.findMember((String) attributes.get(IImportExportConstants.IE_NODE_PATH));
- // filter resource breakpoints that do not exist in this workspace
- if(resource != null) {
- try {
- participants = fManager.getImportParticipants((String) attributes.get(IImportExportConstants.IE_NODE_TYPE));
- }
- catch(CoreException ce) {}
- IMarker marker = findExistingMarker(attributes, participants);
- if(marker == null) {
- marker = resource.createMarker((String) attributes.get(IImportExportConstants.IE_NODE_TYPE));
- restoreBreakpoint(marker, attributes, participants);
- }
- else {
- if(fOverwriteAll) {
- marker.setAttributes(null);
- restoreBreakpoint(marker, attributes, participants);
- }
- }
- }
- fCurrentWorkingSetProperty = null;
- localmonitor.worked(1);
- }
- if(fAdded.size() > 0) {
- fManager.addBreakpoints((IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()]));
- }
- }
- catch(FileNotFoundException e) {
- throw new InvocationTargetException(e,
- MessageFormat.format("Breakpoint import file not found: {0}", new String[]{fFileName})); //$NON-NLS-1$
- }
- catch (UnsupportedEncodingException e) {
- throw new InvocationTargetException(e,
- MessageFormat.format("The import file was written in non-UTF-8 encoding.", new String[]{fFileName})); //$NON-NLS-1$
- }
- catch(CoreException ce) {
- throw new InvocationTargetException(ce,
- MessageFormat.format("There was a problem importing breakpoints from: {0}", new String[] {fFileName})); //$NON-NLS-1$
- }
- finally {
- localmonitor.done();
- if(reader != null) {
- try {
- reader.close();
- }
- catch (IOException e) {
- throw new InvocationTargetException(e);
- }
- }
- }
- }
-
- /**
- * Returns a marker backing an existing breakpoint based on the given set of breakpoint attributes
- * @param attributes
- * @param participants
- * @return the marker for an existing breakpoint or <code>null</code> if one could not be located
- * @since 3.5
- */
- protected IMarker findExistingMarker(Map attributes, IBreakpointImportParticipant[] participants) {
- IBreakpoint[] bps = fManager.getBreakpoints();
- for(int i = 0; i < bps.length; i++) {
- for(int j = 0; j < participants.length; j++) {
- try {
- if(participants[j].matches(attributes, bps[i])) {
- return bps[i].getMarker();
- }
- }
- catch(CoreException ce) {}
- }
- }
- return null;
- }
-
- /**
- * Collects all of the properties for a breakpoint from the memento describing it.
- * The values in the map will be one of:
- * <ul>
- * <li>{@link String}</li>
- * <li>{@link Integer}</li>
- * <li>{@link Boolean}</li>
- * </ul>
- * @param memento
- * @return a new map of all of the breakpoint attributes from the given memento.
- * @since 3.5
- */
- protected Map collectBreakpointProperties(IMemento memento) {
- HashMap map = new HashMap();
-
- //collect attributes from the 'breakpoint' node
- map.put(IImportExportConstants.IE_BP_ENABLED, memento.getBoolean(IImportExportConstants.IE_BP_ENABLED));
- map.put(IImportExportConstants.IE_BP_PERSISTANT, memento.getBoolean(IImportExportConstants.IE_BP_PERSISTANT));
- map.put(IImportExportConstants.IE_BP_REGISTERED, memento.getBoolean(IImportExportConstants.IE_BP_REGISTERED));
-
- //collect attributes from the 'marker' node
- IMemento child = memento.getChild(IImportExportConstants.IE_NODE_MARKER);
- map.put(IImportExportConstants.IE_NODE_TYPE, child.getString(IImportExportConstants.IE_NODE_TYPE));
- map.put(IMarker.LINE_NUMBER, child.getInteger(IMarker.LINE_NUMBER));
-
- //copy all the marker attributes to the map
- IMemento[] children = child.getChildren(IImportExportConstants.IE_NODE_ATTRIB);
- for(int i = 0; i < children.length; i++) {
- readAttribute(children[i], map);
- }
-
- //collect attributes from the 'resource' node
- child = memento.getChild(IImportExportConstants.IE_NODE_RESOURCE);
- map.put(IImportExportConstants.IE_NODE_PATH, child.getString(IImportExportConstants.IE_NODE_PATH));
- return map;
- }
-
- /**
- * Collects the 'name' and 'value' key / attribute from the given memento and places it in the specified map
- * @param memento
- * @param map
- */
- private void readAttribute(IMemento memento, Map map) {
- String name = memento.getString(IImportExportConstants.IE_NODE_NAME),
- value = memento.getString(IImportExportConstants.IE_NODE_VALUE);
- if (value != null && name != null) {
- if (name.equals(IInternalDebugUIConstants.WORKING_SET_NAME)) {
- fCurrentWorkingSetProperty = value;
- }
- Object val = value;
- try {
- val = Integer.valueOf(value);
- } catch (NumberFormatException e) {
- if (value.equalsIgnoreCase("false") || value.equalsIgnoreCase("true")) { //$NON-NLS-1$ //$NON-NLS-2$
- val = Boolean.valueOf(value);
- }
- }
- if(val != null) {
- map.put(name, val);
- }
- }
- }
-
- /**
- * restores all of the attributes back into the given marker, recreates the breakpoint in the
- * breakpoint manager, and optionally recreates any working set(s) the breakpoint belongs to.
- * @param marker
- * @param attributes
- * @param participants
- * @since 3.5
- */
- protected void restoreBreakpoint(IMarker marker, final Map attributes, IBreakpointImportParticipant[] participants) {
- String key = null;
- for(Iterator iter = attributes.keySet().iterator(); iter.hasNext();) {
- key = (String) iter.next();
- try {
- marker.setAttribute(key, attributes.get(key));
- }
- catch(CoreException ce) {}
- }
- IBreakpoint breakpoint = null;
- try {
- // create the breakpoint
- breakpoint = fManager.createBreakpoint(marker);
- breakpoint.setEnabled(((Boolean)attributes.get(IImportExportConstants.IE_BP_ENABLED)).booleanValue());
- breakpoint.setPersisted(((Boolean)attributes.get(IImportExportConstants.IE_BP_PERSISTANT)).booleanValue());
- breakpoint.setRegistered(((Boolean)attributes.get(IImportExportConstants.IE_BP_REGISTERED)).booleanValue());
- fAdded.add(breakpoint);
- if (fCreateWorkingSets && fCurrentWorkingSetProperty != null) {
- String[] names = fCurrentWorkingSetProperty.split("\\" + IImportExportConstants.DELIMITER); //$NON-NLS-1$
- updateWorkingSets(names, breakpoint);
- }
- if(participants != null) {
- for(int i = 0; i < participants.length; i++) {
- participants[i].verify(breakpoint);
- }
- }
- }
- catch(CoreException ce) {
- //Something bad happened while trying to restore the breakpoint, remove it from the cached list and delete the marker
- //to ensure the manager does not hold bogus breakpoints
- if(breakpoint != null) {
- try {
- fAdded.remove(breakpoint);
- marker.delete();
- } catch (CoreException e) {}
- }
- }
- }
-
- /**
- * Updates the working sets the given breakpoint belongs to
- * @param wsnames
- * @param breakpoint
- * @since 3.5
- */
- private void updateWorkingSets(String[] wsnames, IBreakpoint breakpoint) {
- IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSet set = null;
- ArrayList sets = new ArrayList();
- collectContainingWorkingsets(breakpoint, sets);
- for (int i = 0; i < wsnames.length; i++) {
- if("".equals(wsnames[i])) { //$NON-NLS-1$
- continue;
- }
- set = mgr.getWorkingSet(wsnames[i]);
- if(set == null) {
- //create working set
- set = mgr.createWorkingSet(wsnames[i], new IAdaptable[] {});
- set.setId(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID);
- mgr.addWorkingSet(set);
- }
- if(!sets.contains(set)) {
- IAdaptable[] elements = set.getElements();
- IAdaptable[] newElements = new IAdaptable[elements.length + 1];
- newElements[newElements.length - 1] = breakpoint;
- System.arraycopy(elements, 0, newElements, 0, elements.length);
- set.setElements(newElements);
- }
- sets.remove(set);
- }
- ArrayList items = null;
- for(Iterator iter = sets.iterator(); iter.hasNext();) {
- set = (IWorkingSet) iter.next();
- items = new ArrayList(Arrays.asList(set.getElements()));
- if(items.remove(breakpoint)) {
- set.setElements((IAdaptable[]) items.toArray(new IAdaptable[items.size()]));
- }
- }
- }
-
- /**
- * Collects all of the breakpoint working sets that contain the given {@link IBreakpoint}
- * in the given list
- *
- * @param breakpoint
- * @param collector
- * @since 3.5
- */
- private void collectContainingWorkingsets(IBreakpoint breakpoint, List collector) {
- IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSet[] sets = mgr.getWorkingSets();
- for (int i = 0; i < sets.length; i++) {
- if(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(sets[i].getId()) &&
- containsBreakpoint(sets[i], breakpoint)) {
- collector.add(sets[i]);
- }
- }
- }
-
- /**
- * Method to ensure markers and breakpoints are not both added to the working set
- * @param set the set to check
- * @param breakpoint the breakpoint to check for existence
- * @return true if it is present false otherwise
- */
- private boolean containsBreakpoint(IWorkingSet set, IBreakpoint breakpoint) {
- IAdaptable[] elements = set.getElements();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].equals(breakpoint)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns the breakpoints that were imported by this operation, possibly
- * an empty list.
- *
- * @return breakpoints imported by this operation
- * @since 3.5
- */
- public IBreakpoint[] getImportedBreakpoints() {
- return (IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()]);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
deleted file mode 100644
index 800be2f96..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.actions;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Launches a launch configuration in a specific mode.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class LaunchAction extends Action {
-
- /**
- * The configuration to launch.
- */
- private ILaunchConfiguration fConfiguration;
- /**
- * The mode to launch in
- */
- private String fMode;
-
- /**
- * Constructs an action that launches the specified launch configuration
- * in the specified mode.
- *
- * @param configuration launch configuration
- * @param mode launch mode - one of <code>ILaunchManager.RUN_MODE</code> or
- * <code>ILaunchManager.DEBUG_MODE</code>
- */
- public LaunchAction(ILaunchConfiguration configuration, String mode) {
- fConfiguration = configuration;
- fMode = mode;
- setText(configuration.getName());
- setImageDescriptor(DebugUITools.getDefaultImageDescriptor(configuration));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- this,
- IDebugHelpContextIds.RELAUNCH_HISTORY_ACTION);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- DebugUITools.launch(fConfiguration, fMode);
- }
-
- /**
- * If the user has control-clicked the launch history item, open the launch
- * configuration dialog on the launch configuration, rather than running it.
- *
- * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- if ((event.stateMask & SWT.MOD1) > 0 && (event.stateMask & SWT.MOD2) > 0){
- ILaunchGroup[] groups = getAllGroupsForConfiguration(fConfiguration);
- if(groups.length > 0) {
- //prompt based on pref
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- if(store.getBoolean(IInternalDebugUIConstants.PREF_REMOVE_FROM_LAUNCH_HISTORY)) {
- MessageDialogWithToggle mdwt = MessageDialogWithToggle.openYesNoQuestion(DebugUIPlugin.getShell(),
- ActionMessages.LaunchAction_0,
- MessageFormat.format(ActionMessages.LaunchAction_1, new String[] {fConfiguration.getName()}),
- ActionMessages.LaunchAction_2,
- false,
- null,
- null);
- int ret = mdwt.getReturnCode();
- if(ret == IDialogConstants.YES_ID) {
- removeFromLaunchHistories(fConfiguration, groups);
- store.setValue(IInternalDebugUIConstants.PREF_REMOVE_FROM_LAUNCH_HISTORY, !mdwt.getToggleState());
- }
- }
- else {
- removeFromLaunchHistories(fConfiguration, groups);
- }
- }
- }
- else if ((event.stateMask & SWT.MOD1) > 0) {
- ILaunchGroup group = DebugUITools.getLaunchGroup(fConfiguration, fMode);
- if(group != null) {
- DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(fConfiguration), group.getIdentifier());
- }
- else {
- run();
- }
- }
- else {
- run();
- }
- }
-
- /**
- * Removes the specified <code>ILaunchConfiguration</code> from the launch histories associated
- * with the specified listing of <code>ILaunchGroup</code>s.
- * @param config
- * @param groups
- *
- * @since 3.4
- */
- private void removeFromLaunchHistories(ILaunchConfiguration config, ILaunchGroup[] groups) {
- LaunchHistory history = null;
- for(int i = 0; i < groups.length; i++) {
- history = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchHistory(groups[i].getIdentifier());
- if(history != null) {
- history.removeFromHistory(fConfiguration);
- } else {
- DebugUIPlugin.logErrorMessage(MessageFormat.format("Unable to remove configuration [{0}] from launch history. The launch history for mode [{1}] does not exist.", new String[] {config.getName(), groups[i].getMode()})); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Collects all of the launch groups associated with the specified <code>ILaunchConfiguration</code>
- * @param config the config to collect launch groups for
- * @return the listing of associated <code>ILaunchGroup</code>s for the specified <code>ILaunchConfiguration</code>, or
- * an empty listing, never <code>null</code>
- * @since 3.4
- */
- private ILaunchGroup[] getAllGroupsForConfiguration(ILaunchConfiguration config) {
- ArrayList list = new ArrayList();
- try {
- ILaunchConfigurationType type = config.getType();
- Set modes = type.getSupportedModeCombinations();
- String mode = null;
- ILaunchGroup group = null;
- Set modesets = null;
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modesets = (Set) iter.next();
- if(modesets.size() == 1) {
- mode = (String) modesets.toArray()[0];
- group = DebugUITools.getLaunchGroup(config, mode);
- if(group != null && !list.contains(group)) {
- list.add(group);
- }
- }
- }
- }
- catch(CoreException ce) {}
- return (ILaunchGroup[]) list.toArray(new ILaunchGroup[list.size()]);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
deleted file mode 100644
index f5af9d3fa..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.actions;
-
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchMode;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * A cascading sub-menu that shows all launch shortcuts pertinent to a
- * launch group.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.1
- * @deprecated The use of perspective based launch shortcuts has been deprecated
- * in the 3.1 release. Instead, selection sensitive launch is supported in the top level
- * menus. Use <code>LaunchShorcutsAction</code> instead.
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
-
- /**
- * Cascading menu
- */
- private Menu fCreatedMenu;
-
- /**
- * Launch group identifier
- */
- private String fLaunchGroupIdentifier;
-
- /**
- * Presentation wrapper for this action
- */
- private IAction fAction;
-
- /**
- * Creates a cascading menu action to populate with shortcuts in the given
- * launch group.
- *
- * @param launchGroupIdentifier launch group identifier
- */
- public LaunchAsAction(String launchGroupIdentifier) {
- super();
- fLaunchGroupIdentifier = launchGroupIdentifier;
- ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(getMode());
- setText(launchMode.getLaunchAsLabel());
- setMenuCreator(this);
- }
-
- /**
- * Returns the launch group associated with this action.
- *
- * @return the launch group associated with this action
- */
- private LaunchGroupExtension getLaunchGroup() {
- return getLaunchConfigurationManager().getLaunchGroup(fLaunchGroupIdentifier);
- }
-
- /**
- * @see IAction#run()
- */
- public void run() {
- //do nothing, this action just creates a cascading menu.
- }
-
- private void createAction(Menu parent, IAction action, int count) {
- StringBuffer label= new StringBuffer();
- //add the numerical accelerator
- if (count < 10) {
- label.append('&');
- label.append(count);
- label.append(' ');
- }
- label.append(action.getText());
- action.setText(label.toString());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- /**
- * @see IMenuCreator#dispose()
- */
- public void dispose() {
- if (getCreatedMenu() != null) {
- getCreatedMenu().dispose();
- }
- }
-
- /**
- * @see IMenuCreator#getMenu(Control)
- */
- public Menu getMenu(Control parent) {
- return null;
- }
-
- /**
- * @see IMenuCreator#getMenu(Menu)
- */
- public Menu getMenu(Menu parent) {
- if (getCreatedMenu() != null) {
- getCreatedMenu().dispose();
- }
- setCreatedMenu(new Menu(parent));
- fillMenu();
- initMenu();
- return getCreatedMenu();
- }
-
- private void fillMenu() {
- //Retrieve the current perspective and the registered shortcuts
- List shortcuts = null;
- String activePerspID = getActivePerspectiveID();
- if (activePerspID != null) {
- shortcuts = getLaunchConfigurationManager().getLaunchShortcuts(activePerspID, getCategory());
- }
-
- // If NO shortcuts are listed in the current perspective, add ALL shortcuts
- // to avoid an empty cascading menu
- if (shortcuts == null || shortcuts.isEmpty()) {
- shortcuts = getLaunchConfigurationManager().getLaunchShortcuts(getCategory());
- }
-
- int menuCount = 1;
-
- Iterator iter = shortcuts.iterator();
- String mode = getMode();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- if (ext.getModes().contains(mode) && !WorkbenchActivityHelper.filterItem(ext)) {
- populateMenu(mode, ext, getCreatedMenu(), menuCount);
- menuCount++;
- }
- }
- }
-
- /**
- * Creates the menu for the action
- */
- private void initMenu() {
- // Add listener to re-populate the menu each time
- // it is shown to reflect changes in selection or active perspective
- fCreatedMenu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu();
- }
- });
- }
-
- /**
- * Add the shortcut to the menu.
- */
- private void populateMenu(String mode, LaunchShortcutExtension ext, Menu menu, int menuCount) {
- LaunchShortcutAction action = new LaunchShortcutAction(mode, ext);
- action.setActionDefinitionId(ext.getId() + "." + mode); //$NON-NLS-1$
- String helpContextId = ext.getHelpContextId();
- if (helpContextId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(action, helpContextId);
- }
- /*if (fKeyBindingService != null) {
- fKeyBindingService.registerGlobalAction(action);
- }*/
- createAction(menu, action, menuCount);
- }
-
- /**
- * Return the ID of the currently active perspective, or <code>null</code>
- * if there is none.
- */
- private String getActivePerspectiveID() {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IPerspectiveDescriptor persp = page.getPerspective();
- if (persp != null) {
- return persp.getId();
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the mode of this action - run or debug
- *
- * @return the mode of this action - run or debug
- */
- private String getMode() {
- return getLaunchGroup().getMode();
- }
-
- /**
- * Returns the category of this action - possibly <code>null</code>
- *
- * @return the category of this action - possibly <code>null</code>
- */
- private String getCategory() {
- return getLaunchGroup().getCategory();
- }
-
- private Menu getCreatedMenu() {
- return fCreatedMenu;
- }
-
- private void setCreatedMenu(Menu createdMenu) {
- fCreatedMenu = createdMenu;
- }
-
- /**
- * Returns the launch configuration manager.
- *
- * @return launch configuration manager
- */
- private LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
-// if (window instanceof WorkbenchWindow) {
-// fKeyBindingService= ((WorkbenchWindow)window).getKeyBindingService();
-// }
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // do nothing - this is just a menu
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (fAction == null) {
- initialize(action);
- }
- }
-
- /**
- * Set the enabled state of the underlying action based on whether there are any
- * registered launch shortcuts for this launch mode.
- */
- private void initialize(IAction action) {
- fAction = action;
- action.setEnabled(existsShortcutsForMode());
- }
-
- /**
- * Return whether there are any registered launch shortcuts for
- * the mode of this action.
- *
- * @return whether there are any registered launch shortcuts for
- * the mode of this action
- */
- private boolean existsShortcutsForMode() {
- List shortcuts = getLaunchConfigurationManager().getLaunchShortcuts(getCategory());
- Iterator iter = shortcuts.iterator();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- if (ext.getModes().contains(getMode())) {
- return true;
- }
- }
- return false;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
deleted file mode 100644
index 620654db4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 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.actions;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchMode;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.LaunchConfigurationAction;
-import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * A cascading sub-menu that shows all launch shortcuts pertinent to a
- * selection. This action is similar to <code>ContextualLaunchAction</code>
- * except this action is an <code>IAction</code> rather than an action
- * delegate.
- * <p>
- * This action appears in the main Run menu
- * </p>
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 3.1
- */
-public class LaunchShortcutsAction extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
-
- /**
- * Cascading menu
- */
- private Menu fCreatedMenu;
-
- /**
- * Launch group
- */
- private ILaunchGroup fGroup;
-
- /**
- * Whether this actions enablement has been initialized
- */
- private boolean fInitialized = false;
-
- /**
- * Creates a cascading menu action to populate with shortcuts in the given
- * launch group.
- *
- * @param launchGroupIdentifier launch group identifier
- */
- public LaunchShortcutsAction(String launchGroupIdentifier) {
- super();
- fGroup = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(launchGroupIdentifier);
- ILaunchMode mode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(fGroup.getMode());
- setText(mode.getLaunchAsLabel());
- setMenuCreator(this);
- setEnabled(existsConfigTypesForMode());
- }
-
- /**
- * @see IAction#run()
- */
- public void run() {
- //do nothing, this action just creates a cascading menu.
- }
-
- /**
- * @see IMenuCreator#dispose()
- */
- public void dispose() {
- if (fCreatedMenu != null) {
- fCreatedMenu.dispose();
- }
- }
-
- /**
- * @see IMenuCreator#getMenu(Control)
- */
- public Menu getMenu(Control parent) {
- return null;
- }
-
- /**
- * @see IMenuCreator#getMenu(Menu)
- */
- public Menu getMenu(Menu parent) {
- if (fCreatedMenu != null) {
- fCreatedMenu.dispose();
- }
- fCreatedMenu = new Menu(parent);
- initMenu();
- return fCreatedMenu;
- }
-
- /**
- * @return an Evaluation context with default variable = selection
- */
- private IEvaluationContext createContext() {
- IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
- Object o = ss.getFirstElement();
- List list = new ArrayList(0);
- if(o instanceof IEditorPart) {
- list.add(((IEditorPart)o).getEditorInput());
- }
- else {
- list.addAll(ss.toList());
- }
- IEvaluationContext context = new EvaluationContext(null, list);
- context.setAllowPluginActivation(true);
- context.addVariable("selection", list); //$NON-NLS-1$
- return context;
- }
-
- /**
- * Fills the fly-out menu
- */
- private void fillMenu() {
- IEvaluationContext context = createContext();
- int accelerator = 1;
- List allShortCuts = getLaunchConfigurationManager().getLaunchShortcuts(fGroup.getCategory());
- Iterator iter = allShortCuts.iterator();
- List filteredShortCuts = new ArrayList(10);
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- try {
- if (!WorkbenchActivityHelper.filterItem(ext) && isApplicable(ext, context)) {
- filteredShortCuts.add(ext);
- }
- } catch (CoreException e) {/*not supported*/}
- }
- //first add the launch config if it is one
- String mode = getMode();
- try {
- ILaunchConfiguration config = getLaunchConfigurationManager().isSharedConfig(getSelection(context));
- if(config != null && config.exists() && config.supportsMode(mode)) {
- IAction action = new LaunchConfigurationAction(config, mode, config.getName(), DebugUITools.getDefaultImageDescriptor(config), accelerator++);
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(fCreatedMenu, -1);
- if(!filteredShortCuts.isEmpty()) {
- new MenuItem(fCreatedMenu, SWT.SEPARATOR);
- }
- }
- }
- catch(CoreException ce) {DebugUIPlugin.log(ce);}
- //second add the launch shortcuts if any
- iter = filteredShortCuts.iterator();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- Set modes = ext.getModes(); // supported launch modes
- Iterator modeIter = modes.iterator();
- while (modeIter.hasNext()) {
- String modee = (String) modeIter.next();
- if (modee.equals(mode)) {
- populateMenuItem(modee, ext, fCreatedMenu, accelerator++);
- }
- }
- }
- if (accelerator == 1) {
- // No shortcuts added. Add "none available" action.
- IAction action= new Action(ActionMessages.LaunchShortcutsAction_1) {};
- action.setEnabled(false);
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(fCreatedMenu, -1);
- }
- }
-
- /**
- * Returns the first element of the current selection
- * @param context the current evaluation context
- * @return the first item in the selection, or <code>null</code> if none
- * @since 3.3
- */
- private Object getSelection(IEvaluationContext context) {
- List list = (List) context.getVariable("selection"); //$NON-NLS-1$
- return (list.isEmpty() ? null : list.get(0));
- }
-
- /**
- * Add the shortcut to the context menu's launch sub-menu.
- */
- private void populateMenuItem(String mode, LaunchShortcutExtension ext, Menu menu, int accelerator) {
- LaunchShortcutAction action = new LaunchShortcutAction(mode, ext);
- action.setActionDefinitionId(ext.getId() + "." + mode); //$NON-NLS-1$
- String helpContextId = ext.getHelpContextId();
- if (helpContextId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(action, helpContextId);
- }
- StringBuffer label= new StringBuffer();
- if (accelerator >= 0 && accelerator < 10) {
- //add the numerical accelerator
- label.append('&');
- label.append(accelerator);
- label.append(' ');
- }
- String contextLabel= ext.getContextLabel(mode);
- // replace default action label with context label if specified.
- label.append((contextLabel != null) ? contextLabel : action.getText());
- action.setText(label.toString());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
-
- /**
- * Evaluate the enablement logic in the contextualLaunch
- * element description. A true result means that we should
- * include this shortcut in the context menu.
- * @return true iff shortcut should appear in context menu
- */
- private boolean isApplicable(LaunchShortcutExtension ext, IEvaluationContext context) throws CoreException {
- Expression expr = ext.getContextualLaunchEnablementExpression();
- return ext.evalEnablementExpression(context, expr);
- }
-
- /**
- * Creates the menu for the action
- */
- private void initMenu() {
- // Add listener to re-populate the menu each time
- // it is shown to reflect changes in selection or active perspective
- fCreatedMenu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu();
- }
- });
- }
-
- /**
- * Returns the mode of this action - run or debug
- *
- * @return the mode of this action - run or debug
- */
- protected String getMode() {
- return fGroup.getMode();
- }
-
- /**
- * Returns the launch configuration manager.
- *
- * @return launch configuration manager
- */
- private LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {}
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // do nothing - this is just a menu
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (!fInitialized) {
- action.setEnabled(existsConfigTypesForMode());
- fInitialized = true;
- }
- }
-
- /**
- * Return whether there are any registered launch configuration types for
- * the mode of this action.
- *
- * @return whether there are any registered launch configuration types for
- * the mode of this action
- */
- private boolean existsConfigTypesForMode() {
- ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- ILaunchConfigurationType configType = configTypes[i];
- if (configType.supportsMode(getMode())) {
- return true;
- }
- }
- return false;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
deleted file mode 100644
index 7f97c39cb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.actions;
-
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Opens the launch configuration dialog in the context of a launch group.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class OpenLaunchDialogAction extends Action implements IActionDelegate2, IWorkbenchWindowActionDelegate {
-
- /**
- * Launch group identifier
- */
- private String fIdentifier;
-
- /**
- * Constructs an action that opens the launch configuration dialog in
- * the context of the specified launch group.
- *
- * @param identifier unique identifier of a launch group extension
- */
- public OpenLaunchDialogAction(String identifier) {
- fIdentifier = identifier;
- ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(fIdentifier);
- if(group != null) {
- String lbl = group.getLabel();
- String actionLabel = MessageFormat.format(ActionMessages.OpenLaunchDialogAction_1, new String[] {lbl});
- setText(DebugUIPlugin.adjustDBCSAccelerator(actionLabel));
- }
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.OPEN_LAUNCH_CONFIGURATION_ACTION);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- LaunchHistory history = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchHistory(fIdentifier);
- ILaunchConfiguration configuration = history.getRecentLaunch();
- IStructuredSelection selection = null;
- if (configuration == null) {
- selection = new StructuredSelection();
- } else {
- selection = new StructuredSelection(configuration);
- }
- int result = DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), selection, fIdentifier);
- notifyResult(result == Window.OK);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- run();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- if(action != null) {
- action.setEnabled(existsConfigTypesForMode());
- }
- }
-
- /**
- * Return whether there are any registered launch configuration types for
- * the mode of this action.
- *
- * @return whether there are any registered launch configuration types for
- * the mode of this action
- */
- private boolean existsConfigTypesForMode() {
- ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- ILaunchConfigurationType configType = configTypes[i];
- if (configType.supportsMode(getMode())) {
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {}
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {}
-
- /**
- * Returns the launch mode for this action.
- *
- * @return launch mode
- */
- private String getMode() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(fIdentifier).getMode();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java
deleted file mode 100644
index 62ab35d21..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
-
-/**
- * Abstract action that works on breakpoints in the vertical ruler.
- * <p>
- * This class may be subclassed.
- * </p>
- * @since 3.2
- */
-public abstract class RulerBreakpointAction extends Action {
-
- private ITextEditor fEditor;
- private IVerticalRulerInfo fRulerInfo;
-
- /**
- * Constructs an action to work on breakpoints in the specified
- * text editor with the specified vertical ruler information.
- *
- * @param editor text editor
- * @param info vertical ruler information
- */
- public RulerBreakpointAction(ITextEditor editor, IVerticalRulerInfo info) {
- fEditor = editor;
- fRulerInfo = info;
- }
-
- /**
- * Returns the breakpoint at the last line of mouse activity in the ruler
- * or <code>null</code> if none.
- *
- * @return breakpoint associated with activity in the ruler or <code>null</code>
- */
- protected IBreakpoint getBreakpoint() {
- IAnnotationModel annotationModel = fEditor.getDocumentProvider().getAnnotationModel(fEditor.getEditorInput());
- IDocument document = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
- if (annotationModel != null) {
- Iterator iterator = annotationModel.getAnnotationIterator();
- while (iterator.hasNext()) {
- Object object = iterator.next();
- if (object instanceof SimpleMarkerAnnotation) {
- SimpleMarkerAnnotation markerAnnotation = (SimpleMarkerAnnotation) object;
- IMarker marker = markerAnnotation.getMarker();
- try {
- if (marker.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
- Position position = annotationModel.getPosition(markerAnnotation);
- int line = document.getLineOfOffset(position.getOffset());
- if (line == fRulerInfo.getLineOfLastMouseButtonActivity()) {
- IBreakpoint breakpoint = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker);
- if (breakpoint != null) {
- return breakpoint;
- }
- }
- }
- } catch (CoreException e) {
- } catch (BadLocationException e) {
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the editor this action was created for.
- *
- * @return editor
- */
- protected ITextEditor getEditor() {
- return fEditor;
- }
-
- /**
- * Returns the vertical ruler information this action was created for.
- *
- * @return vertical ruler information
- */
- protected IVerticalRulerInfo getVerticalRulerInfo() {
- return fRulerInfo;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
deleted file mode 100644
index f3fa71d6a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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
- * Wind River Systems - adapted action to use for breakpoint types
-******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension;
-
-/**
- * Breakpoint ruler pop-up action that creates a sub-menu to select the currently
- * active breakpoint type. This action delegate can be contributed to an editor
- * with the <code>editorActions</code> extension point. The breakpoint types are
- * calculated based on the toggle breakpoint target factories contributed through
- * the <code>toggleBreakpointsTargetFactories</code> extension point.
- * <p>
- * Following is example plug-in XML used to contribute this action to an editor's
- * vertical ruler context menu. It uses the <code>popupMenus</code> extension
- * point, by referencing the ruler's context menu identifier in the
- * <code>targetID</code> attribute.
- * <pre>
- * &lt;extension point="org.eclipse.ui.popupMenus"&gt;
- * &lt;viewerContribution
- * targetID="example.rulerContextMenuId"
- * id="example.RulerPopupActions"&gt;
- * &lt;action
- * label="Toggle Breakpoint"
- * class="org.eclipse.debug.ui.actions.RulerBreakpointTypesActionDelegate"
- * menubarPath="additions"
- * id="example.rulerContextMenu.breakpointTypesAction"&gt;
- * &lt;/action&gt;
- * &lt;/viewerContribution&gt;
- * </pre>
- * </p>
- * <p>
- * Clients may refer to this class as an action delegate in plug-in XML. This class
- * is not intended to be subclassed.
- * </p>
- * @see ToggleBreakpointsTargetManager
- * @see IToggleBreakpointsTargetFactory
- * @noextend This class is not intended to be subclassed by clients.
- * @since 3.5
- *
- */
-public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate, IMenuListener, IMenuCreator {
- private ITextEditor fEditor = null;
- private IAction fCallerAction = null;
- private IVerticalRulerInfo fRulerInfo;
- private ISelection fSelection;
-
- /**
- * The menu created by this action
- */
- private Menu fMenu;
-
- private class SelectTargetAction extends Action {
- private final Set fPossibleIDs;
- private final String fID;
- SelectTargetAction(String name, Set possibleIDs, String ID) {
- super(name, AS_RADIO_BUTTON);
- fID = ID;
- fPossibleIDs = possibleIDs;
- }
-
- public void run() {
- if (isChecked()) {
- ToggleBreakpointsTargetManager.getDefault().setPreferredTarget(fPossibleIDs, fID);
- }
- }
- }
-
-
- public void selectionChanged(IAction action, ISelection selection) {
- // In the editor we're not using the selection.
- }
-
- public void run(IAction action) {
- // Do nothing, this is a pull-down menu.
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
- // Clean up old editor data.
- if (fCallerAction != null) {
- fCallerAction.setMenuCreator(null);
- }
- if (fEditor instanceof ITextEditorExtension) {
- ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this);
- }
- fRulerInfo = null;
-
- // Set up new editor data.
- fCallerAction = callerAction;
- fCallerAction.setMenuCreator(this);
-
- fEditor= (ITextEditor)(targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class));
-
- if (fEditor != null) {
- if (fEditor instanceof ITextEditorExtension) {
- ((ITextEditorExtension) fEditor).addRulerContextMenuListener(this);
- }
-
- fRulerInfo= (IVerticalRulerInfo) fEditor.getAdapter(IVerticalRulerInfo.class);
- }
-
- }
-
- public void dispose() {
- if (fCallerAction != null) {
- fCallerAction.setMenuCreator(null);
- }
- if (fEditor instanceof ITextEditorExtension) {
- ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this);
- }
- fRulerInfo = null;
- }
-
- public void menuAboutToShow(IMenuManager manager) {
- fSelection = StructuredSelection.EMPTY;
- if (fEditor != null && fRulerInfo != null) {
-
- IDocumentProvider provider = fEditor.getDocumentProvider();
- if (provider != null) {
- IDocument document = provider.getDocument(fEditor.getEditorInput());
- int line = fRulerInfo.getLineOfLastMouseButtonActivity();
- if (line > -1) {
- try {
- IRegion region = document.getLineInformation(line);
- fSelection = new TextSelection(document, region.getOffset(), 0);
- } catch (BadLocationException e) {}
- }
- }
- ToggleBreakpointsTargetManager toggleTargetManager = ToggleBreakpointsTargetManager.getDefault();
- Set enabledIDs = toggleTargetManager.getEnabledToggleBreakpointsTargetIDs(fEditor, fSelection);
- fCallerAction.setEnabled(enabledIDs.size() > 0);
- } else {
- fCallerAction.setEnabled(false);
- }
-
- }
-
- /**
- * Sets this action's drop-down menu, disposing the previous menu.
- *
- * @param menu the new menu
- */
- private void setMenu(Menu menu) {
- if (fMenu != null) {
- fMenu.dispose();
- }
- fMenu = menu;
- }
-
- public Menu getMenu(Menu parent) {
- setMenu(new Menu(parent));
- fillMenu(fMenu);
- initMenu();
- return fMenu;
- }
-
- public Menu getMenu(Control parent) {
- setMenu(new Menu(parent));
- fillMenu(fMenu);
- initMenu();
- return fMenu;
- }
-
- /**
- * Fills the drop-down menu with enabled toggle breakpoint targets
- *
- * @param menu the menu to fill
- */
- private void fillMenu(Menu menu) {
- ToggleBreakpointsTargetManager manager = ToggleBreakpointsTargetManager.getDefault();
- Set enabledIDs = manager.getEnabledToggleBreakpointsTargetIDs(fEditor, fSelection);
- String preferredId = manager.getPreferredToggleBreakpointsTargetID(fEditor, fSelection);
-
- for (Iterator itr = enabledIDs.iterator(); itr.hasNext();) {
- String id = (String)itr.next();
- SelectTargetAction action= new SelectTargetAction(manager.getToggleBreakpointsTargetName(id), enabledIDs, id);
-
- if (id.equals(preferredId)){
- action.setChecked(true);
- }
-
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
- }
-
- /**
- * Creates the menu for the action
- */
- private void initMenu() {
- // Add listener to re-populate the menu each time
- // it is shown because of dynamic history list
- fMenu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- }
- });
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java
deleted file mode 100644
index 0b17e2a89..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 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.actions;
-
-import org.eclipse.debug.internal.ui.actions.breakpoints.RulerEnableDisableBreakpointAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * Toggles enablement of a breakpoint in a vertical ruler.
- * This action can be contributed to a vertical ruler context menu via the
- * <code>popupMenus</code> extension point, by referencing the ruler's context
- * menu identifier in the <code>targetID</code> attribute.
- * <pre>
- * &lt;extension point="org.eclipse.ui.popupMenus"&gt;
- * &lt;viewerContribution
- * targetID="example.rulerContextMenuId"
- * id="example.RulerPopupActions"&gt;
- * &lt;action
- * label="Enable Breakpoint"
- * class="org.eclipse.debug.ui.actions.RulerEnableDisableBreakpointActionDelegate"
- * menubarPath="additions"
- * id="example.rulerContextMenu.toggleBreakpointAction"&gt;
- * &lt;/action&gt;
- * &lt;/viewerContribution&gt;
- * </pre>
- * </p>
- * <p>
- * Clients may refer to this class as an action delegate in plug-in XML.
- * </p>
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- *
- */
-public class RulerEnableDisableBreakpointActionDelegate extends AbstractRulerActionDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.source.IVerticalRulerInfo)
- */
- protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
- return new RulerEnableDisableBreakpointAction(editor, rulerInfo);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java
deleted file mode 100644
index 54380ed3a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 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.actions;
-
-import org.eclipse.swt.widgets.Event;
-
-import org.eclipse.jface.action.IAction;
-
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * Toggles a breakpoint when ruler is double-clicked. This action delegate can be
- * contributed to an editor with the <code>editorActions</code> extension point.
- * This action is as a factory that creates another action that performs the
- * actual breakpoint toggling. The created action acts on the editor's
- * <code>IToggleBreakpointsTagret</code> to toggle breakpoints.
- * <p>
- * Following is example plug-in XML used to contribute this action to an editor.
- * Note that the label attribute of this action is not displayed in the editor.
- * Instead, the label of the created action is displayed.
- * <pre>
- * &lt;extension point="org.eclipse.ui.editorActions"&gt;
- * &lt;editorContribution
- * targetID="example.editor"
- * id="example.rulerActions"&gt;
- * &lt;action
- * label="Not Used"
- * class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
- * style="push"
- * actionID="RulerDoubleClick"
- * id="example.doubleClickBreakpointAction"/&gt;
- * &lt;/editorContribution&gt;
- * &lt;/extension&gt;
- * </pre>
- * </p>
- * <p>
- * This action can also be contributed to a vertical ruler context menu via the
- * <code>popupMenus</code> extension point, by referencing the ruler's context
- * menu identifier in the <code>targetID</code> attribute.
- * <pre>
- * &lt;extension point="org.eclipse.ui.popupMenus"&gt;
- * &lt;viewerContribution
- * targetID="example.rulerContextMenuId"
- * id="example.RulerPopupActions"&gt;
- * &lt;action
- * label="Toggle Breakpoint"
- * class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
- * menubarPath="additions"
- * id="example.rulerContextMenu.toggleBreakpointAction"&gt;
- * &lt;/action&gt;
- * &lt;/viewerContribution&gt;
- * </pre>
- * </p>
- * <p>
- * Clients may refer to this class as an action delegate in plug-in XML.
- * </p>
- * @since 3.1
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class RulerToggleBreakpointActionDelegate extends AbstractRulerActionDelegate implements IActionDelegate2 {
-
- private IEditorPart fEditor = null;
- private ToggleBreakpointAction fDelegate = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.source.IVerticalRulerInfo)
- */
- protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
- fDelegate = new ToggleBreakpointAction(editor, null, rulerInfo);
- return fDelegate;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
- if (fEditor != null) {
- if (fDelegate != null) {
- fDelegate.dispose();
- fDelegate = null;
- }
- }
- fEditor = targetEditor;
- super.setActiveEditor(callerAction, targetEditor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- if (fDelegate != null) {
- fDelegate.dispose();
- }
- fDelegate = null;
- fEditor = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
deleted file mode 100644
index 32145272f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.actions;
-
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.actions.ExecutionAction;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Action to launch the last launch configuration that was successfully
- * launched, in run mode. If no configurations have been launched, the launch
- * configuration dialog is opened.
- * </p>
- * <p>
- * This class may be instantiated.
- * </p>
- * @since 2.0
- */
-public final class RunAction extends ExecutionAction {
-
- public RunAction() {
- super(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
- }
-
- /**
- * @see ExecutionAction#getMode()
- */
- protected String getMode() {
- return ILaunchManager.RUN_MODE;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
deleted file mode 100644
index c08b0ad4d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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
- * Mikhail Khodjaiants (QNX) - https://bugs.eclipse.org/bugs/show_bug.cgi?id=83464
- * Wind River - Pawel Piech - Added use of adapters to support non-standard models (bug 213074)
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextManager;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * A run to line action that can be contributed to a an editor or view. The action
- * will perform the "run to line" operation for parts that provide
- * an appropriate <code>IRunToLineTarget</code> adapter.
- * <p>
- * Clients may reference/contribute this class as an action delegate
- * in plug-in XML.
- * </p>
- * <p>
- * Since 3.1, this action also implements {@link org.eclipse.ui.IViewActionDelegate}.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
-
- private IWorkbenchPart fActivePart = null;
- private IRunToLineTarget fPartTarget = null;
- private IAction fAction = null;
- private DebugContextListener fContextListener = new DebugContextListener();
- private ISuspendResume fTargetElement = null;
-
- class DebugContextListener implements IDebugContextListener {
-
- protected void contextActivated(ISelection selection) {
- fTargetElement = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- if (ss.size() == 1) {
- fTargetElement = (ISuspendResume)
- DebugPlugin.getAdapter(ss.getFirstElement(), ISuspendResume.class);
- }
- }
- update();
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- contextActivated(event.getContext());
- }
-
- }
-
- /*(non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- DebugUITools.getDebugContextManager().getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener);
- fActivePart = null;
- fPartTarget = null;
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (fPartTarget != null && fTargetElement != null) {
- try {
- fPartTarget.runToLine(fActivePart, fActivePart.getSite().getSelectionProvider().getSelection(), fTargetElement);
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(fActivePart.getSite().getWorkbenchWindow().getShell(), ActionMessages.RunToLineAction_0, ActionMessages.RunToLineAction_1, e.getStatus()); //
- }
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- this.fAction = action;
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- if (fAction == null) {
- return;
- }
- Runnable r = new Runnable() {
- public void run() {
- boolean enabled = false;
- if (fPartTarget != null && fTargetElement != null) {
- IWorkbenchPartSite site = fActivePart.getSite();
- if (site != null) {
- ISelectionProvider selectionProvider = site.getSelectionProvider();
- if (selectionProvider != null) {
- ISelection selection = selectionProvider.getSelection();
- enabled = fTargetElement.isSuspended() && fPartTarget.canRunToLine(fActivePart, selection, fTargetElement);
- }
- }
- }
- fAction.setEnabled(enabled);
- }
- };
- DebugUIPlugin.getStandardDisplay().asyncExec(r);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- this.fAction = action;
- if (action != null) {
- action.setText(ActionMessages.RunToLineActionDelegate_4);
- action.setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_RUN_TO_LINE));
- action.setDisabledImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RUN_TO_LINE));
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- init(action);
- bindTo(targetEditor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- bindTo(view);
- }
-
- /**
- * Binds this action to operate on the given part's run to line adapter.
- *
- * @param part
- */
- private void bindTo(IWorkbenchPart part) {
- IDebugContextManager manager = DebugUITools.getDebugContextManager();
- if (fActivePart != null && !fActivePart.equals(part)) {
- manager.getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener);
- }
- fPartTarget = null;
- fActivePart = part;
- if (part != null) {
- IWorkbenchWindow workbenchWindow = part.getSite().getWorkbenchWindow();
- IDebugContextService service = manager.getContextService(workbenchWindow);
- service.addDebugContextListener(fContextListener);
- fPartTarget = (IRunToLineTarget) part.getAdapter(IRunToLineTarget.class);
- if (fPartTarget == null) {
- IAdapterManager adapterManager = Platform.getAdapterManager();
- // TODO: we could restrict loading to cases when the debugging context is on
- if (adapterManager.hasAdapter(part, IRunToLineTarget.class.getName())) {
- fPartTarget = (IRunToLineTarget) adapterManager.loadAdapter(part, IRunToLineTarget.class.getName());
- }
- }
- ISelection activeContext = service.getActiveContext();
- fContextListener.contextActivated(activeContext);
- }
- update();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
deleted file mode 100644
index d0d5dd1e4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.actions;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.IBreakpointManagerListener;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Handles a run to line operation. Clients implementing a run to line action
- * can use this handler to carry out a run to line operation implemented with
- * a breakpoint. Handles the user preference to skip breakpoints while performing
- * a run to line operation, and cancelling the run to line operation if another
- * breakpoint is encountered before the operation is completed.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 3.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class RunToLineHandler implements IDebugEventSetListener, IBreakpointManagerListener, IWorkspaceRunnable {
-
- private IDebugTarget fTarget;
- private ISuspendResume fResumee;
- private IBreakpoint fBreakpoint;
- private boolean fAutoSkip = false;
-
- /**
- * Constructs a handler to perform a run to line operation.
- *
- * @param target the debug target in which the operation is to be performed
- * @param suspendResume the element to be resumed to begin the operation
- * @param breakpoint the run to line breakpoint
- */
- public RunToLineHandler(IDebugTarget target, ISuspendResume suspendResume, IBreakpoint breakpoint) {
- fResumee = suspendResume;
- fTarget = target;
- fBreakpoint = breakpoint;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event= events[i];
- Object source= event.getSource();
- if (source instanceof IThread && event.getKind() == DebugEvent.SUSPEND &&
- event.getDetail() == DebugEvent.BREAKPOINT) {
- IThread thread = (IThread) source;
- IDebugTarget suspendee = (IDebugTarget) thread.getAdapter(IDebugTarget.class);
- if (fTarget.equals(suspendee)) {
- // cleanup if the breakpoint was hit or not
- cancel();
- }
- } else if (source instanceof IDebugTarget && event.getKind() == DebugEvent.TERMINATE) {
- if (source.equals(fTarget)) {
- // Clean up if the debug target terminates without
- // hitting the breakpoint.
- cancel();
- }
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointManagerListener#breakpointManagerEnablementChanged(boolean)
- */
- public void breakpointManagerEnablementChanged(boolean enabled) {
- // if the user changes the breakpoint manager enablement, don't restore it
- fAutoSkip = false;
- }
-
- private IBreakpointManager getBreakpointManager() {
- return getDebugPlugin().getBreakpointManager();
- }
-
- private DebugPlugin getDebugPlugin() {
- return DebugPlugin.getDefault();
- }
-
- /**
- * Cancels the run to line operation.
- */
- public void cancel() {
- IBreakpointManager manager = getBreakpointManager();
- try {
- getDebugPlugin().removeDebugEventListener(this);
- manager.removeBreakpointManagerListener(this);
- fTarget.breakpointRemoved(fBreakpoint, null);
- } finally {
- if (fAutoSkip) {
- manager.setEnabled(true);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void run(IProgressMonitor monitor) throws CoreException {
- getDebugPlugin().addDebugEventListener(this);
- IBreakpointManager breakpointManager = getBreakpointManager();
- fAutoSkip = DebugUITools.getPreferenceStore().getBoolean(IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE) && breakpointManager.isEnabled();
- if (fAutoSkip) {
- getBreakpointManager().setEnabled(false);
- breakpointManager.addBreakpointManagerListener(this);
- }
- Job job = new Job(ActionMessages.RunToLineHandler_0) {
- protected IStatus run(IProgressMonitor jobMonitor) {
- if (!jobMonitor.isCanceled()) {
- fTarget.breakpointAdded(fBreakpoint);
- try {
- fResumee.resume();
- } catch (DebugException e) {
- cancel();
- return e.getStatus();
- }
- }
- return Status.OK_STATUS;
- }
- };
- job.schedule();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
deleted file mode 100644
index d67ffa51f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 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
- * Wind River Systems - added support for IToggleBreakpointsTargetFactory
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.IToggleBreakpointsTargetManagerListener;
-import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Action to toggle a breakpoint in a vertical ruler of a workbench part
- * containing a document. The part must provide an <code>IToggleBreakpointsTarget</code>
- * adapter which may optionally be an instance of an
- * <code>IToggleBreakpointsTargetExtension</code>.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 3.1
- * @see org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class ToggleBreakpointAction extends Action implements IUpdate {
-
- private IWorkbenchPart fPart;
- private IDocument fDocument;
- private IVerticalRulerInfo fRulerInfo;
- private IToggleBreakpointsTargetManagerListener fListener = new IToggleBreakpointsTargetManagerListener() {
- public void preferredTargetsChanged() {
- update();
- }
- };
-
- /**
- * Constructs a new action to toggle a breakpoint in the given
- * part containing the given document and ruler.
- *
- * @param part the part in which to toggle the breakpoint - provides
- * an <code>IToggleBreakpointsTarget</code> adapter
- * @param document the document breakpoints are being set in or
- * <code>null</code> when the document should be derived from the
- * given part
- * @param rulerInfo specifies location the user has double-clicked
- */
- public ToggleBreakpointAction(IWorkbenchPart part, IDocument document, IVerticalRulerInfo rulerInfo) {
- super(ActionMessages.ToggleBreakpointAction_0);
- fPart = part;
- fDocument = document;
- fRulerInfo = rulerInfo;
- ToggleBreakpointsTargetManager.getDefault().addChangedListener(fListener);
- }
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- IDocument document= getDocument();
- if (document == null) {
- return;
- }
-
- int line = fRulerInfo.getLineOfLastMouseButtonActivity();
-
- // Test if line is valid
- if (line == -1)
- return;
-
- try {
- ITextSelection selection = getTextSelection(document, line);
- IToggleBreakpointsTarget toggleTarget =
- ToggleBreakpointsTargetManager.getDefault().getToggleBreakpointsTarget(fPart, selection);
- if (toggleTarget == null) {
- return;
- }
-
- if (toggleTarget instanceof IToggleBreakpointsTargetExtension) {
- IToggleBreakpointsTargetExtension extension = (IToggleBreakpointsTargetExtension) toggleTarget;
- if (extension.canToggleBreakpoints(fPart, selection)) {
- extension.toggleBreakpoints(fPart, selection);
- return;
- }
- }
- if (toggleTarget.canToggleLineBreakpoints(fPart, selection)) {
- toggleTarget.toggleLineBreakpoints(fPart, selection);
- } else if (toggleTarget.canToggleWatchpoints(fPart, selection)) {
- toggleTarget.toggleWatchpoints(fPart, selection);
- } else if (toggleTarget.canToggleMethodBreakpoints(fPart, selection)) {
- toggleTarget.toggleMethodBreakpoints(fPart, selection);
- }
- } catch (BadLocationException e) {
- reportException(e);
- } catch (CoreException e) {
- reportException(e);
- }
- }
-
- /**
- * Report an error to the user.
- *
- * @param e underlying exception
- */
- private void reportException(Exception e) {
- DebugUIPlugin.errorDialog(fPart.getSite().getShell(), ActionMessages.ToggleBreakpointAction_1, ActionMessages.ToggleBreakpointAction_2, e); //
- }
-
- /**
- * Disposes this action. Clients must call this method when
- * this action is no longer needed.
- */
- public void dispose() {
- fDocument = null;
- fPart = null;
- fRulerInfo = null;
- ToggleBreakpointsTargetManager.getDefault().removeChangedListener(fListener);
- }
-
- /**
- * Returns the document on which this action operates.
- *
- * @return the document or <code>null</code> if none
- */
- private IDocument getDocument() {
- if (fDocument != null)
- return fDocument;
-
- if (fPart instanceof ITextEditor) {
- ITextEditor editor= (ITextEditor)fPart;
- IDocumentProvider provider = editor.getDocumentProvider();
- if (provider != null)
- return provider.getDocument(editor.getEditorInput());
- }
-
- IDocument doc = (IDocument) fPart.getAdapter(IDocument.class);
- if (doc != null) {
- return doc;
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- IDocument document= getDocument();
- if (document != null) {
- int line = fRulerInfo.getLineOfLastMouseButtonActivity();
- if (line > -1) {
- try {
- ITextSelection selection = getTextSelection(document, line);
-
- IToggleBreakpointsTarget adapter =
- ToggleBreakpointsTargetManager.getDefault().getToggleBreakpointsTarget(fPart, selection);
- if (adapter == null) {
- setEnabled(false);
- return;
- }
- if (adapter instanceof IToggleBreakpointsTargetExtension) {
- IToggleBreakpointsTargetExtension extension = (IToggleBreakpointsTargetExtension) adapter;
- if (extension.canToggleBreakpoints(fPart, selection)) {
- setEnabled(true);
- return;
- }
- }
- if (adapter.canToggleLineBreakpoints(fPart, selection) ||
- adapter.canToggleWatchpoints(fPart, selection) ||
- adapter.canToggleMethodBreakpoints(fPart, selection))
- {
- setEnabled(true);
- return;
- }
- } catch (BadLocationException e) {
- reportException(e);
- }
- }
- }
- setEnabled(false);
- }
-
- /**
- * Determines the text selection for the breakpoint action. If clicking on the ruler inside
- * the highlighted text, return the text selection for the highlighted text. Otherwise,
- * return a text selection representing the start of the line.
- *
- * @param document The IDocument backing the Editor.
- * @param line The line clicked on in the ruler.
- * @return An ITextSelection as described.
- * @throws BadLocationException If underlying operations throw.
- */
- private ITextSelection getTextSelection(IDocument document, int line) throws BadLocationException {
- IRegion region = document.getLineInformation(line);
- ITextSelection textSelection = new TextSelection(document, region.getOffset(), 0);
- ISelectionProvider provider = fPart.getSite().getSelectionProvider();
- if (provider != null){
- ISelection selection = provider.getSelection();
- if (selection instanceof ITextSelection
- && ((ITextSelection) selection).getStartLine() <= line
- && ((ITextSelection) selection).getEndLine() >= line) {
- textSelection = (ITextSelection) selection;
- }
- }
- return textSelection;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java
deleted file mode 100644
index 4b3db6ff7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.actions.breakpoints.ToggleBreakpointObjectActionDelegate;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * A toggle method breakpoint action that can be contributed an object
- * contribution. The action will toggle method breakpoints on objects
- * that provide an <code>IToggleBreakpointsTarget</code> adapter.
- * <p>
- * Clients may reference/contribute this class as an object contribution
- * action delegate in plug-in XML.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class ToggleMethodBreakpointActionDelegate extends ToggleBreakpointObjectActionDelegate {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ToggleBreakpointObjectActionDelegate#performAction(org.eclipse.debug.internal.ui.actions.IToggleBreakpointsTarget, org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- protected void performAction(IToggleBreakpointsTarget target, IWorkbenchPart part, ISelection selection) throws CoreException {
- target.toggleMethodBreakpoints(part, selection);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java
deleted file mode 100644
index c5ebd55ec..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.actions.breakpoints.ToggleBreakpointObjectActionDelegate;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * A toggle watchpoint action that can be contributed an object
- * contribution. The action will toggle watchpoints on objects
- * that provide an <code>IToggleBreakpointsTarget</code> adapter.
- * <p>
- * Clients may reference/contribute this class as an object contribution
- * action delegate in plug-in XML.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class ToggleWatchpointActionDelegate extends ToggleBreakpointObjectActionDelegate {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ToggleBreakpointObjectActionDelegate#performAction(org.eclipse.debug.internal.ui.actions.IToggleBreakpointsTarget, org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- protected void performAction(IToggleBreakpointsTarget target, IWorkbenchPart part, ISelection selection) throws CoreException {
- target.toggleWatchpoints(part, selection);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/package.html b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/package.html
deleted file mode 100644
index ea275ff7e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/package.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Debug UI Actions</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<p align="left">Provides a set of actions related to running and debugging applications.</p>
-
-<h2 align="left">Package Specification</h2>
-
-<p>This package provides a set of actions related to running and debugging applications.</p>
-</body>
-</html>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java
deleted file mode 100644
index 27ca96d60..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.console;
-
-
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamsProxy;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Default console color provider for a process. Colors output to standard
- * out, in, and error, as specified by user preferences.
- * <p>
- * Clients implementing a console color provider should subclass this class.
- * </p>
- * @since 2.1
- */
-public class ConsoleColorProvider implements IConsoleColorProvider {
-
- private IProcess fProcess;
- private IConsole fConsole;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#connect(org.eclipse.debug.core.model.IProcess, org.eclipse.debug.ui.console.IConsole)
- */
- public void connect(IProcess process, IConsole console) {
- fProcess = process;
- fConsole = console;
- IStreamsProxy streamsProxy = fProcess.getStreamsProxy();
- if (streamsProxy != null) {
- fConsole.connect(streamsProxy);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#disconnect()
- */
- public void disconnect() {
- fConsole = null;
- fProcess = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#isReadOnly()
- */
- public boolean isReadOnly() {
- return fProcess == null || fProcess.isTerminated();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(java.lang.String)
- */
- public Color getColor(String streamIdentifer) {
- if (IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM.equals(streamIdentifer)) {
- return DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR);
- }
- if (IDebugUIConstants.ID_STANDARD_ERROR_STREAM.equals(streamIdentifer)) {
- return DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_ERR_COLOR);
- }
- if (IDebugUIConstants.ID_STANDARD_INPUT_STREAM.equals(streamIdentifer)) {
- return DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_IN_COLOR);
- }
- return null;
- }
-
- /**
- * Returns the process this color provider is providing color for, or
- * <code>null</code> if none.
- *
- * @return the process this color provider is providing color for, or
- * <code>null</code> if none
- */
- protected IProcess getProcess() {
- return fProcess;
- }
-
- /**
- * Returns the console this color provider is connected to, or
- * <code>null</code> if none.
- *
- * @return IConsole the console this color provider is connected to, or
- * <code>null</code> if none
- */
- protected IConsole getConsole() {
- return fConsole;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
deleted file mode 100644
index 5bf3cc8a9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.console;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * A hyperlink that opens a file in a text editor and selects a range of text.
- * This hyperlink action will un-zoom the workbench as needed to show the editor
- * for the associated link.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class FileLink implements IConsoleHyperlink {
-
- private IFile fFile;
- private int fFileOffset;
- private int fFileLength;
- private int fFileLineNumber;
- private String fEditorId;
-
- /**
- * Constructs a hyperlink to the specified file.
- *
- * @param file the file to open when activated
- * @param editorId the identifier of the editor to open the file in, or
- * <code>null</code> if the default editor should be used
- * @param fileOffset the offset in the file to select when activated, or -1
- * @param fileLength the length of text to select in the file when activated
- * or -1
- * @param fileLineNumber the line number to select in the file when
- * activated, or -1
- */
- public FileLink(IFile file, String editorId, int fileOffset, int fileLength, int fileLineNumber) {
- fFile = file;
- fFileOffset = fileOffset;
- fFileLength = fileLength;
- fFileLineNumber = fileLineNumber;
- fEditorId = editorId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkActivated()
- */
- public void linkActivated() {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- try {
- IEditorPart editorPart = page.openEditor(new FileEditorInput(fFile), getEditorId() , true);
- if (fFileLineNumber > 0) {
- ITextEditor textEditor = null;
- if (editorPart instanceof ITextEditor) {
- textEditor = (ITextEditor) editorPart;
- } else {
- textEditor = (ITextEditor) editorPart.getAdapter(ITextEditor.class);
- }
- if (textEditor != null) {
- IEditorInput input = editorPart.getEditorInput();
- if (fFileOffset < 0) {
- IDocumentProvider provider = textEditor.getDocumentProvider();
- try {
- provider.connect(input);
- } catch (CoreException e) {
- // unable to link
- DebugUIPlugin.log(e);
- return;
- }
- IDocument document = provider.getDocument(input);
- try {
- IRegion region= document.getLineInformation(fFileLineNumber - 1);
- fFileOffset = region.getOffset();
- fFileLength = region.getLength();
- } catch (BadLocationException e) {
- // unable to link
- DebugUIPlugin.log(e);
- }
- provider.disconnect(input);
- }
- if (fFileOffset >= 0 && fFileLength >=0) {
- textEditor.selectAndReveal(fFileOffset, fFileLength);
- }
- }
- }
- } catch (PartInitException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkEntered()
- */
- public void linkEntered() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkExited()
- */
- public void linkExited() {
- }
-
- private String getEditorId() {
- if (fEditorId == null) {
- IWorkbench workbench= DebugUIPlugin.getDefault().getWorkbench();
- // If there is a registered editor for the file use it.
- IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(fFile.getName(), getFileContentType());
- if (desc == null) {
- //default editor
- desc= workbench.getEditorRegistry().findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID);
- }
- fEditorId= desc.getId();
- }
- return fEditorId;
- }
-
- private IContentType getFileContentType() {
- try {
- IContentDescription description= fFile.getContentDescription();
- if (description != null) {
- return description.getContentType();
- }
- } catch (CoreException e) {
- }
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
deleted file mode 100644
index d81b0eb32..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.console;
-
-
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamMonitor;
-import org.eclipse.debug.core.model.IStreamsProxy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.ui.console.IHyperlink;
-import org.eclipse.ui.console.IOConsoleOutputStream;
-import org.eclipse.ui.console.IPatternMatchListener;
-
-/**
- * A console that displays output and writes input to a process. Implementors of
- * <code>IConsoleColorProvider</code> should connect streams to a console
- * document when connected to.
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider
- * @since 2.1
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-public interface IConsole {
-
- /**
- * Connects this console to the given streams proxy. This associates the
- * standard in, out, and error streams with the console. Keyboard input will
- * be written to the given proxy.
- *
- * @param streamsProxy
- */
- public void connect(IStreamsProxy streamsProxy);
-
- /**
- * Connects this console to the given stream monitor, uniquely identified by
- * the given identifier. This allows for more than the standard (in, out,
- * error) streams to be connected to the console.
- *
- * @param streamMonitor
- * @param streamIdentifer
- */
- public void connect(IStreamMonitor streamMonitor, String streamIdentifer);
-
- /**
- * Adds the given hyperlink to this console. The link will be notified when
- * entered, exited, and activated.
- * <p>
- * If the link's region (offset/length) is within the console's document
- * current bounds, it is added immediately. Otherwise, the link is added
- * when the console's document grows to contain the link's region.
- * </p>
- * @param link the hyperlink to add
- * @param offset the character offset within the console document where the
- * text associated with the hyperlink begins
- * @param length the length of the associated hyperlink text
- * @deprecated replaced with addLink(IHyperlink link, int offset, int length)
- */
- public void addLink(IConsoleHyperlink link, int offset, int length);
-
- /**
- * Adds the given hyperlink to this console. The link will be notified when
- * entered, exited, and activated.
- * <p>
- * If the link's region (offset/length) is within the console's document
- * current bounds, it is added immediately. Otherwise, the link is added
- * when the console's document grows to contain the link's region.
- * </p>
- * @param link the hyperlink to add
- * @param offset the character offset within the console document where the
- * text associated with the hyperlink begins
- * @param length the length of the associated hyperlink text
- * @since 3.1
- */
- public void addLink(IHyperlink link, int offset, int length);
-
- /**
- * Returns the region of text associated with the given hyperlink, or
- * <code>null</code> if the given hyperlink is not contained in this
- * console.
- *
- * @param link a console hyperlink
- * @return region of text associated with the hyperlink, or <code>null</code>
- * @deprecated replaced with getRegion(IHyperlink link) instead
- */
- public IRegion getRegion(IConsoleHyperlink link);
-
- /**
- * Returns the region of text associated with the given hyperlink, or
- * <code>null</code> if the given hyperlink is not contained in this
- * console.
- *
- * @param link a console hyperlink
- * @return region of text associated with the hyperlink, or <code>null</code>
- * @since 3.1
- */
- public IRegion getRegion(IHyperlink link);
-
- /**
- * Returns the document associated with this console.
- *
- * @return document
- */
- public IDocument getDocument();
-
- /**
- * Returns the process associated with this console.
- *
- * @return the process associated with this console
- */
- public IProcess getProcess();
-
- /**
- * Adds the given pattern match listener to this console. The listener will
- * be connected and receive match notifications.
- * @param matchListener the listener to add
- * @since 3.1
- */
- public void addPatternMatchListener(IPatternMatchListener matchListener);
-
- /**
- * Removes the given pattern match listener from this console. The listener will be
- * disconnected and will no longer receive match notifications.
- * @param matchListener the pattern match listener to remove.
- * @since 3.1
- */
- public void removePatternMatchListener(IPatternMatchListener matchListener);
-
- /**
- * Returns the stream associated with the specified stream identifier.
- * @param streamIdentifier Uniquely identifies the required stream
- * @return The stream or <code>null</code> if none found with matching streamIdentifier
- * @since 3.1
- */
- public IOConsoleOutputStream getStream(String streamIdentifier);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleColorProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleColorProvider.java
deleted file mode 100644
index aa81dd793..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleColorProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 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.console;
-
-
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Provides coloring for a console document. When a process is added to a
- * registered launch the debug plug-in creates a console document for the
- * process. By default, a document is created which is connected to the standard
- * input, output, and error streams associated with the process. A client may
- * override the default coloring by specifying a custom content provider for a
- * process type. A process type is defined via the process attribute
- * <code>IProcess. ATTR_PROCESS_TYPE</code>.
- * <p>
- * A console color provider extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a console color
- * provider extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.consoleColorProviders"&gt;
- * &lt;consoleColorProvider
- * id="com.example.ExampleConsoleColorProvider"
- * class="com.example.ExampleConsoleColorProviderClass"