Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java117
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java287
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java239
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java95
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java1392
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java518
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java53
-rwxr-xr-xorg.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java39
-rwxr-xr-xorg.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java95
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java46
16 files changed, 0 insertions, 3233 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java
deleted file mode 100644
index 94083c91a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java
+++ /dev/null
@@ -1,55 +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.internal.ui.views.launch;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Action that controls the preference for whether elements should be
- * automatically expanded in the breadcrumb drop down viewers.
- *
- * @since 3.5
- */
-class BreadcrumbDropDownAutoExpandAction extends Action {
-
- private final LaunchView fLaunchView;
-
- /**
- * Creates a new action to set the debug view mode.
- *
- * @param view Reference to the debug view.
- * @param mode The mode to be set by this action.
- * @param parent The view's parent control used to calculate view size
- * in auto mode.
- */
- public BreadcrumbDropDownAutoExpandAction(LaunchView view) {
- super(IInternalDebugCoreConstants.EMPTY_STRING, AS_CHECK_BOX);
- fLaunchView = view;
-
- setText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_label);
- setToolTipText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_tooltip);
- setDescription(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_description);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_DROP_DOWN_AUTOEXPAND_ACTION);
-
- setChecked(fLaunchView.getBreadcrumbDropDownAutoExpand());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fLaunchView.setBreadcrumbDropDownAutoExpand(isChecked());
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java
deleted file mode 100644
index ca87e7de3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java
+++ /dev/null
@@ -1,117 +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
- * Pawel Piech - Wind River - adapted to use in Debug view
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-
-/**
- * Fake part to used to create the breadcrumb page.
- *
- * @since 3.5
- * @see LaunchView#fDefaultPageRec
- */
-class BreadcrumbWorkbenchPart implements IWorkbenchPart {
-
- private IWorkbenchPartSite fSite = null;
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return (obj instanceof BreadcrumbWorkbenchPart);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getClass().hashCode();
- }
-
- /**
- * Constructs a part for the given console that binds to the given
- * site
- */
- public BreadcrumbWorkbenchPart(IWorkbenchPartSite site) {
- fSite = site;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
- */
- public void addPropertyListener(IPropertyListener listener) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getSite()
- */
- public IWorkbenchPartSite getSite() {
- return fSite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getTitle()
- */
- public String getTitle() {
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
- */
- public Image getTitleImage() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getTitleToolTip()
- */
- public String getTitleToolTip() {
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
- */
- public void removePropertyListener(IPropertyListener listener) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return null;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
deleted file mode 100644
index 00620344c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
+++ /dev/null
@@ -1,287 +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
- * Wind River Systems - support for alternative expression view content providers
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.elements.adapters.AsynchronousDebugLabelAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.DefaultViewerInputProvider;
-import org.eclipse.debug.internal.ui.elements.adapters.MemoryBlockContentAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.MemoryBlockLabelAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.MemoryRetrievalContentAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.MemorySegmentLabelAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.StackFrameSourceDisplayAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.StackFrameViewerInputProvider;
-import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnFactoryAdapter;
-import org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.DebugTargetContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionManagerContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionManagerMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.LaunchContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.LaunchManagerContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.MemoryBlockContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.MemoryBlockLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.MemoryRetrievalContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.MemoryViewElementMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.RegisterGroupContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.RegisterGroupLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.RegisterGroupMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.StackFrameMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.ThreadContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.VariableContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.VariableEditor;
-import org.eclipse.debug.internal.ui.model.elements.VariableLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.VariableMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousContentAdapter;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousLabelAdapter;
-import org.eclipse.debug.internal.ui.viewers.update.DefaultModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.update.DefaultModelSelectionPolicyFactory;
-import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment;
-import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
-
-/**
- * DebugElementAdapterFactory
- */
-public class DebugElementAdapterFactory implements IAdapterFactory {
-
- private static IModelProxyFactory fgModelProxyFactoryAdapter = new DefaultModelProxyFactory();
- private static ISourceDisplay fgStackFrameSourceDisplayAdapter = new StackFrameSourceDisplayAdapter();
- private static IModelSelectionPolicyFactory fgModelSelectionPolicyFactoryAdapter = new DefaultModelSelectionPolicyFactory();
-
- private static IAsynchronousLabelAdapter fgDebugLabelAdapter = new AsynchronousDebugLabelAdapter();
- private static IAsynchronousLabelAdapter fgMemoryBlockLabelAdapter = new MemoryBlockLabelAdapter();
- private static IAsynchronousLabelAdapter fgTableRenderingLineLabelAdapter = new MemorySegmentLabelAdapter();
-
- private static IElementLabelProvider fgLPDebugElement = new DebugElementLabelProvider();
- private static IElementLabelProvider fgLPVariable = new VariableLabelProvider();
- private static IElementLabelProvider fgLPExpression = new ExpressionLabelProvider();
- private static IElementLabelProvider fgLPRegisterGroup = new RegisterGroupLabelProvider();
- private static IElementLabelProvider fgLPMemoryBlock = new MemoryBlockLabelProvider();
-
- private static IElementEditor fgEEVariable = new VariableEditor();
-
- private static IAsynchronousContentAdapter fgAsyncMemoryRetrieval = new MemoryRetrievalContentAdapter();
- private static IAsynchronousContentAdapter fgAsyncMemoryBlock = new MemoryBlockContentAdapter();
-
- private static IElementContentProvider fgCPLaunchManger = new LaunchManagerContentProvider();
- private static IElementContentProvider fgCPLaunch = new LaunchContentProvider();
- private static IElementContentProvider fgCPTarget = new DebugTargetContentProvider();
- private static IElementContentProvider fgCPThread = new ThreadContentProvider();
- private static IElementContentProvider fgCPFrame = new StackFrameContentProvider();
- private static IElementContentProvider fgCPVariable = new VariableContentProvider();
- private static IElementContentProvider fgCPExpressionManager = new ExpressionManagerContentProvider();
- private static IElementContentProvider fgCPExpression = new ExpressionContentProvider();
- private static IElementContentProvider fgCPRegisterGroup = new RegisterGroupContentProvider();
- private static IElementContentProvider fgCPMemoryRetrieval = new MemoryRetrievalContentProvider();
- private static IElementContentProvider fgCPMemoryBlock = new MemoryBlockContentProvider();
-
- private static IElementMementoProvider fgMPFrame = new StackFrameMementoProvider();
- private static IElementMementoProvider fgMPVariable = new VariableMementoProvider();
- private static IElementMementoProvider fgMPExpression = new ExpressionMementoProvider();
- private static IElementMementoProvider fgMPRegisterGroup = new RegisterGroupMementoProvider();
- private static IElementMementoProvider fgMPExpressionManager = new ExpressionManagerMementoProvider();
- private static IElementMementoProvider fgMPMemory = new MemoryViewElementMementoProvider();
-
- private static IColumnPresentationFactory fgVariableColumnFactory = new VariableColumnFactoryAdapter();
-
- private static IViewerInputProvider fgDefaultViewerInputProvider = new DefaultViewerInputProvider();
- private static IViewerInputProvider fgStackFrameViewerInputProvider = new StackFrameViewerInputProvider();
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType.isInstance(adaptableObject)) {
- return adaptableObject;
- }
-
- if (adapterType.equals(IAsynchronousContentAdapter.class)) {
- if (adaptableObject instanceof IMemoryBlockRetrieval) {
- return fgAsyncMemoryRetrieval;
- }
- if (adaptableObject instanceof IMemoryBlock) {
- return fgAsyncMemoryBlock;
- }
- }
-
- if (adapterType.equals(IElementContentProvider.class)) {
- if (adaptableObject instanceof ILaunchManager) {
- return fgCPLaunchManger;
- }
- if (adaptableObject instanceof ILaunch) {
- return fgCPLaunch;
- }
- if (adaptableObject instanceof IDebugTarget) {
- return fgCPTarget;
- }
- if (adaptableObject instanceof IMemoryBlockRetrieval)
- {
- return fgCPMemoryRetrieval;
- }
- if (adaptableObject instanceof IThread) {
- return fgCPThread;
- }
- if (adaptableObject instanceof IStackFrame) {
- return fgCPFrame;
- }
- if (adaptableObject instanceof IVariable) {
- return fgCPVariable;
- }
- if (adaptableObject instanceof IExpressionManager) {
- return fgCPExpressionManager;
- }
- if (adaptableObject instanceof IExpression) {
- return fgCPExpression;
- }
- if (adaptableObject instanceof IRegisterGroup) {
- return fgCPRegisterGroup;
- }
- if (adaptableObject instanceof IMemoryBlock) {
- return fgCPMemoryBlock;
- }
- }
-
- if (adapterType.equals(IAsynchronousLabelAdapter.class)) {
- if (adaptableObject instanceof IMemoryBlock) {
- return fgMemoryBlockLabelAdapter;
- }
-
- if (adaptableObject instanceof MemorySegment) {
- return fgTableRenderingLineLabelAdapter;
- }
- return fgDebugLabelAdapter;
- }
-
- if (adapterType.equals(IElementLabelProvider.class)) {
- if (adaptableObject instanceof IVariable) {
- return fgLPVariable;
- }
- if (adaptableObject instanceof IExpression) {
- return fgLPExpression;
- }
- if (adaptableObject instanceof IRegisterGroup) {
- return fgLPRegisterGroup;
- }
- if (adaptableObject instanceof IMemoryBlock) {
- return fgLPMemoryBlock;
- }
- return fgLPDebugElement;
- }
-
- if (adapterType.equals(IModelProxyFactory.class)) {
- if (adaptableObject instanceof ILaunch || adaptableObject instanceof IDebugTarget ||
- adaptableObject instanceof IProcess || adaptableObject instanceof ILaunchManager ||
- adaptableObject instanceof IStackFrame || adaptableObject instanceof IExpressionManager ||
- adaptableObject instanceof IExpression || adaptableObject instanceof IMemoryBlockRetrieval ||
- adaptableObject instanceof IMemoryBlock)
- return fgModelProxyFactoryAdapter;
- }
-
- if (adapterType.equals(ISourceDisplay.class)) {
- if (adaptableObject instanceof IStackFrame) {
- return fgStackFrameSourceDisplayAdapter;
- }
- }
-
- if (adapterType.equals(IModelSelectionPolicyFactory.class)) {
- if (adaptableObject instanceof IDebugElement) {
- return fgModelSelectionPolicyFactoryAdapter;
- }
- }
-
- if (adapterType.equals(IColumnPresentationFactory.class)) {
- if (adaptableObject instanceof IStackFrame) {
- return fgVariableColumnFactory;
- }
- }
-
- if (adapterType.equals(IElementMementoProvider.class)) {
- if (adaptableObject instanceof IStackFrame) {
- return fgMPFrame;
- }
- if (adaptableObject instanceof IVariable) {
- return fgMPVariable;
- }
- if (adaptableObject instanceof IRegisterGroup) {
- return fgMPRegisterGroup;
- }
- if (adaptableObject instanceof IExpression) {
- return fgMPExpression;
- }
- if (adaptableObject instanceof IExpressionManager) {
- return fgMPExpressionManager;
- }
- if (adaptableObject instanceof IMemoryBlockRetrieval) {
- return fgMPMemory;
- }
- }
-
- if (adapterType.equals(IElementEditor.class)) {
- if (adaptableObject instanceof IVariable) {
- return fgEEVariable;
- }
- }
-
- if (adapterType.equals(IViewerInputProvider.class)) {
- if (adaptableObject instanceof IStackFrame) {
- return fgStackFrameViewerInputProvider;
- } else {
- return fgDefaultViewerInputProvider;
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] {
- IAsynchronousLabelAdapter.class,
- IAsynchronousContentAdapter.class,
- IModelProxyFactory.class,
- ISourceDisplay.class,
- IModelSelectionPolicyFactory.class,
- IColumnPresentationFactory.class,
- IElementContentProvider.class,
- IElementLabelProvider.class,
- IElementMementoProvider.class,
- IElementEditor.class,
- IViewerInputProvider.class};
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java
deleted file mode 100644
index efafa7b7c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java
+++ /dev/null
@@ -1,239 +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.internal.ui.views.launch;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Translates images, colors, and fonts into image descriptors, RGBs, and font
- * datas for workbench adapaters. Also provides labels.
- *
- * @since 3.1
- */
-public class DebugElementHelper {
-
- // a model presentation that can provide images & labels for debug elements
- private static DelegatingModelPresentation fgPresenetation;
-
- // map of images to image descriptors
- private static Map fgImages = new HashMap();
-
- /**
- * Disposes this adapater
- */
- public static void dispose() {
- fgImages.clear();
- if (fgPresenetation != null) {
- fgPresenetation.dispose();
- fgPresenetation = null;
- }
- }
-
- /**
- * Returns an image descriptor for the given debug element.
- *
- * @param object object for which an image descriptor is required
- */
- public static ImageDescriptor getImageDescriptor(Object object) {
- Image image = getPresentation().getImage(object);
- return getImageDescriptor(image);
- }
-
- /**
- * Returns an image descriptor for the given debug element.
- *
- * @param presentation presentation to obtain image from
- * @param object object for which an image descriptor is required
- * @since 3.3
- */
- public static ImageDescriptor getImageDescriptor(Object object, IDebugModelPresentation presentation) {
- Image image = presentation.getImage(object);
- return getImageDescriptor(image);
- }
-
- public static ImageDescriptor getImageDescriptor(Image image)
- {
- if (image != null) {
- ImageDescriptor descriptor = (ImageDescriptor) fgImages.get(image);
- if (descriptor == null) {
- descriptor = new ImageImageDescriptor(image);
- fgImages.put(image, descriptor);
- }
- return descriptor;
- }
- return null;
- }
-
- /**
- * Returns a label for the given debug element.
- *
- * @param o object for which a label is required
- */
- public static String getLabel(Object o) {
- return getPresentation().getText(o);
- }
-
- /**
- * Returns a model presentation to use to retrieve lables & images.
- *
- * @return a model presentation to use to retrieve lables & images
- */
- public static DelegatingModelPresentation getPresentation() {
- if (fgPresenetation == null) {
- fgPresenetation = new DelegatingModelPresentation();
- }
- return fgPresenetation;
- }
-
- /**
- * Returns the RGB of the foreground color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a foreground color is required
- * @return the RGB of the foreground color for the given element, or
- * <code>null</code> if none
- */
- public static RGB getForeground(Object element) {
- Color color = getPresentation().getForeground(element);
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the RGB of the foreground color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a foreground color is required
- * @param presentation presentation to obtain color from
- * @return the RGB of the foreground color for the given element, or
- * <code>null</code> if none
- * @since 3.3
- */
- public static RGB getForeground(Object element, IDebugModelPresentation presentation) {
- Color color = null;
- if (presentation instanceof IColorProvider) {
- IColorProvider colorProvider = (IColorProvider) presentation;
- color = colorProvider.getForeground(element);
- } else {
- color = getPresentation().getForeground(element);
- }
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the RGB of the background color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a background color is required
- * @return the RGB of the background color for the given element, or
- * <code>null</code> if none
- */
- public static RGB getBackground(Object element) {
- Color color = getPresentation().getBackground(element);
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the RGB of the background color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a background color is required
- * @param presentation presentation to use to retrieve color
- * @return the RGB of the background color for the given element, or
- * <code>null</code> if none
- * @since 3.3
- */
- public static RGB getBackground(Object element, IDebugModelPresentation presentation) {
- Color color = null;
- if (presentation instanceof IColorProvider) {
- IColorProvider colorProvider = (IColorProvider) presentation;
- color = colorProvider.getBackground(element);
- } else {
- color = getPresentation().getBackground(element);
- }
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the font data for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which font data is required
- * @return the font data for the given element, or
- * <code>null</code> if none
- */
- public static FontData getFont(Object element) {
- Font font = getPresentation().getFont(element);
- if (font != null) {
- return font.getFontData()[0];
- }
- return null;
- }
-
- /**
- * Returns the font data for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which font data is required
- * @param presentation presentation to obtain font from
- * @return the font data for the given element, or
- * <code>null</code> if none
- * @since 3.3
- */
- public static FontData getFont(Object element, IDebugModelPresentation presentation) {
- Font font = null;
- if (presentation instanceof IFontProvider) {
- IFontProvider provider = (IFontProvider) presentation;
- font = provider.getFont(element);
- } else {
- font = getPresentation().getFont(element);
- }
- if (font != null) {
- return font.getFontData()[0];
- }
- return null;
- }
-
- /**
- * Returns whether the UI thread is required for computing the label for the
- * given object.
- *
- * @param object object a label is being computed for
- * @return whether the UI thread is required
- */
- public static boolean requiresUIThread(Object object) {
- DelegatingModelPresentation presentation = getPresentation();
- return presentation.requiresUIThread(object);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java
deleted file mode 100644
index 5a014ddb6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java
+++ /dev/null
@@ -1,78 +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.internal.ui.views.launch;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Action that controls the view mode for Debug view (auto vs. breadcrumb, vs.
- * tree view).
- *
- * @since 3.5
- */
-class DebugViewModeAction extends Action {
-
- private final LaunchView fLaunchView;
- private final Composite fParent;
- private final String fMode;
-
- /**
- * Creates a new action to set the debug view mode.
- *
- * @param view Reference to the debug view.
- * @param mode The mode to be set by this action.
- * @param parent The view's parent control used to calculate view size
- * in auto mode.
- */
- public DebugViewModeAction(LaunchView view, String mode, Composite parent) {
- super(IInternalDebugCoreConstants.EMPTY_STRING, AS_RADIO_BUTTON);
- fLaunchView = view;
- fParent = parent;
- fMode = mode;
-
- if (mode == IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO) {
- setText(LaunchViewMessages.DebugViewModeAction_Auto_label);
- setToolTipText(LaunchViewMessages.DebugViewModeAction_Auto_tooltip);
- setDescription(LaunchViewMessages.DebugViewModeAction_Auto_description);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_MODE_AUTO_ACTION);
- } else if (mode == IDebugPreferenceConstants.DEBUG_VIEW_MODE_FULL) {
- setText(LaunchViewMessages.DebugViewModeAction_Full_label);
- setToolTipText(LaunchViewMessages.DebugViewModeAction_Full_tooltip);
- setDescription(LaunchViewMessages.DebugViewModeAction_Full_description);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_MODE_FULL_ACTION);
- } else {
- setText(LaunchViewMessages.DebugViewModeAction_Compact_label);
- setToolTipText(LaunchViewMessages.DebugViewModeAction_Compact_tooltip);
- setDescription(LaunchViewMessages.DebugViewModeAction_Compact_description);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_MODE_COMPACT_ACTION);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fLaunchView.setViewMode(fMode, fParent);
- }
-
- /**
- * Returns the view mode set by this action.
- */
- public String getMode() {
- return fMode;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java
deleted file mode 100644
index 6f5cc4c71..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java
+++ /dev/null
@@ -1,32 +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.internal.ui.views.launch;
-
-import org.eclipse.debug.core.model.IThread;
-
-/**
- * A decoration in an editor, created by the debugger.
- */
-public abstract class Decoration {
-
- /**
- * Removes this decoration
- */
- public abstract void remove();
-
- /**
- * Returns the thread this decoration decorates.
- *
- * @return thread associated with this decoration
- */
- public abstract IThread getThread();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java
deleted file mode 100644
index 49938fd68..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java
+++ /dev/null
@@ -1,95 +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.internal.ui.views.launch;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IThread;
-
-/**
- * Manages source selections and decorated editors for launch views.
- */
-public class DecorationManager {
-
- // map of targets to lists of active decorations
- private static Map fDecorations = new HashMap(10);
-
- /**
- * Adds the given decoration for the given stack frame.
- *
- * @param decoration
- * @param frame
- */
- public static void addDecoration(Decoration decoration) {
- synchronized (fDecorations) {
- IDebugTarget target = decoration.getThread().getDebugTarget();
- List list = (List) fDecorations.get(target);
- if (list == null) {
- list = new ArrayList();
- fDecorations.put(target, list);
- }
- list.add(decoration);
- }
- }
-
- /**
- * Removes any decorations for the given debug target.
- *
- * @param target
- * to remove editor decorations for
- */
- public static void removeDecorations(IDebugTarget target) {
- doRemoveDecorations(target, null);
- }
-
- /**
- * Removes any decorations for the given thread
- *
- * @param thread
- * thread to remove decorations for
- */
- public static void removeDecorations(IThread thread) {
- doRemoveDecorations(thread.getDebugTarget(), thread);
- }
-
- private static void doRemoveDecorations(IDebugTarget target, IThread thread) {
- ArrayList decorationsToRemove = new ArrayList();
- synchronized (fDecorations) {
- List list = (List) fDecorations.get(target);
- if (list != null) {
- ListIterator iterator = list.listIterator();
- while (iterator.hasNext()) {
- Decoration decoration = (Decoration) iterator.next();
- if (thread == null || thread.equals(decoration.getThread())) {
- decorationsToRemove.add(decoration);
- iterator.remove();
- }
- }
- if (list.isEmpty()) {
- fDecorations.remove(target);
- }
- }
- }
- Iterator iter = decorationsToRemove.iterator();
- while (iter.hasNext())
- {
- Decoration decoration = (Decoration)iter.next();
- decoration.remove();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java
deleted file mode 100644
index 57f8fb646..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java
+++ /dev/null
@@ -1,51 +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.internal.ui.views.launch;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-
-/**
- * Image descriptor for an image.
- */
-public class ImageImageDescriptor extends ImageDescriptor {
- private Image fImage;
-
- /**
- * Constructor for ImagImageDescriptor.
- */
- public ImageImageDescriptor(Image image) {
- super();
- fImage= image;
- }
-
- /* (non-Javadoc)
- * @see ImageDescriptor#getImageData()
- */
- public ImageData getImageData() {
- return fImage.getImageData();
- }
-
- /* (non-Javadoc)
- * @see Object#equals(Object)
- */
- public boolean equals(Object obj) {
- return (obj != null) && getClass().equals(obj.getClass()) && fImage.equals(((ImageImageDescriptor)obj).fImage);
- }
-
- /* (non-Javadoc)
- * @see Object#hashCode()
- */
- public int hashCode() {
- return fImage.hashCode();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
deleted file mode 100644
index 327dfc817..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ /dev/null
@@ -1,1392 +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
- * Wind River - Pawel Piech - Busy status while updates in progress (Bug 206822)
- * Pawel Piech (Wind River) - added a breadcrumb mode to Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.commands.IRestartHandler;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.ITerminate;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.AddToFavoritesAction;
-import org.eclipse.debug.internal.ui.actions.EditLaunchConfigurationAction;
-import org.eclipse.debug.internal.ui.commands.actions.DisconnectCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.DropToFrameCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.RestartCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.ResumeCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.StepIntoCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.StepOverCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.StepReturnCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.SuspendCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.TerminateAllAction;
-import org.eclipse.debug.internal.ui.commands.actions.TerminateAndRelaunchAction;
-import org.eclipse.debug.internal.ui.commands.actions.TerminateAndRemoveAction;
-import org.eclipse.debug.internal.ui.commands.actions.TerminateCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.ToggleStepFiltersAction;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.sourcelookup.EditSourceLookupPathAction;
-import org.eclipse.debug.internal.ui.sourcelookup.LookupSourceAction;
-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer;
-import org.eclipse.debug.internal.ui.viewers.model.VirtualFindAction;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-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.TreeModelViewer;
-import org.eclipse.debug.internal.ui.views.DebugModelPresentationContext;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.debug.ui.AbstractDebugView;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.debug.ui.contexts.AbstractDebugContextProvider;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextProvider;
-import org.eclipse.jface.action.GroupMarker;
-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.action.Separator;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-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.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPageListener;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveListener2;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.XMLMemento;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.part.IPageBookViewPage;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.IShowInSource;
-import org.eclipse.ui.part.IShowInTarget;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.part.Page;
-import org.eclipse.ui.part.ShowInContext;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.eclipse.ui.progress.UIJob;
-
-public class LaunchView extends AbstractDebugView implements ISelectionChangedListener, IPerspectiveListener2, IPageListener, IShowInTarget, IShowInSource, IShowInTargetList, IPartListener2, IViewerUpdateListener {
-
- public static final String ID_CONTEXT_ACTIVITY_BINDINGS = "contextActivityBindings"; //$NON-NLS-1$
-
- private static final String TERMINATE = "terminate"; //$NON-NLS-1$
-
- private static final String DISCONNECT = "disconnect"; //$NON-NLS-1$
-
- private static final String SUSPEND = "suspend"; //$NON-NLS-1$
-
- private static final String RESUME = "resume"; //$NON-NLS-1$
-
- private static final String STEP_RETURN = "step_return"; //$NON-NLS-1$
-
- private static final String STEP_OVER = "step_over"; //$NON-NLS-1$
-
- private static final String DROP_TO_FRAME = "drop_to_frame"; //$NON-NLS-1$
-
- private static final String STEP_INTO = "step_into"; //$NON-NLS-1$
-
- private static final String TERMINATE_AND_REMOVE = "terminate_and_remove"; //$NON-NLS-1$
-
- private static final String TERMINATE_ALL = "terminate_all"; //$NON-NLS-1$
-
- private static final String TERMINATE_AND_RELAUNCH = "terminate_relaunch"; //$NON-NLS-1$
-
- private static final String TOGGLE_STEP_FILTERS = "toggle_step_filters"; //$NON-NLS-1$
-
- private static final String RESTART = "restart"; //$NON-NLS-1$
-
- private static final int BREADCRUMB_TRIGGER_RANGE = 5; // pixels
-
- private static final int BREADCRUMB_STICKY_RANGE = 20; // pixels
-
- /**
- * Whether this view is in the active page of a perspective.
- */
- private boolean fIsActive = true;
-
- /**
- * Model presentation or <code>null</code> if none
- */
- private IDebugModelPresentation fPresentation = null;
-
- private EditLaunchConfigurationAction fEditConfigAction = null;
- private AddToFavoritesAction fAddToFavoritesAction = null;
- private EditSourceLookupPathAction fEditSourceAction = null;
- private LookupSourceAction fLookupAction = null;
-
- /**
- * Current view mode (auto vs. breadcrumb, vs. tree view).
- *
- * @since 3.5
- */
- private String fCurrentViewMode = IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO;
-
- /**
- * Actions for selecting the view mode (auto vs. breadcrumb, vs. tree view).
- *
- * @since 3.5
- */
- private DebugViewModeAction[] fDebugViewModeActions;
-
- /**
- * Action that controls the breadcrumb drop-down auto-expand behavior.
- *
- * @since 3.5
- */
- private BreadcrumbDropDownAutoExpandAction fBreadcrumbDropDownAutoExpandAction;
-
- /**
- * Preference name for the view's memento.
- *
- * @since 3.5
- */
- private String PREF_STATE_MEMENTO = "pref_state_memento."; //$NON-NLS-1$
-
- /**
- * Key for a view preference for whether the elements in breadcrumb's
- * drop-down viewer should be automatically expanded.
- *
- * @since 3.5
- */
- private static final String BREADCRUMB_DROPDOWN_AUTO_EXPAND = DebugUIPlugin.getUniqueIdentifier() + ".BREADCRUMB_DROPDOWN_AUTO_EXPAND"; //$NON-NLS-1$
-
- /**
- * Preference for whether the elements in breadcrumb's
- * drop-down viewer should be automatically expanded.
- *
- * @since 3.5
- */
- private boolean fBreadcrumbDropDownAutoExpand = false;
-
- /**
- * Page-book page for the breadcrumb viewer. This page is activated in
- * Debug view when the height of the view is reduced to just one line.
- *
- * @since 3.5
- */
- private class BreadcrumbPage extends Page {
-
- LaunchViewBreadcrumb fCrumb;
- Control fControl;
-
- public void createControl(Composite parent) {
- fCrumb = new LaunchViewBreadcrumb(LaunchView.this, (TreeModelViewer)getViewer(), fTreeViewerDebugContextProvider);
- fControl = fCrumb.createContent(parent);
- }
-
- public void init(IPageSite pageSite) {
- super.init(pageSite);
- pageSite.setSelectionProvider(fCrumb.getSelectionProvider());
- }
-
- public Control getControl() {
- return fControl;
- }
-
- public void setFocus() {
- fCrumb.activate();
- }
-
- IDebugContextProvider getContextProvider() {
- return fCrumb.getContextProvider();
- }
-
- int getHeight() {
- return fCrumb.getHeight();
- }
- }
-
- private BreadcrumbPage fBreadcrumbPage;
-
- class TreeViewerContextProvider extends AbstractDebugContextProvider implements IModelChangedListener {
-
- private ISelection fContext = null;
- private TreeModelViewer fViewer = null;
- private Visitor fVisitor = new Visitor();
-
- class Visitor implements IModelDeltaVisitor {
- public boolean visit(IModelDelta delta, int depth) {
- if ((delta.getFlags() & (IModelDelta.STATE | IModelDelta.CONTENT)) > 0) {
- // state and/or content change
- if ((delta.getFlags() & IModelDelta.SELECT) == 0) {
- // no select flag
- if ((delta.getFlags() & IModelDelta.CONTENT) > 0) {
- // content has changed without select >> possible re-activation
- possibleChange(getViewerTreePath(delta), DebugContextEvent.ACTIVATED);
- } else if ((delta.getFlags() & IModelDelta.STATE) > 0) {
- // state has changed without select >> possible state change of active context
- possibleChange(getViewerTreePath(delta), DebugContextEvent.STATE);
- }
- }
- }
- return true;
- }
- }
-
- /**
- * Returns a tree path for the node, *not* including the root element.
- *
- * @param node
- * model delta
- * @return corresponding tree path
- */
- private TreePath getViewerTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
- IModelDelta parentDelta = node.getParentDelta();
- while (parentDelta != null) {
- list.add(0, node.getElement());
- node = parentDelta;
- parentDelta = node.getParentDelta();
- }
- return new TreePath(list.toArray());
- }
-
- public TreeViewerContextProvider(TreeModelViewer viewer) {
- super(LaunchView.this);
- fViewer = viewer;
- fViewer.addModelChangedListener(this);
- }
-
- protected void dispose() {
- fContext = null;
- fViewer.removeModelChangedListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextProvider#getActiveContext()
- */
- public synchronized ISelection getActiveContext() {
- return fContext;
- }
-
- protected void activate(ISelection selection) {
- synchronized (this) {
- fContext = selection;
- }
- fire(new DebugContextEvent(this, selection, DebugContextEvent.ACTIVATED));
- }
-
- protected void possibleChange(TreePath element, int type) {
- DebugContextEvent event = null;
- synchronized (this) {
- if (fContext instanceof ITreeSelection) {
- ITreeSelection ss = (ITreeSelection) fContext;
- if (ss.size() == 1) {
- TreePath current = ss.getPaths()[0];
- if (current.startsWith(element, null)) {
- if (current.getSegmentCount() == element.getSegmentCount()) {
- event = new DebugContextEvent(this, fContext, type);
- } else {
- // if parent of the currently selected element
- // changes, issue event to update STATE only
- event = new DebugContextEvent(this, fContext, DebugContextEvent.STATE);
- }
- }
- }
- }
- }
- if (event == null) {
- return;
- }
- if (getControl().getDisplay().getThread() == Thread.currentThread()) {
- fire(event);
- } else {
- final DebugContextEvent finalEvent = event;
- Job job = new UIJob("context change") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- // verify selection is still the same context since job was scheduled
- synchronized (TreeViewerContextProvider.this) {
- if (fContext instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) fContext;
- Object changed = ((IStructuredSelection)finalEvent.getContext()).getFirstElement();
- if (!(ss.size() == 1 && ss.getFirstElement().equals(changed))) {
- return Status.OK_STATUS;
- }
- }
- }
- fire(finalEvent);
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener#modelChanged(org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta)
- */
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
- delta.accept(fVisitor);
- }
-
- }
-
- /**
- * Context provider
- */
- private TreeViewerContextProvider fTreeViewerDebugContextProvider;
-
- /**
- * The PageBookView, which is a base class of this class does not make it
- * easy to control which page is currently active. It is intended that the
- * page book pages are associated with workbench parts, and the parts are
- * in turn associated with PageRec records.
- * <p>
- * PageRec is needed in order to properly active a page book page, by
- * calling showPageRec(), so in this class we need to add some hooks in
- * order to obtain the page record for the tree viewer page and the
- * breadcrumb page.</p><p>
- * For the default page, we override the showPageRec()
- * to determine if the default page is being shown and if it is, we save
- * its record for later use. showPageRec() is always called for the default
- * page after it is created. For the breadcrumb page, we use the page book
- * view mechanism to create the page based on a workbench part, but we have
- * to create a dummy part in order for this to work.
- * </p>
- * <p>
- * See bug 262845 and 262870.
- * </p>
- *
- * @see #createPartControl(Composite)
- * @see BreadcrumbWorkbenchPart
- * @eee #doCreatePage(IWorkbenchPart)
- * @see #isImportant(IWorkbenchPart)
- * @see #autoSelectViewPage(Composite)
- * @see #showTreeViewerPage()
- * @see #showBreadcrumbPage()
- */
- private PageRec fDefaultPageRec = null;
-
- private ISelectionChangedListener fTreeViewerSelectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- fTreeViewerDebugContextProvider.activate(event.getSelection());
- }
- };
-
- private class ContextProviderProxy extends AbstractDebugContextProvider implements IDebugContextListener {
- private IDebugContextProvider fActiveProvider;
- private IDebugContextProvider[] fProviders;
-
- ContextProviderProxy(IDebugContextProvider[] providers) {
- super(LaunchView.this);
- fProviders = providers;
- fActiveProvider = providers[0];
- for (int i = 0; i < fProviders.length; i++) {
- fProviders[i].addDebugContextListener(this);
- }
- }
-
- void setActiveProvider(IDebugContextProvider provider) {
- if (!provider.equals(fActiveProvider)) {
- ISelection activeContext = getActiveContext();
- fActiveProvider = provider;
- ISelection newActiveContext = getActiveContext();
- if (!activeContext.equals(newActiveContext)) {
- fire(new DebugContextEvent(this, getActiveContext(), DebugContextEvent.ACTIVATED));
- }
- }
- }
-
- public ISelection getActiveContext() {
- ISelection activeContext = fActiveProvider.getActiveContext();
- if (activeContext != null) {
- return activeContext;
- }
- return TreeSelection.EMPTY;
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- if (event.getSource().equals(fActiveProvider)) {
- fire(new DebugContextEvent(this, event.getContext(), event.getFlags()));
- }
- }
-
- void dispose() {
- for (int i = 0; i < fProviders.length; i++) {
- fProviders[i].removeDebugContextListener(this);
- }
- fProviders = null;
- fActiveProvider = null;
- }
- }
-
- private ContextProviderProxy fContextProviderProxy;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.DEBUG_VIEW;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#createActions()
- */
- protected void createActions() {
- setAction("Properties", new PropertyDialogAction(getSite(), getSite().getSelectionProvider())); //$NON-NLS-1$
- fEditConfigAction = new EditLaunchConfigurationAction();
- fAddToFavoritesAction = new AddToFavoritesAction();
- fEditSourceAction = new EditSourceLookupPathAction(this);
- fLookupAction = new LookupSourceAction(this);
- setAction(FIND_ACTION, new VirtualFindAction((InternalTreeModelViewer) getViewer()));
-
- addCapabilityAction(new TerminateCommandAction(), TERMINATE);
- addCapabilityAction(new DisconnectCommandAction(), DISCONNECT);
- addCapabilityAction(new SuspendCommandAction(), SUSPEND);
- addCapabilityAction(new ResumeCommandAction(), RESUME);
- addCapabilityAction(new StepReturnCommandAction(), STEP_RETURN);
- addCapabilityAction(new StepOverCommandAction(), STEP_OVER);
- addCapabilityAction(new StepIntoCommandAction(), STEP_INTO);
- addCapabilityAction(new DropToFrameCommandAction(), DROP_TO_FRAME);
- addCapabilityAction(new TerminateAndRemoveAction(), TERMINATE_AND_REMOVE);
- addCapabilityAction(new TerminateAndRelaunchAction(), TERMINATE_AND_RELAUNCH);
- addCapabilityAction(new RestartCommandAction(), RESTART);
- addCapabilityAction(new TerminateAllAction(), TERMINATE_ALL);
- addCapabilityAction(new ToggleStepFiltersAction(), TOGGLE_STEP_FILTERS);
- }
-
-
- /**
- * Initializes the action and associates it with the given id.
- *
- * @param capability
- * @param actionID
- */
- private void addCapabilityAction(DebugCommandAction capability, String actionID) {
- capability.init(this);
- setAction(actionID, capability);
- }
-
- /**
- * Disposes the given action.
- *
- * @param actionID
- */
- private void disposeCommandAction(String actionID) {
- DebugCommandAction action = (DebugCommandAction) getAction(actionID);
- action.dispose();
- }
-
- /**
- * Override the default implementation to create the breadcrumb page.
- *
- * @since 3.5
- * @see #fDefaultPageRec
- */
- public void createPartControl(final Composite parent) {
- super.createPartControl(parent);
-
- // Copy the global action handlers to the default page.
- setGlobalActionBarsToPage((IPageBookViewPage)getDefaultPage());
-
- // Add view as a selection listener to the site.
- getSite().getSelectionProvider().addSelectionChangedListener(this);
-
- // Set the tree viewer as the selection provider to the default page.
- // The page book view handles switching the between page selection
- // providers as needed.
- ((IPageBookViewPage)getDefaultPage()).getSite().setSelectionProvider(getViewer());
-
- // Call the PageBookView part listener to indirectly create the breadcrumb page.
- // This call eventually calls doCreatePage() implemented below.
- partActivated(new BreadcrumbWorkbenchPart(getSite()));
-
- fContextProviderProxy = new ContextProviderProxy(
- new IDebugContextProvider[] {fTreeViewerDebugContextProvider, fBreadcrumbPage.getContextProvider()});
- DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).addDebugContextProvider(fContextProviderProxy);
-
- // Create and configure actions for selecting view mode.
- createViewModeActions(parent);
- IPreferenceStore prefStore = DebugUIPlugin.getDefault().getPreferenceStore();
- String mode = prefStore.getString(IDebugPreferenceConstants.DEBUG_VIEW_MODE);
- setViewMode(mode, parent);
- for (int i = 0; i < fDebugViewModeActions.length; i++) {
- fDebugViewModeActions[i].setChecked(fDebugViewModeActions[i].getMode().equals(mode));
- }
-
- // Add a resize listener for the view to activate breadcrumb as needed.
- parent.addControlListener(new ControlListener() {
- public void controlMoved(ControlEvent e) {
- }
- public void controlResized(ControlEvent e) {
- if (parent.isDisposed()) {
- return;
- }
- if (IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO.equals(fCurrentViewMode)) {
- autoSelectViewPage(parent);
- }
- }
- });
- }
-
- /**
- * Copies the view's global action handlers created by createActions(),
- * into the page site's action bars. This is necessary because the page
- * book view resets the view site's global actions after each page switch
- * (see bug 264618).
- *
- * @param page Page to copy the global actions into.
- *
- * @since 3.5
- */
- private void setGlobalActionBarsToPage(IPageBookViewPage page) {
- IActionBars pageActionBars = page.getSite().getActionBars();
- // Set the view site action bars created by createActions() to the
- // default page site.
- IActionBars bars = getViewSite().getActionBars();
- pageActionBars.setGlobalActionHandler(FIND_ACTION, bars.getGlobalActionHandler(FIND_ACTION));
- pageActionBars.setGlobalActionHandler(COPY_ACTION, bars.getGlobalActionHandler(COPY_ACTION));
- }
-
- /**
- * Override the default implementation to create the breadcrumb page.
- *
- * @since 3.5
- * @see #fDefaultPageRec
- */
- protected PageRec doCreatePage(IWorkbenchPart part) {
- if (part instanceof BreadcrumbWorkbenchPart) {
- fBreadcrumbPage = new BreadcrumbPage();
- fBreadcrumbPage.createControl(getPageBook());
- initPage(fBreadcrumbPage);
- setGlobalActionBarsToPage(fBreadcrumbPage);
- return new PageRec(part, fBreadcrumbPage);
- }
- return null;
- }
-
- /**
- * Override the default implementation to create the breadcrumb page.
- *
- * @since 3.5
- * @see #fDefaultPageRec
- */
- protected boolean isImportant(IWorkbenchPart part) {
- return part instanceof BreadcrumbWorkbenchPart;
- }
-
- /**
- * Override the default implementation to gain access at the default
- * page record.
- *
- * @since 3.5
- * @see #fDefaultPageRec
- */
- protected void showPageRec(PageRec pageRec) {
- if (pageRec.page == getDefaultPage()) {
- fDefaultPageRec = pageRec;
- }
-
- super.showPageRec(pageRec);
- }
-
- /**
- * Creates actions for controlling view mode.
- *
- * @param parent The view's parent control used to calculate view size
- * in auto mode.
- */
- private void createViewModeActions(final Composite parent) {
- IActionBars actionBars = getViewSite().getActionBars();
- IMenuManager viewMenu = actionBars.getMenuManager();
-
- fDebugViewModeActions = new DebugViewModeAction[3];
- fDebugViewModeActions[0] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO, parent);
- fDebugViewModeActions[1] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_FULL, parent);
- fDebugViewModeActions[2] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_COMPACT, parent);
- fBreadcrumbDropDownAutoExpandAction = new BreadcrumbDropDownAutoExpandAction(this);
-
- viewMenu.add(new Separator());
- final MenuManager modeSubmenu = new MenuManager(LaunchViewMessages.LaunchView_ViewModeMenu_label);
- modeSubmenu.setRemoveAllWhenShown(true);
- modeSubmenu.add(fDebugViewModeActions[0]);
- modeSubmenu.add(fDebugViewModeActions[1]);
- modeSubmenu.add(fDebugViewModeActions[2]);
- modeSubmenu.add(new Separator());
- modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction);
- viewMenu.add(modeSubmenu);
- viewMenu.add(new Separator());
-
- modeSubmenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- modeSubmenu.add(fDebugViewModeActions[0]);
- modeSubmenu.add(fDebugViewModeActions[1]);
- modeSubmenu.add(fDebugViewModeActions[2]);
- modeSubmenu.add(new Separator());
- modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction);
- }
- });
-
- }
-
-
- /**
- * Sets the current view mode. If needed, the active view page is changed.
- *
- * @param mode New mode to set.
- * @param parent The view's parent control used to calculate view size
- * in auto mode.
- *
- * @since 3.5
- */
- void setViewMode(String mode, Composite parent) {
- if (fCurrentViewMode.equals(mode)) {
- return;
- }
-
- fCurrentViewMode = mode;
- if (IDebugPreferenceConstants.DEBUG_VIEW_MODE_COMPACT.equals(mode)) {
- showBreadcrumbPage();
- } else if (IDebugPreferenceConstants.DEBUG_VIEW_MODE_FULL.equals(mode)) {
- showTreeViewerPage();
- } else {
- autoSelectViewPage(parent);
- }
- DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugPreferenceConstants.DEBUG_VIEW_MODE, mode);
- }
-
- /**
- * Based on the current view size, select the active view page
- * (tree viewer vs. breadcrumb).
- *
- * @param parent View pane control.
- *
- * @since 3.5
- */
- private void autoSelectViewPage(Composite parent) {
- int breadcrumbHeight = fBreadcrumbPage.getHeight();
- if (parent.getClientArea().height < breadcrumbHeight + BREADCRUMB_TRIGGER_RANGE) {
- showBreadcrumbPage();
- }
- else if (parent.getClientArea().height > breadcrumbHeight + BREADCRUMB_STICKY_RANGE)
- {
- showTreeViewerPage();
- }
- }
-
-
- /**
- * Shows the tree viewer in the Debug view.
- *
- * @since 3.5
- */
- void showTreeViewerPage() {
- if (fDefaultPageRec != null && !getDefaultPage().equals(getCurrentPage())) {
- showPageRec(fDefaultPageRec);
- fContextProviderProxy.setActiveProvider(fTreeViewerDebugContextProvider);
- // Clear the selection in the breadcrumb to avoid having it re-selected
- // when the breadcrumb is activated again (bug 268124).
- fBreadcrumbPage.fCrumb.clearSelection();
- }
- }
-
- /**
- * Shows the breadcrumb in the Debug view.
- *
- * @since 3.5
- */
- void showBreadcrumbPage() {
- PageRec rec = getPageRec(fBreadcrumbPage);
- if (rec != null && !fBreadcrumbPage.equals(getCurrentPage())) {
- showPageRec(rec);
- // Ask the breadcrumb to take focus if we're the active part.
- if (getSite().getPage().getActivePart() == this) {
- setFocus();
- }
- fBreadcrumbPage.fCrumb.debugContextChanged(new DebugContextEvent(
- fTreeViewerDebugContextProvider,
- fTreeViewerDebugContextProvider.getActiveContext(),
- DebugContextEvent.ACTIVATED));
- fContextProviderProxy.setActiveProvider(fBreadcrumbPage.getContextProvider());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite)
- */
- protected Viewer createViewer(Composite parent) {
- fPresentation = new DelegatingModelPresentation();
- TreeModelViewer viewer = new TreeModelViewer(parent,
- SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL,
- new DebugModelPresentationContext(IDebugUIConstants.ID_DEBUG_VIEW, fPresentation));
-
- viewer.addSelectionChangedListener(fTreeViewerSelectionChangedListener);
- viewer.getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- handleDeleteKeyPressed();
- }
- }
- });
- viewer.addViewerUpdateListener(this);
-
- viewer.setInput(DebugPlugin.getDefault().getLaunchManager());
- //setEventHandler(new LaunchViewEventHandler(this));
- fTreeViewerDebugContextProvider = new TreeViewerContextProvider(viewer);
-
- return viewer;
- }
-
- private void handleDeleteKeyPressed() {
- IStructuredSelection selection= (IStructuredSelection) getViewer().getSelection();
- Iterator iter= selection.iterator();
- Object item;
- boolean itemsToTerminate= false;
- ITerminate terminable;
- while (iter.hasNext()) {
- item= iter.next();
- if (item instanceof ITerminate) {
- terminable= (ITerminate) item;
- if (terminable.canTerminate() && !terminable.isTerminated()) {
- itemsToTerminate= true;
- break;
- }
- }
- }
- if (itemsToTerminate) {
- // Prompt the user to proceed with termination
- if (!MessageDialog.openQuestion(getSite().getShell(), DebugUIViewsMessages.LaunchView_Terminate_and_Remove_1, DebugUIViewsMessages.LaunchView_Terminate_and_remove_selected__2)) {
- return;
- }
- }
- MultiStatus status= new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, DebugUIViewsMessages.LaunchView_Exceptions_occurred_attempting_to_terminate_and_remove_3, null);
- iter= selection.iterator();
- while (iter.hasNext()) {
- try {
- terminateAndRemove(iter.next());
- } catch (DebugException exception) {
- status.merge(exception.getStatus());
- }
- }
- if (!status.isOK()) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), DebugUIViewsMessages.LaunchView_Terminate_and_Remove_4, DebugUIViewsMessages.LaunchView_Terminate_and_remove_failed_5, status);
- } else {
- DebugUIPlugin.log(status);
- }
- }
- }
-
- /**
- * Terminates and removes the given element from the launch manager
- */
- public static void terminateAndRemove(Object element) throws DebugException {
- ILaunch launch = DebugUIPlugin.getLaunch(element);
- ITerminate terminable = launch;
- if (terminable == null) {
- if (element instanceof ITerminate) {
- terminable = (ITerminate) element;
- }
- }
- if (terminable == null) {
- return;
- }
- if (!(terminable.canTerminate() || terminable.isTerminated())) {
- // Don't try to terminate or remove attached launches
- return;
- }
- try {
- if (!terminable.isTerminated()) {
- terminable.terminate();
- }
- } finally {
- if (launch != null) {
- ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
- lManager.removeLaunch(launch);
- }
- }
- }
-
- private void commonInit(IViewSite site) {
- site.getPage().addPartListener((IPartListener2) this);
- site.getWorkbenchWindow().addPageListener(this);
- site.getWorkbenchWindow().addPerspectiveListener(this);
- }
-
- private void preferenceInit(IViewSite site) {
- PREF_STATE_MEMENTO = PREF_STATE_MEMENTO + site.getId();
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- String string = store.getString(PREF_STATE_MEMENTO);
- if(string.length() > 0) {
- ByteArrayInputStream bin = new ByteArrayInputStream(string.getBytes());
- InputStreamReader reader = new InputStreamReader(bin);
- try {
- XMLMemento stateMemento = XMLMemento.createReadRoot(reader);
- setMemento(stateMemento);
- } catch (WorkbenchException e) {
- } finally {
- try {
- reader.close();
- bin.close();
- } catch (IOException e){}
- }
- }
- IMemento mem = getMemento();
-
- if (mem != null) {
- Boolean auto = mem.getBoolean(BREADCRUMB_DROPDOWN_AUTO_EXPAND);
- if(auto != null) {
- setBreadcrumbDropDownAutoExpand(auto.booleanValue());
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite)
- */
- public void init(IViewSite site) throws PartInitException {
- super.init(site);
- commonInit(site);
- preferenceInit(site);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- commonInit(site);
- preferenceInit(site);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.PageBookView#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- String id = part.getSite().getId();
- if (id.equals(getSite().getId())) {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- OutputStreamWriter writer = new OutputStreamWriter(bout);
-
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("DebugViewMemento"); //$NON-NLS-1$
- saveViewerState(memento);
- memento.save(writer);
-
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- String xmlString = bout.toString();
- store.putValue(PREF_STATE_MEMENTO, xmlString);
- } catch (IOException e) {
- } finally {
- try {
- writer.close();
- bout.close();
- } catch (IOException e) {
- }
- }
- }
- super.partDeactivated(part);
- }
-
- /**
- * Saves the current state of the viewer
- * @param memento the memento to write the viewer state into
- */
- public void saveViewerState(IMemento memento) {
- memento.putBoolean(BREADCRUMB_DROPDOWN_AUTO_EXPAND, getBreadcrumbDropDownAutoExpand());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
- */
- protected void configureToolBar(IToolBarManager tbm) {
- tbm.add(new Separator(IDebugUIConstants.THREAD_GROUP));
- tbm.add(new Separator(IDebugUIConstants.STEP_GROUP));
- tbm.add(new GroupMarker(IDebugUIConstants.STEP_INTO_GROUP));
- tbm.add(new GroupMarker(IDebugUIConstants.STEP_OVER_GROUP));
- tbm.add(new GroupMarker(IDebugUIConstants.STEP_RETURN_GROUP));
- tbm.add(new GroupMarker(IDebugUIConstants.EMPTY_STEP_GROUP));
- tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP));
-
- tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESUME));
- tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(SUSPEND));
- tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE));
- tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(DISCONNECT));
-
- tbm.appendToGroup(IDebugUIConstants.STEP_INTO_GROUP, getAction(STEP_INTO));
- tbm.appendToGroup(IDebugUIConstants.STEP_OVER_GROUP, getAction(STEP_OVER));
- tbm.appendToGroup(IDebugUIConstants.STEP_RETURN_GROUP, getAction(STEP_RETURN));
-
- tbm.appendToGroup(IDebugUIConstants.EMPTY_STEP_GROUP, getAction(DROP_TO_FRAME));
-
- tbm.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- getSite().getSelectionProvider().removeSelectionChangedListener(this);
- DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).removeDebugContextProvider(fContextProviderProxy);
- fContextProviderProxy.dispose();
- fTreeViewerDebugContextProvider.dispose();
- disposeActions();
- Viewer viewer = getViewer();
- if (viewer != null) {
- viewer.removeSelectionChangedListener(fTreeViewerSelectionChangedListener);
- ((TreeModelViewer)viewer).removeViewerUpdateListener(this);
- }
- IWorkbenchPage page = getSite().getPage();
- page.removePartListener((IPartListener2) this);
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.removePerspectiveListener(this);
- window.removePageListener(this);
-
- super.dispose();
- }
-
- private void disposeActions() {
- PropertyDialogAction properties = (PropertyDialogAction) getAction("Properties"); //$NON-NLS-1$
- properties.dispose();
-
- disposeCommandAction(TERMINATE);
- disposeCommandAction(DISCONNECT);
- disposeCommandAction(SUSPEND);
- disposeCommandAction(RESUME);
- disposeCommandAction(STEP_RETURN);
- disposeCommandAction(STEP_OVER);
- disposeCommandAction(STEP_INTO);
- disposeCommandAction(DROP_TO_FRAME);
- disposeCommandAction(TERMINATE_AND_REMOVE);
- disposeCommandAction(TERMINATE_AND_RELAUNCH);
- disposeCommandAction(RESTART);
- disposeCommandAction(TERMINATE_ALL);
- }
-
- /**
- * The selection has changed in the viewer. Show the
- * associated source code if it is a stack frame.
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- updateObjects();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- ISelection selection= event.getSelection();
- if (!(selection instanceof IStructuredSelection)) {
- return;
- }
- IStructuredSelection ss= (IStructuredSelection)selection;
- Object o= ss.getFirstElement();
- if (o == null || o instanceof IStackFrame) {
- return;
- }
- StructuredViewer viewer = (StructuredViewer) getViewer();
- viewer.refresh(o);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- setActive(page.findView(getSite().getId()) != null);
- updateObjects();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
- */
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
- setActive(page.findView(getSite().getId()) != null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference, java.lang.String)
- */
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageActivated(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageActivated(IWorkbenchPage page) {
- if (getSite().getPage().equals(page)) {
- setActive(true);
- updateObjects();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageClosed(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageClosed(IWorkbenchPage page) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageOpened(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageOpened(IWorkbenchPage page) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugView#getPresentation(java.lang.String)
- */
- public IDebugModelPresentation getPresentation(String id) {
- return ((DelegatingModelPresentation)fPresentation).getPresentation(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- protected void fillContextMenu(IMenuManager menu) {
- TreeSelection sel = (TreeSelection) fTreeViewerDebugContextProvider.getActiveContext();
- Object element = sel != null && sel.size() > 0 ? sel.getFirstElement() : null;
-
- menu.add(new Separator(IDebugUIConstants.EMPTY_EDIT_GROUP));
- menu.add(new Separator(IDebugUIConstants.EDIT_GROUP));
- menu.add(getAction(FIND_ACTION));
- menu.add(new Separator(IDebugUIConstants.EMPTY_STEP_GROUP));
- menu.add(new Separator(IDebugUIConstants.STEP_GROUP));
- menu.add(new GroupMarker(IDebugUIConstants.STEP_INTO_GROUP));
- menu.add(new GroupMarker(IDebugUIConstants.STEP_OVER_GROUP));
- menu.add(new GroupMarker(IDebugUIConstants.STEP_RETURN_GROUP));
- menu.add(new Separator(IDebugUIConstants.RENDER_GROUP));
- menu.add(new Separator(IDebugUIConstants.EMPTY_THREAD_GROUP));
- menu.add(new Separator(IDebugUIConstants.THREAD_GROUP));
- menu.add(new Separator(IDebugUIConstants.EMPTY_LAUNCH_GROUP));
- menu.add(new Separator(IDebugUIConstants.LAUNCH_GROUP));
- IStructuredSelection selection = (IStructuredSelection) getSite().getSelectionProvider().getSelection();
- updateAndAdd(menu, fEditConfigAction, selection);
- updateAndAdd(menu, fAddToFavoritesAction, selection);
- updateAndAdd(menu, fEditSourceAction, selection);
- updateAndAdd(menu, fLookupAction, selection);
- menu.add(new Separator(IDebugUIConstants.EMPTY_RENDER_GROUP));
- menu.add(new Separator(IDebugUIConstants.RENDER_GROUP));
- menu.add(new Separator(IDebugUIConstants.PROPERTY_GROUP));
- PropertyDialogAction action = (PropertyDialogAction)getAction("Properties"); //$NON-NLS-1$
- /**
- * TODO hack to get around bug 148424, remove if UI ever fixes the PropertyDialogAction to respect enablesWhen conditions
- */
- action.setEnabled(action.isApplicableForSelection() && !(element instanceof ILaunch));
- menu.add(action);
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
-
- menu.appendToGroup(IDebugUIConstants.LAUNCH_GROUP, getAction(TERMINATE_AND_REMOVE));
- menu.appendToGroup(IDebugUIConstants.LAUNCH_GROUP, getAction(TERMINATE_ALL));
-
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESUME));
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(SUSPEND));
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE));
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE_AND_RELAUNCH));
- if (element instanceof IAdaptable && ((IAdaptable)element).getAdapter(IRestartHandler.class) != null) {
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESTART));
- }
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(DISCONNECT));
-
- menu.appendToGroup(IDebugUIConstants.STEP_INTO_GROUP, getAction(STEP_INTO));
- menu.appendToGroup(IDebugUIConstants.STEP_OVER_GROUP, getAction(STEP_OVER));
- menu.appendToGroup(IDebugUIConstants.STEP_RETURN_GROUP, getAction(STEP_RETURN));
-
- menu.appendToGroup(IDebugUIConstants.EMPTY_STEP_GROUP, getAction(DROP_TO_FRAME));
-
- menu.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS));
- }
-
- /**
- * Updates the enabled state of the given action based on the selection
- * and adds to the menu if enabled.
- *
- * @param menu menu to add the action to
- * @param action action to add if enabled
- * @param selection selection to update enabled state for
- */
- private void updateAndAdd(IMenuManager menu, SelectionListenerAction action, IStructuredSelection selection) {
- action.selectionChanged(selection);
- if (action.isEnabled()) {
- menu.add(action);
- }
- }
-
- /**
- * Sets whether this view is in the active page of a
- * perspective. Since a page can have more than one
- * perspective, this view only show's source when in
- * the active perspective/page.
- *
- * @param active whether this view is in the active page of a
- * perspective
- */
- protected void setActive(boolean active) {
- fIsActive = active;
- }
-
- /**
- * Returns whether this view is in the active page of
- * the active perspective and has been fully created.
- *
- * @return whether this view is in the active page of
- * the active perspective and has been fully created.
- */
- protected boolean isActive() {
- return fIsActive && getViewer() != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInTarget#show(org.eclipse.ui.part.ShowInContext)
- */
- public boolean show(ShowInContext context) {
- ISelection selection = context.getSelection();
- if (selection != null) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)selection;
- if (ss.size() == 1) {
- Object obj = ss.getFirstElement();
- if (obj instanceof IDebugTarget || obj instanceof IProcess) {
- Viewer viewer = getViewer();
- if (viewer instanceof InternalTreeModelViewer) {
- InternalTreeModelViewer tv = (InternalTreeModelViewer) viewer;
- tv.setSelection(selection, true, true);
- } else {
- viewer.setSelection(selection, true);
- }
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInSource#getShowInContext()
- */
- public ShowInContext getShowInContext() {
- if (isActive()) {
- IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection();
- if (selection.size() == 1) {
- Object object = selection.getFirstElement();
- if (object instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) object;
- IShowInSource show = (IShowInSource) adaptable.getAdapter(IShowInSource.class);
- if (show != null) {
- return show.getShowInContext();
- }
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInTargetList#getShowInTargetIds()
- */
- public String[] getShowInTargetIds() {
- if (isActive()) {
- IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection();
- if (selection.size() == 1) {
- Object object = selection.getFirstElement();
- if (object instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) object;
- IShowInTargetList show = (IShowInTargetList) adaptable.getAdapter(IShowInTargetList.class);
- if (show != null) {
- return show.getShowInTargetIds();
- }
- }
- }
- }
- return new String[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partClosed(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partVisible(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part == this) {
- setActive(true);
-// TODO: Workaround for Bug #63332. Reexamine after M9.
-// updateContextListener();
- // When the launch view becomes visible, turn on the
- // debug action set. Note that the workbench will handle the
- // case where the user really doesn't want the action set
- // enabled - showActionSet(String) will do nothing for an
- // action set that's been manually disabled.
- getSite().getPage().showActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partOpened(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partActivated(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partDeactivated(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partHidden(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partInputChanged(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#becomesVisible()
- */
- protected void becomesVisible() {
- super.becomesVisible();
- getViewer().refresh();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateComplete(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void updateComplete(IViewerUpdate update) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateStarted(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void updateStarted(IViewerUpdate update) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesBegin()
- */
- public synchronized void viewerUpdatesBegin() {
- IWorkbenchSiteProgressService progressService =
- (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
- if (progressService != null) {
- progressService.incrementBusy();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesComplete()
- */
- public synchronized void viewerUpdatesComplete() {
- IWorkbenchSiteProgressService progressService =
- (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
- if (progressService != null) {
- progressService.decrementBusy();
- }
- }
-
- /**
- * Returns whether the breadcrumb viewer is currently visible in the view.
- *
- * @since 3.5
- */
- boolean isBreadcrumbVisible() {
- return fBreadcrumbPage.equals(getCurrentPage());
- }
-
- /**
- * Returns whether the elements in breadcrumb's drop-down viewer should be
- * automatically expanded.
- *
- * @since 3.5
- */
- boolean getBreadcrumbDropDownAutoExpand() {
- return fBreadcrumbDropDownAutoExpand;
- }
-
- /**
- * Sets whether the elements in breadcrumb's drop-down viewer should be
- * automatically expanded.
- *
- * @since 3.5
- */
- void setBreadcrumbDropDownAutoExpand(boolean expand) {
- fBreadcrumbDropDownAutoExpand = expand;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
deleted file mode 100644
index 6542fab63..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.viewers.breadcrumb.AbstractBreadcrumb;
-import org.eclipse.debug.internal.ui.viewers.breadcrumb.BreadcrumbViewer;
-import org.eclipse.debug.internal.ui.viewers.breadcrumb.IBreadcrumbDropDownSite;
-import org.eclipse.debug.internal.ui.viewers.breadcrumb.TreeViewerDropDown;
-import org.eclipse.debug.internal.ui.viewers.model.ILabelUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.SubTreeModelViewer;
-import org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.ui.contexts.AbstractDebugContextProvider;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextProvider;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreePathContentProvider;
-import org.eclipse.jface.viewers.ITreePathLabelProvider;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuDetectEvent;
-import org.eclipse.swt.events.MenuDetectListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * @since 3.5
- */
-public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugContextListener, ILabelUpdateListener {
-
- private static class Input {
- final TreePath fPath;
-
- Input(TreePath path) {
- fPath = path;
- }
-
- public boolean equals(Object obj) {
- return obj instanceof Input &&
- ((fPath == null && ((Input)obj).fPath == null) ||
- (fPath != null && fPath.equals( ((Input)obj).fPath )));
- }
-
- public int hashCode() {
- return fPath == null ? 0 : fPath.hashCode();
- }
- }
-
- private static class ContentProvider implements ITreePathContentProvider {
-
- private static final Object[] EMPTY_ELEMENTS_ARRAY = new Object[0];
-
- public Input fInput;
-
- public Object[] getChildren(TreePath parentPath) {
- if (hasChildren(parentPath)) {
- return new Object[] { fInput.fPath.getSegment(parentPath.getSegmentCount()) };
- }
- return EMPTY_ELEMENTS_ARRAY;
- }
-
- public TreePath[] getParents(Object element) {
- // Not supported
- return new TreePath[] { TreePath.EMPTY };
- }
-
- public boolean hasChildren(TreePath parentPath) {
- if ( parentPath.getSegmentCount() == 0) {
- return fInput != null;
- } else if (fInput != null &&
- fInput.fPath != null &&
- fInput.fPath.getSegmentCount() > parentPath.getSegmentCount())
- {
- for (int i = 0; i < parentPath.getSegmentCount(); i++) {
- if (i >= fInput.fPath.getSegmentCount()) {
- return false;
- } else {
- Object parentElement = parentPath.getSegment(i);
- Object contextElement = fInput.fPath.getSegment(i);
- if (!parentElement.equals(contextElement)) {
- return false;
- }
- }
- }
- return true;
- }
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- if (fInput != null &&
- fInput.fPath != null)
- {
- return getChildren(TreePath.EMPTY);
- } else {
- return new Object[] { fgEmptyDebugContextElement };
- }
- }
-
- public void dispose() {
- fInput = null;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput instanceof Input) {
- fInput = ((Input)newInput);
- } else {
- fInput = null;
- }
- }
- }
-
- private class LabelProvider extends BaseLabelProvider implements ITreePathLabelProvider {
- public void updateLabel(ViewerLabel label, TreePath elementPath) {
- if (fgEmptyDebugContextElement.equals(elementPath.getLastSegment())) {
- label.setText(LaunchViewMessages.Breadcrumb_NoActiveContext);
- label.setImage(null);
- } else {
- ViewerLabel treeViewerLabel = fTreeViewer.getElementLabel(elementPath, null);
- if (treeViewerLabel == null) {
- label.setText(LaunchViewMessages.Breadcrumb_NoActiveContext);
- label.setImage(null);
- } else {
- label.setText(treeViewerLabel.getText());
- label.setTooltipText(treeViewerLabel.getText());
- label.setImage(treeViewerLabel.getImage());
- label.setFont(treeViewerLabel.getFont());
- label.setForeground(treeViewerLabel.getForeground());
- label.setBackground(treeViewerLabel.getBackground());
-
- }
- }
- }
- }
-
- private final LaunchView fView;
- private final TreeModelViewer fTreeViewer;
- private final IDebugContextProvider fTreeViewerContextProvider;
- private Input fBreadcrumbInput;
- static final private Object fgEmptyDebugContextElement = new Object();
- private BreadcrumbViewer fViewer;
- private boolean fRefreshBreadcrumb = false;
-
- private class BreadcrumbContextProvider extends AbstractDebugContextProvider implements IDebugContextListener, ISelectionChangedListener {
-
- private ISelection fBreadcrumbSelection = null;
-
- BreadcrumbContextProvider() {
- super(fView);
- fViewer.addSelectionChangedListener(this);
- fBreadcrumbSelection = fViewer.getSelection();
- fTreeViewerContextProvider.addDebugContextListener(this);
- }
-
- public ISelection getActiveContext() {
- if (fBreadcrumbSelection != null && !fBreadcrumbSelection.isEmpty()) {
- return fBreadcrumbSelection;
- } else {
- ISelection treeViewerSelection = fTreeViewerContextProvider.getActiveContext();
- return treeViewerSelection != null ? treeViewerSelection : StructuredSelection.EMPTY;
- }
- }
-
- void dispose() {
- fViewer.removeSelectionChangedListener(this);
- fTreeViewerContextProvider.removeDebugContextListener(this);
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- fire(new DebugContextEvent(this, getActiveContext(), event.getFlags()));
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection oldContext = getActiveContext();
- fBreadcrumbSelection = event.getSelection();
- if (!getActiveContext().equals(oldContext)) {
- fire(new DebugContextEvent(this, getActiveContext(), DebugContextEvent.ACTIVATED));
- }
- }
- }
-
- private BreadcrumbContextProvider fBreadcrumbContextProvider;
-
- public LaunchViewBreadcrumb(LaunchView view, TreeModelViewer treeViewer, IDebugContextProvider contextProvider) {
- fView = view;
- fTreeViewer = treeViewer;
- fTreeViewer.addLabelUpdateListener(this);
- fTreeViewerContextProvider = contextProvider;
- fBreadcrumbInput = new Input( getPathForSelection(fTreeViewerContextProvider.getActiveContext()) );
- fTreeViewerContextProvider.addDebugContextListener(this);
- }
-
- protected void activateBreadcrumb() {
- }
-
- protected void deactivateBreadcrumb() {
- if (fViewer.isDropDownOpen()) {
- Shell shell = fViewer.getDropDownShell();
- if (shell != null && !shell.isDisposed()) {
- shell.close();
- }
- }
- }
-
- protected BreadcrumbViewer createViewer(Composite parent) {
- fViewer = new BreadcrumbViewer(parent, SWT.NONE) {
- protected Control createDropDown(Composite dropDownParent, IBreadcrumbDropDownSite site, TreePath path) {
- return createDropDownControl(dropDownParent, site, path);
- }
- };
-
- // Force the layout of the breadcrumb viewer so that we may calcualte
- // its proper size.
- parent.pack(true);
-
- fViewer.setContentProvider(new ContentProvider());
- fViewer.setLabelProvider(new LabelProvider());
-
- createMenuManager();
-
- fViewer.setInput(getCurrentInput());
-
- fBreadcrumbContextProvider = new BreadcrumbContextProvider();
-
- return fViewer;
- }
-
- protected void createMenuManager() {
- MenuManager menuMgr = new MenuManager("#PopUp"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fView.fillContextMenu(mgr);
- }
- });
- final Menu menu= menuMgr.createContextMenu(fViewer.getControl());
-
- // register the context menu such that other plug-ins may contribute to it
- if (fView.getSite() != null) {
- fView.getSite().registerContextMenu(menuMgr, fViewer);
- }
- fView.addContextMenuManager(menuMgr);
-
- fViewer.addMenuDetectListener(new MenuDetectListener() {
- public void menuDetected(MenuDetectEvent event) {
- menu.setLocation(event.x + 10, event.y + 10);
- menu.setVisible(true);
- while (!menu.isDisposed() && menu.isVisible()) {
- if (!menu.getDisplay().readAndDispatch())
- menu.getDisplay().sleep();
- }
- }
- });
- }
-
- protected Object getCurrentInput() {
- return fBreadcrumbInput;
- }
-
- protected boolean open(ISelection selection) {
- // Let the drop-down control implementation itself handle activating a new context.
- return false;
- }
-
- public void dispose() {
- fBreadcrumbContextProvider = null;
- fTreeViewerContextProvider.removeDebugContextListener(this);
- fTreeViewer.removeLabelUpdateListener(this);
- fBreadcrumbContextProvider.dispose();
- fViewer = null;
- super.dispose();
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- if (fView.isBreadcrumbVisible()) {
- fBreadcrumbInput = new Input(getPathForSelection(event.getContext()));
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
- setInput(getCurrentInput());
-
- // If the context was activated, then clear the selection in breadcrumb
- // so that the activated context will become the active context for the
- // window.
- fViewer.setSelection(StructuredSelection.EMPTY);
- } else {
- refresh();
- }
- }
- }
-
- public void labelUpdateStarted(ILabelUpdate update) {
- }
-
- public void labelUpdateComplete(ILabelUpdate update) {
- if (fBreadcrumbInput != null && fBreadcrumbInput.fPath != null) {
- if (fBreadcrumbInput.fPath.startsWith(update.getElementPath(), null)) {
- synchronized (this) {
- fRefreshBreadcrumb = true;
- }
- }
- }
- }
-
- public void labelUpdatesBegin() {
- }
-
- public void labelUpdatesComplete() {
- boolean refresh = false;
- synchronized(this) {
- refresh = fRefreshBreadcrumb;
- fRefreshBreadcrumb = false;
- }
- if (fView.isBreadcrumbVisible() && refresh) {
- new UIJob(fViewer.getControl().getDisplay(), "refresh breadcrumb") { //$NON-NLS-1$
- { setSystem(true); }
- public IStatus runInUIThread(IProgressMonitor monitor) {
- refresh();
- return Status.OK_STATUS;
- }
- }.schedule();
- }
- }
-
- IDebugContextProvider getContextProvider() {
- return fBreadcrumbContextProvider;
- }
-
- int getHeight() {
- return fViewer.getControl().getSize().y;
- }
-
- void clearSelection() {
- fViewer.setSelection(StructuredSelection.EMPTY);
- }
-
- private TreePath getPathForSelection(ISelection selection) {
- if (selection instanceof ITreeSelection && !selection.isEmpty()) {
- return ((ITreeSelection)selection).getPaths()[0];
- }
- return null;
- }
-
- public Control createDropDownControl(Composite parent, final IBreadcrumbDropDownSite site, TreePath paramPath) {
-
- TreeViewerDropDown dropDownTreeViewer = new TreeViewerDropDown() {
-
- SubTreeModelViewer fDropDownViewer;
-
- protected TreeViewer createTreeViewer(Composite composite, int style, final TreePath path) {
- fDropDownViewer = new SubTreeModelViewer(
- composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL | SWT.POP_UP,
- fTreeViewer.getPresentationContext());
-
- Object launchViewInput = fTreeViewer.getInput();
- fDropDownViewer.setInput(launchViewInput, path.getParentPath());
-
- ViewerFilter[] filters = fTreeViewer.getFilters();
- fDropDownViewer.setFilters(filters);
-
- ModelDelta stateDelta = new ModelDelta(launchViewInput, IModelDelta.NO_CHANGE);
- fTreeViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.EXPAND | IModelDelta.SELECT);
-
- // If we do not want to expand the elements in the drop-down.
- // Prune the delta to only select the element in the
- // top-most list.
- if (!fView.getBreadcrumbDropDownAutoExpand()) {
- final ModelDelta prunedDelta = new ModelDelta(launchViewInput, IModelDelta.NO_CHANGE);
- stateDelta.accept(new IModelDeltaVisitor() {
- ModelDelta copy = prunedDelta;
- public boolean visit(IModelDelta delta, int depth) {
- TreePath deltaPath = getViewerTreePath(delta);
- if (deltaPath.getSegmentCount() == 0) {
- // skip copying the root element, only copy it's child count
- copy.setChildCount(delta.getChildCount());
- } else if (deltaPath.getSegmentCount() != 0 && path.startsWith(deltaPath, null) ) {
- // Build up the delta copy along the path of the drop-down element.
- copy = copy.addNode(
- delta.getElement(), delta.getIndex(), delta.getFlags(), delta.getChildCount());
- }
-
- // If the delta is for the drop-down element, set its select flag and stop traversing
- // the delta..
- if (deltaPath.equals(path)) {
- copy.setFlags(IModelDelta.SELECT | IModelDelta.REVEAL);
- return false;
- }
-
- // Continue traversing the delta.
- return true;
- }
-
- private TreePath getViewerTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
- IModelDelta parentDelta = node.getParentDelta();
- while (parentDelta != null) {
- list.add(0, node.getElement());
- node = parentDelta;
- parentDelta = node.getParentDelta();
- }
- return new TreePath(list.toArray());
- }
- });
- stateDelta = prunedDelta;
- }
-
- fDropDownViewer.updateViewer(stateDelta);
-
- fDropDownViewer.addLabelUpdateListener(new ILabelUpdateListener() {
- public void labelUpdateComplete(ILabelUpdate update) {}
- public void labelUpdatesBegin() {}
- public void labelUpdateStarted(ILabelUpdate update) {}
- public void labelUpdatesComplete() {
- new UIJob(fViewer.getControl().getDisplay(), "resize breadcrub dropdown") { //$NON-NLS-1$
- { setSystem(true); }
- public IStatus runInUIThread(IProgressMonitor monitor) {
- site.updateSize();
- return Status.OK_STATUS;
- }
- }.schedule();
- }
- });
-
- return fDropDownViewer;
- }
-
- protected void openElement(ISelection selection) {
- if (fTreeViewer.getControl().isDisposed()) {
- return;
- }
-
- if (selection != null && (selection instanceof ITreeSelection) && !selection.isEmpty()) {
- // Create the path to the root element of the drop-down viewer. Need to calcualte
- // indexes and counts for the delta in order for the selection from the drop-down
- // viewer to work properly.
- TreeModelContentProvider contentProvider = (TreeModelContentProvider)fTreeViewer.getContentProvider();
- TreePath path = TreePath.EMPTY;
- int count = fTreeViewer.getChildCount(path);
- count = contentProvider.viewToModelCount(path, count);
- ModelDelta rootDelta =
- new ModelDelta(fTreeViewer.getInput(), -1, IModelDelta.NO_CHANGE, count);
- TreePath rootPath = fDropDownViewer.getRootPath();
- ModelDelta delta = rootDelta;
- for (int i = 0; i < rootPath.getSegmentCount(); i++) {
- Object element = rootPath.getSegment(i);
- int index = fTreeViewer.findElementIndex(path, element);
- index = contentProvider.viewToModelIndex(path, index);
- path = path.createChildPath(element);
- count = fTreeViewer.getChildCount(path);
- count = contentProvider.viewToModelCount(path, count);
- delta = delta.addNode(rootPath.getSegment(i), index, IModelDelta.NO_CHANGE, count);
- }
-
- // Create the delta and save the drop-down viewer's state to it.
- fDropDownViewer.saveElementState(TreePath.EMPTY, delta, IModelDelta.EXPAND | IModelDelta.SELECT);
-
- // Add the IModelDelta.FORCE flag to override the current selection in view.
- rootDelta.accept(new IModelDeltaVisitor(){
- public boolean visit(IModelDelta paramDelta, int depth) {
- if ((paramDelta.getFlags() & IModelDelta.SELECT) != 0) {
- ((ModelDelta)paramDelta).setFlags(paramDelta.getFlags() | IModelDelta.FORCE);
- }
- return true;
- }
- });
-
- // If elements in the drop-down were auto-expanded, then collapse the drop-down's sub tree in the
- // full viewer. After the drop-down's full expansion state is saved out to the tree viewer, the
- // tree viewer will accurately reflect the state changes made by the user.
- if (fView.getBreadcrumbDropDownAutoExpand()) {
- fTreeViewer.collapseToLevel(rootPath, TreeViewer.ALL_LEVELS);
- }
-
- // Save the state of the drop-down out into the tree viewer.
- fTreeViewer.updateViewer(rootDelta);
- fViewer.setSelection(StructuredSelection.EMPTY);
- site.close();
- }
-
- super.openElement(selection);
- }
- };
-
-
- return dropDownTreeViewer.createDropDown(parent, site, paramPath);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
deleted file mode 100644
index 424c88b06..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer;
-import org.eclipse.debug.internal.ui.viewers.model.VirtualCopyToClipboardActionDelegate;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * @since 3.5
- */
-public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipboardActionDelegate {
-
- protected TreeItem[] getPrunedSelection() {
- LaunchView view = (LaunchView)getView();
- if (view.isBreadcrumbVisible()) {
- ISelection selection = getSelection();
- if (selection instanceof ITreeSelection && getViewer() instanceof InternalTreeModelViewer) {
- if (selection.isEmpty()) {
- selection = new TreeSelection(TreePath.EMPTY);
- }
- return getSelectedItems((InternalTreeModelViewer)getViewer(), ((ITreeSelection)selection).getPaths()[0]);
- }
- return new TreeItem[0];
- } else {
- return super.getPrunedSelection();
- }
- }
-
- private TreeItem[] getSelectedItems(InternalTreeModelViewer viewer, TreePath path) {
- Widget item = viewer.findItem(path);
- if (item instanceof TreeItem) {
- return new TreeItem[] { (TreeItem)item };
- } else if (item instanceof Tree) {
- return ((Tree)item).getItems();
- }
- return new TreeItem[0];
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java
deleted file mode 100755
index a33ae0f8a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java
+++ /dev/null
@@ -1,39 +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 - Initial API and implementation
- * Pawel Piech - Wind River - adapted to use in Debug view
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.osgi.util.NLS;
-
-public class LaunchViewMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.views.launch.LaunchViewMessages";//$NON-NLS-1$
-
- public static String Breadcrumb_NoActiveContext;
- public static String LaunchView_ViewModeMenu_label;
- public static String DebugViewModeAction_Auto_label;
- public static String DebugViewModeAction_Auto_tooltip;
- public static String DebugViewModeAction_Auto_description;
- public static String DebugViewModeAction_Full_label;
- public static String DebugViewModeAction_Full_tooltip;
- public static String DebugViewModeAction_Full_description;
- public static String DebugViewModeAction_Compact_label;
- public static String DebugViewModeAction_Compact_tooltip;
- public static String DebugViewModeAction_Compact_description;
-
- public static String BreadcrumbDropDownAutoExpandAction_label;
- public static String BreadcrumbDropDownAutoExpandAction_tooltip;
- public static String BreadcrumbDropDownAutoExpandAction_description;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, LaunchViewMessages.class);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties
deleted file mode 100755
index 839f9b775..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties
+++ /dev/null
@@ -1,27 +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
-# Pawel Piech - Wind River - adapted to use in Debug view
-###############################################################################
-
-Breadcrumb_NoActiveContext=No Active Context
-LaunchView_ViewModeMenu_label=&Layout
-DebugViewModeAction_Auto_label=&Automatic
-DebugViewModeAction_Auto_tooltip=Automatic
-DebugViewModeAction_Auto_description=Switch layout automatically when the view is resized
-DebugViewModeAction_Full_label=&Tree
-DebugViewModeAction_Full_tooltip=Tree
-DebugViewModeAction_Full_description=Always show the tree viewer
-DebugViewModeAction_Compact_label=&Breadcrumb
-DebugViewModeAction_Compact_tooltip=Breadcrumb
-DebugViewModeAction_Compact_description=Always show the breadcrumb viewer
-
-BreadcrumbDropDownAutoExpandAction_label=Auto-&Expand Breadcrumb
-BreadcrumbDropDownAutoExpandAction_tooltip=Auto-Expand Breadcrumb
-BreadcrumbDropDownAutoExpandAction_description=In the breadcrumb drop-down, automatically expand elements to reveal full selection in view.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java
deleted file mode 100644
index b25295f2e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.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.internal.ui.views.launch;
-
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.JFaceColors;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IReusableEditor;
-import org.eclipse.ui.part.EditorPart;
-
-/**
- * Editor used when no source if found for a stack frame.
- *
- * @since 2.1
- */
-public class SourceNotFoundEditor extends EditorPart implements IReusableEditor {
-
- /**
- * Text widget used for this editor
- */
- private Text fText;
-
- /**
- * @see org.eclipse.ui.IEditorPart#doSave(IProgressMonitor)
- */
- public void doSave(IProgressMonitor monitor) {
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#doSaveAs()
- */
- public void doSaveAs() {
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#gotoMarker(IMarker)
- */
- public void gotoMarker(IMarker marker) {
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#init(IEditorSite, IEditorInput)
- */
- public void init(IEditorSite site, IEditorInput input) {
- setSite(site);
- setInput(input);
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#isDirty()
- */
- public boolean isDirty() {
- return false;
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#isSaveAsAllowed()
- */
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(Composite)
- */
- public void createPartControl(Composite parent) {
- fText = new Text(parent,SWT.MULTI|SWT.READ_ONLY|SWT.WRAP);
- fText.setForeground(JFaceColors.getErrorText(fText.getDisplay()));
- fText.setBackground(fText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- if (getEditorInput() != null) {
- setInput(getEditorInput());
- }
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- if (fText != null) {
- fText.setFocus();
- }
- }
-
- /**
- * @see IReusableEditor#setInput(org.eclipse.ui.IEditorInput)
- */
- public void setInput(IEditorInput input) {
- super.setInput(input);
- setPartName(input.getName());
- if (fText != null) {
- fText.setText(input.getToolTipText());
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java
deleted file mode 100644
index daa0f90ef..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java
+++ /dev/null
@@ -1,95 +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.internal.ui.views.launch;
-
-
-import com.ibm.icu.text.MessageFormat;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * Editor input for a stack frame for which source could not be located.
- *
- * @since 2.1
- */
-public class SourceNotFoundEditorInput extends PlatformObject implements IEditorInput {
-
- /**
- * Associated stack frame
- */
- private IStackFrame fFrame;
-
- /**
- * Stack frame text (cached on creation)
- */
- private String fFrameText;
-
- /**
- * Constructs an editor input for the given stack frame,
- * to indicate source could not be found.
- *
- * @param frame stack frame
- */
- public SourceNotFoundEditorInput(IStackFrame frame) {
- fFrame = frame;
- IDebugModelPresentation pres = DebugUITools.newDebugModelPresentation(frame.getModelIdentifier());
- fFrameText = pres.getText(frame);
- pres.dispose();
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return false;
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugUITools.getDefaultImageDescriptor(fFrame);
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- public String getName() {
- try {
- return fFrame.getName();
- } catch (DebugException e) {
- return DebugUIViewsMessages.SourceNotFoundEditorInput_Source_Not_Found_1;
- }
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return MessageFormat.format(DebugUIViewsMessages.SourceNotFoundEditorInput_Source_not_found_for__0__2,new String[] {fFrameText});
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java
deleted file mode 100644
index ea33cf20d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java
+++ /dev/null
@@ -1,46 +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.internal.ui.views.launch;
-
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.ui.IDebugEditorPresentation;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A reminder to remove any annotations created by an editor presentation
- */
-public class StandardDecoration extends Decoration {
-
- private IThread fThread;
- private IEditorPart fEditor;
- private IDebugEditorPresentation fPresentation;
-
- public StandardDecoration(IDebugEditorPresentation presentation, IEditorPart editorPart, IThread thread) {
- fThread = thread;
- fEditor = editorPart;
- fPresentation = presentation;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.launch.Decoration#remove()
- */
- public void remove() {
- fPresentation.removeAnnotations(fEditor, fThread);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.launch.Decoration#getThread()
- */
- public IThread getThread() {
- return fThread;
- }
-
-}

Back to the top