From 32c845cedc17596bbaf5ed0582aaf9b15fd6111d Mon Sep 17 00:00:00 2001 From: Paul Pazderski Date: Tue, 14 May 2019 18:59:31 +0200 Subject: Bug 547304 - [cleanup] Fix wrong line delimiters This updates all Java files with wrong or mixed line delimiters to use Unix style delimiters. The change includes only whitespace formatting and no code changes. Change-Id: I2b11370da258d1c5952a75647772e983e81db8d2 --- .../internal/ui/actions/RelaunchLastAction.java | 66 +-- .../provisional/IBreakpointContainer.java | 104 ++-- .../provisional/IBreakpointOrganizer.java | 126 ++--- .../provisional/OtherBreakpointCategory.java | 182 +++---- .../ui/commands/actions/IEnabledTarget.java | 36 +- .../BreakpointContainerMementoProvider.java | 96 ++-- .../model/elements/BreakpointContentProvider.java | 80 ++-- .../BreakpointManagerInputMementoProvider.java | 66 +-- .../model/elements/BreakpointMementoProvider.java | 174 +++---- .../ui/model/elements/ProcessContentProvider.java | 82 ++-- .../model/provisional/IColumnPresentation2.java | 70 +-- .../model/provisional/IModelProxyFactory2.java | 96 ++-- .../viewers/update/BreakpointContainerProxy.java | 110 ++--- .../ui/viewers/update/BreakpointProxy.java | 102 ++-- .../debug/ui/actions/RelaunchLastAction.java | 522 ++++++++++----------- 15 files changed, 956 insertions(+), 956 deletions(-) (limited to 'org.eclipse.debug.ui') diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java index 9715c9444..9c1ff6ef6 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java @@ -1,36 +1,36 @@ -/******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. +/******************************************************************************* + * Copyright (c) 2000, 2013 IBM Corporation and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - * Wind River Systems - bug 227877 - *******************************************************************************/ -package org.eclipse.debug.internal.ui.actions; - - -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.internal.ui.contextlaunching.ContextRunner; - -/** - * Re-launches the last launch. - * - * @see ContextRunner - * @see ILaunchConfiguration - * @see RunLastAction - * @see DebugLastAction - * @see ProfileLastAction - * @since 3.8 - * @deprecated This class has been promoted to API as org.eclipse.debug.ui.actions.RelaunchLastAction. Clients - * should discontinue use of this class and use the new API version. - */ -@Deprecated -public abstract class RelaunchLastAction extends org.eclipse.debug.ui.actions.RelaunchLastAction { - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + * Wind River Systems - bug 227877 + *******************************************************************************/ +package org.eclipse.debug.internal.ui.actions; + + +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.internal.ui.contextlaunching.ContextRunner; + +/** + * Re-launches the last launch. + * + * @see ContextRunner + * @see ILaunchConfiguration + * @see RunLastAction + * @see DebugLastAction + * @see ProfileLastAction + * @since 3.8 + * @deprecated This class has been promoted to API as org.eclipse.debug.ui.actions.RelaunchLastAction. Clients + * should discontinue use of this class and use the new API version. + */ +@Deprecated +public abstract class RelaunchLastAction extends org.eclipse.debug.ui.actions.RelaunchLastAction { + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointContainer.java index 2eb5476d6..997b219ff 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointContainer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointContainer.java @@ -1,55 +1,55 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 Wind River Systems and others. +/******************************************************************************* + * Copyright (c) 2008, 2009 Wind River Systems and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Wind River Systems - initial API and implementation - * Patrick Chuong (Texas Instruments) - Improve usability of the breakpoint view (Bug 238956) - *******************************************************************************/ -package org.eclipse.debug.internal.ui.breakpoints.provisional; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.model.IBreakpoint; - -/** - * Interface representing a breakpoint category container elements in - * Breakpoints view. Clients which provide custom content in the - * Breakpoints view may implement this interface to represent container - * elements. This will allow the breakpoints view to properly handle - * drag-and-drop and copy-paste operations. - * - * @since 3.6 - */ -public interface IBreakpointContainer { - - /** - * Returns the breakpoint organizer that this container uses. - */ - IBreakpointOrganizer getOrganizer(); - - /** - * Returns the breakpoint category that this container is based on. - * @return - */ - IAdaptable getCategory(); - - /** - * Returns whether this breakpoint container contains the given breakpoint. - * - * @param breakpoint Breakpoint to check - * @return Returns true if this container contains the - * given breakpoint. - */ - boolean contains(IBreakpoint breakpoint); - - /** - * Returns the array of breakpoints in this container. - */ - IBreakpoint[] getBreakpoints(); -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Wind River Systems - initial API and implementation + * Patrick Chuong (Texas Instruments) - Improve usability of the breakpoint view (Bug 238956) + *******************************************************************************/ +package org.eclipse.debug.internal.ui.breakpoints.provisional; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.debug.core.model.IBreakpoint; + +/** + * Interface representing a breakpoint category container elements in + * Breakpoints view. Clients which provide custom content in the + * Breakpoints view may implement this interface to represent container + * elements. This will allow the breakpoints view to properly handle + * drag-and-drop and copy-paste operations. + * + * @since 3.6 + */ +public interface IBreakpointContainer { + + /** + * Returns the breakpoint organizer that this container uses. + */ + IBreakpointOrganizer getOrganizer(); + + /** + * Returns the breakpoint category that this container is based on. + * @return + */ + IAdaptable getCategory(); + + /** + * Returns whether this breakpoint container contains the given breakpoint. + * + * @param breakpoint Breakpoint to check + * @return Returns true if this container contains the + * given breakpoint. + */ + boolean contains(IBreakpoint breakpoint); + + /** + * Returns the array of breakpoints in this container. + */ + IBreakpoint[] getBreakpoints(); +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointOrganizer.java index 0493734be..49cca1221 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointOrganizer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointOrganizer.java @@ -1,66 +1,66 @@ -/******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. +/******************************************************************************* + * Copyright (c) 2000, 2009 IBM Corporation and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.ui.breakpoints.provisional; - -import org.eclipse.debug.ui.IBreakpointOrganizerDelegate; -import org.eclipse.jface.resource.ImageDescriptor; - -/** - * A breakpoint organizer is represents a breakpoint organizer delegate in - * the breakpoint view. Clients can retrieve the current active breakpoint - * organizers from the breakpoint view's presentation context using the - * {@link IBreakpointUIConstants#PROP_BREAKPOINTS_ORGANIZERS} property. - *

- * This interface is not intended to be implemented. Clients contributing a breakpoint - * organizer are intended to implement IBreakpointOrganizerDelegate. - *

- * @noimplement This interface is not intended to be implemented by clients. - * @since 3.6 (internal interface since 3.1) - * - * @see IBreakpointUIConstants#PROP_BREAKPOINTS_ORGANIZERS - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext - */ -public interface IBreakpointOrganizer extends IBreakpointOrganizerDelegate { - - /** - * Returns a label for this breakpoint organizer. - * - * @return a label for this breakpoint organizer - */ - String getLabel(); - - /** - * Returns an image descriptor for this breakpoint organizer or null. - * - * @return an image descriptor for this breakpoint organizer or null - */ - ImageDescriptor getImageDescriptor(); - - /** - * Returns a unique identifier for this breakpoint organizer. - * - * @return a unique identifier for this breakpoint organizer - */ - String getIdentifier(); - - /** - * Returns the label for breakpoints that do not fall into a category - * for this organizer. - * - * @return label for breakpoints that do not fall into a category - * for this organizer - */ - String getOthersLabel(); - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.debug.internal.ui.breakpoints.provisional; + +import org.eclipse.debug.ui.IBreakpointOrganizerDelegate; +import org.eclipse.jface.resource.ImageDescriptor; + +/** + * A breakpoint organizer is represents a breakpoint organizer delegate in + * the breakpoint view. Clients can retrieve the current active breakpoint + * organizers from the breakpoint view's presentation context using the + * {@link IBreakpointUIConstants#PROP_BREAKPOINTS_ORGANIZERS} property. + *

+ * This interface is not intended to be implemented. Clients contributing a breakpoint + * organizer are intended to implement IBreakpointOrganizerDelegate. + *

+ * @noimplement This interface is not intended to be implemented by clients. + * @since 3.6 (internal interface since 3.1) + * + * @see IBreakpointUIConstants#PROP_BREAKPOINTS_ORGANIZERS + * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext + */ +public interface IBreakpointOrganizer extends IBreakpointOrganizerDelegate { + + /** + * Returns a label for this breakpoint organizer. + * + * @return a label for this breakpoint organizer + */ + String getLabel(); + + /** + * Returns an image descriptor for this breakpoint organizer or null. + * + * @return an image descriptor for this breakpoint organizer or null + */ + ImageDescriptor getImageDescriptor(); + + /** + * Returns a unique identifier for this breakpoint organizer. + * + * @return a unique identifier for this breakpoint organizer + */ + String getIdentifier(); + + /** + * Returns the label for breakpoints that do not fall into a category + * for this organizer. + * + * @return label for breakpoints that do not fall into a category + * for this organizer + */ + String getOthersLabel(); + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java index b1b8f6d0d..9705e1459 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java @@ -1,94 +1,94 @@ -/******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. +/******************************************************************************* + * Copyright (c) 2000, 2013 IBM Corporation and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.ui.breakpoints.provisional; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.debug.internal.ui.DebugPluginImages; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.model.IWorkbenchAdapter; - -/** - * Category for breakpoints in "other" categories. Clients which provide - * custom content in the Breakpoints view may instantiate this object to - * represent elements in a breakpoint organizer that do not fall into any known - * category. - * - * @since 3.6 - * - * @see IBreakpointContainer - * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate - */ -public class OtherBreakpointCategory extends PlatformObject implements IWorkbenchAdapter { - - private static Map fOthers = new HashMap<>(); - private IBreakpointOrganizer fOrganizer; - - - public static IAdaptable[] getCategories(IBreakpointOrganizer organizer) { - IAdaptable[] others = fOthers.get(organizer); - if (others == null) { - others = new IAdaptable[]{new OtherBreakpointCategory(organizer)}; - fOthers.put(organizer, others); - } - return others; - } - - /** - * Constructs an 'other' category for the given organizer. - * - * @param organizer breakpoint organizer - */ - private OtherBreakpointCategory(IBreakpointOrganizer organizer) { - fOrganizer = organizer; - } - - @Override - public Object[] getChildren(Object o) { - return null; - } - - @Override - public ImageDescriptor getImageDescriptor(Object object) { - return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_VIEW_BREAKPOINTS); - } - - @Override - public String getLabel(Object o) { - return fOrganizer.getOthersLabel(); - } - - @Override - public Object getParent(Object o) { - return null; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof OtherBreakpointCategory) { - OtherBreakpointCategory category = (OtherBreakpointCategory) obj; - return fOrganizer.equals(category.fOrganizer); - } - return false; - } - - @Override - public int hashCode() { - return fOrganizer.hashCode(); - } -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.debug.internal.ui.breakpoints.provisional; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.debug.internal.ui.DebugPluginImages; +import org.eclipse.debug.ui.IDebugUIConstants; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.model.IWorkbenchAdapter; + +/** + * Category for breakpoints in "other" categories. Clients which provide + * custom content in the Breakpoints view may instantiate this object to + * represent elements in a breakpoint organizer that do not fall into any known + * category. + * + * @since 3.6 + * + * @see IBreakpointContainer + * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate + */ +public class OtherBreakpointCategory extends PlatformObject implements IWorkbenchAdapter { + + private static Map fOthers = new HashMap<>(); + private IBreakpointOrganizer fOrganizer; + + + public static IAdaptable[] getCategories(IBreakpointOrganizer organizer) { + IAdaptable[] others = fOthers.get(organizer); + if (others == null) { + others = new IAdaptable[]{new OtherBreakpointCategory(organizer)}; + fOthers.put(organizer, others); + } + return others; + } + + /** + * Constructs an 'other' category for the given organizer. + * + * @param organizer breakpoint organizer + */ + private OtherBreakpointCategory(IBreakpointOrganizer organizer) { + fOrganizer = organizer; + } + + @Override + public Object[] getChildren(Object o) { + return null; + } + + @Override + public ImageDescriptor getImageDescriptor(Object object) { + return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_VIEW_BREAKPOINTS); + } + + @Override + public String getLabel(Object o) { + return fOrganizer.getOthersLabel(); + } + + @Override + public Object getParent(Object o) { + return null; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof OtherBreakpointCategory) { + OtherBreakpointCategory category = (OtherBreakpointCategory) obj; + return fOrganizer.equals(category.fOrganizer); + } + return false; + } + + @Override + public int hashCode() { + return fOrganizer.hashCode(); + } +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java index 615ee7803..adfc68e20 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java @@ -1,21 +1,21 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 Wind River Systems and others. +/******************************************************************************* + * Copyright (c) 2008, 2009 Wind River Systems and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.ui.commands.actions; - -/** - * - */ -public interface IEnabledTarget { - void setEnabled(boolean enabled); -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.debug.internal.ui.commands.actions; + +/** + * + */ +public interface IEnabledTarget { + void setEnabled(boolean enabled); +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java index 9aad3e078..e51601ef4 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java @@ -1,51 +1,51 @@ -/***************************************************************** - * Copyright (c) 2009 Texas Instruments and others +/***************************************************************** + * Copyright (c) 2009 Texas Instruments and others * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) - *****************************************************************/ -package org.eclipse.debug.internal.ui.model.elements; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointContainer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.ui.model.IWorkbenchAdapter; - -/** - * This class provides memento for the breakpoint container. - * - * @since 3.6 - */ -public class BreakpointContainerMementoProvider extends DebugElementMementoProvider { - - @Override - protected String getElementName(Object element, IPresentationContext context) throws CoreException { - if (element instanceof IBreakpointContainer) { - IBreakpointContainer container = (IBreakpointContainer) element; - IAdaptable category = container.getCategory(); - if (category != null) { - IWorkbenchAdapter adapter = category.getAdapter(IWorkbenchAdapter.class); - if (adapter != null) { - return adapter.getLabel(category); - } - return container.getOrganizer().getLabel(); - } - } - return null; - } - - @Override - protected boolean supportsContextId(String id) { - return IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id); - } - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) + *****************************************************************/ +package org.eclipse.debug.internal.ui.model.elements; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointContainer; +import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; +import org.eclipse.debug.ui.IDebugUIConstants; +import org.eclipse.ui.model.IWorkbenchAdapter; + +/** + * This class provides memento for the breakpoint container. + * + * @since 3.6 + */ +public class BreakpointContainerMementoProvider extends DebugElementMementoProvider { + + @Override + protected String getElementName(Object element, IPresentationContext context) throws CoreException { + if (element instanceof IBreakpointContainer) { + IBreakpointContainer container = (IBreakpointContainer) element; + IAdaptable category = container.getCategory(); + if (category != null) { + IWorkbenchAdapter adapter = category.getAdapter(IWorkbenchAdapter.class); + if (adapter != null) { + return adapter.getLabel(category); + } + return container.getOrganizer().getLabel(); + } + } + return null; + } + + @Override + protected boolean supportsContextId(String id) { + return IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id); + } + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContentProvider.java index 43bde9239..8c0a81e79 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContentProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContentProvider.java @@ -1,43 +1,43 @@ -/***************************************************************** - * Copyright (c) 2009 Texas Instruments and others +/***************************************************************** + * Copyright (c) 2009 Texas Instruments and others * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) - *****************************************************************/ -package org.eclipse.debug.internal.ui.model.elements; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; -import org.eclipse.debug.ui.IDebugUIConstants; - -/** - * Breakpoint content provider. - * - * @since 3.6 - */ -public class BreakpointContentProvider extends ElementContentProvider { - - @Override - protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { - return 0; - } - - @Override - protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { - return null; - } - - @Override - protected boolean supportsContextId(String id) { - return id.equals(IDebugUIConstants.ID_BREAKPOINT_VIEW); - } - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) + *****************************************************************/ +package org.eclipse.debug.internal.ui.model.elements; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; +import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; +import org.eclipse.debug.ui.IDebugUIConstants; + +/** + * Breakpoint content provider. + * + * @since 3.6 + */ +public class BreakpointContentProvider extends ElementContentProvider { + + @Override + protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { + return 0; + } + + @Override + protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { + return null; + } + + @Override + protected boolean supportsContextId(String id) { + return id.equals(IDebugUIConstants.ID_BREAKPOINT_VIEW); + } + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerInputMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerInputMementoProvider.java index e51cf3390..64f05d0b9 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerInputMementoProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerInputMementoProvider.java @@ -1,36 +1,36 @@ -/***************************************************************** - * Copyright (c) 2009 Texas Instruments and others +/***************************************************************** + * Copyright (c) 2009 Texas Instruments and others * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) - *****************************************************************/ -package org.eclipse.debug.internal.ui.model.elements; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.ui.IDebugUIConstants; - -/** - * Breakpoint manager input memento provider. - * - * @since 3.6 - */ -public class BreakpointManagerInputMementoProvider extends DebugElementMementoProvider { - - @Override - protected String getElementName(Object element, IPresentationContext context) throws CoreException { - return "BreakpointInputMemento"; //$NON-NLS-1$ - } - - @Override - protected boolean supportsContextId(String id) { - return IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id); - } -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) + *****************************************************************/ +package org.eclipse.debug.internal.ui.model.elements; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; +import org.eclipse.debug.ui.IDebugUIConstants; + +/** + * Breakpoint manager input memento provider. + * + * @since 3.6 + */ +public class BreakpointManagerInputMementoProvider extends DebugElementMementoProvider { + + @Override + protected String getElementName(Object element, IPresentationContext context) throws CoreException { + return "BreakpointInputMemento"; //$NON-NLS-1$ + } + + @Override + protected boolean supportsContextId(String id) { + return IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id); + } +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java index 33cf6ce57..98b6ca432 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java @@ -1,90 +1,90 @@ -/******************************************************************************* - * Copyright (c) 2009 Freescale Semiconductor and others. +/******************************************************************************* + * Copyright (c) 2009 Freescale Semiconductor and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * 2009 Freescale - initial API and implementation (Bug 238956) - *******************************************************************************/ -package org.eclipse.debug.internal.ui.model.elements; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.ui.IMemento; - -/** - * Memento provider for breakpoints - * - * @since 3.6 - */ -public class BreakpointMementoProvider extends ElementMementoProvider { - - /** - * Marker ID. Stored as string in order to support the full range of the long type. - */ - private static final String MARKER_ID = "MARKER_ID"; //$NON-NLS-1$ - - /** - * Full path from the workspace to the resource referred to by the breakpoint marker. - * - * Stored as String. - */ - private static final String RESOURCE_PATH = "RESOURCE_PATH"; //$NON-NLS-1$ - - protected boolean supportsContextId(String id) { - return IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id); - } - - @Override - protected boolean encodeElement(Object element, IMemento memento, IPresentationContext context) throws CoreException { - if (element instanceof IBreakpoint) { - - IMarker marker = ((IBreakpoint)element).getMarker(); - if (marker != null) { - - long markerId = marker.getId(); - memento.putString(MARKER_ID, Long.toString(markerId)); - - IPath fullPath = marker.getResource().getFullPath(); - String path = fullPath.toString(); - memento.putString(RESOURCE_PATH, path); - return true; - } - } - - return false; - } - - @Override - protected boolean isEqual(Object element, IMemento memento, IPresentationContext context) throws CoreException { - if (element instanceof IBreakpoint) { - IBreakpoint breakpoint =(IBreakpoint)element; - IMarker marker = breakpoint.getMarker(); - - long markerId = marker.getId(); - String mementoMarkerId = memento.getString(MARKER_ID); - if (!Long.toString(markerId).equals(mementoMarkerId)) { - return false; - } - - IPath fullPath = marker.getResource().getFullPath(); - String path = fullPath.toString(); - String mementoPath = memento.getString(RESOURCE_PATH); - if (!path.equals(mementoPath)) { - return false; - } - return true; - } - return false; - } - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * 2009 Freescale - initial API and implementation (Bug 238956) + *******************************************************************************/ +package org.eclipse.debug.internal.ui.model.elements; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.debug.core.model.IBreakpoint; +import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; +import org.eclipse.debug.ui.IDebugUIConstants; +import org.eclipse.ui.IMemento; + +/** + * Memento provider for breakpoints + * + * @since 3.6 + */ +public class BreakpointMementoProvider extends ElementMementoProvider { + + /** + * Marker ID. Stored as string in order to support the full range of the long type. + */ + private static final String MARKER_ID = "MARKER_ID"; //$NON-NLS-1$ + + /** + * Full path from the workspace to the resource referred to by the breakpoint marker. + * + * Stored as String. + */ + private static final String RESOURCE_PATH = "RESOURCE_PATH"; //$NON-NLS-1$ + + protected boolean supportsContextId(String id) { + return IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id); + } + + @Override + protected boolean encodeElement(Object element, IMemento memento, IPresentationContext context) throws CoreException { + if (element instanceof IBreakpoint) { + + IMarker marker = ((IBreakpoint)element).getMarker(); + if (marker != null) { + + long markerId = marker.getId(); + memento.putString(MARKER_ID, Long.toString(markerId)); + + IPath fullPath = marker.getResource().getFullPath(); + String path = fullPath.toString(); + memento.putString(RESOURCE_PATH, path); + return true; + } + } + + return false; + } + + @Override + protected boolean isEqual(Object element, IMemento memento, IPresentationContext context) throws CoreException { + if (element instanceof IBreakpoint) { + IBreakpoint breakpoint =(IBreakpoint)element; + IMarker marker = breakpoint.getMarker(); + + long markerId = marker.getId(); + String mementoMarkerId = memento.getString(MARKER_ID); + if (!Long.toString(markerId).equals(mementoMarkerId)) { + return false; + } + + IPath fullPath = marker.getResource().getFullPath(); + String path = fullPath.toString(); + String mementoPath = memento.getString(RESOURCE_PATH); + if (!path.equals(mementoPath)) { + return false; + } + return true; + } + return false; + } + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ProcessContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ProcessContentProvider.java index 84ab157b6..59736ee11 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ProcessContentProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ProcessContentProvider.java @@ -1,44 +1,44 @@ -/******************************************************************************* - * Copyright (c) 2010 Wind River Systems and others. +/******************************************************************************* + * Copyright (c) 2010 Wind River Systems and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.ui.model.elements; - -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; -import org.eclipse.debug.ui.IDebugUIConstants; - -/** - * Default content provider for process objects. Even though process objects - * have no children by default, they still need a content provider to ensure - * proper display (see bug - * - * @since 3.6 - */ -public class ProcessContentProvider extends ElementContentProvider { - - @Override - protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) { - return EMPTY; - } - - @Override - protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) { - return 0; - } - - @Override - protected boolean supportsContextId(String id) { - return IDebugUIConstants.ID_DEBUG_VIEW.equals(id); - } - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.debug.internal.ui.model.elements; + +import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; +import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; +import org.eclipse.debug.ui.IDebugUIConstants; + +/** + * Default content provider for process objects. Even though process objects + * have no children by default, they still need a content provider to ensure + * proper display (see bug + * + * @since 3.6 + */ +public class ProcessContentProvider extends ElementContentProvider { + + @Override + protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) { + return EMPTY; + } + + @Override + protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) { + return 0; + } + + @Override + protected boolean supportsContextId(String id) { + return IDebugUIConstants.ID_DEBUG_VIEW.equals(id); + } + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation2.java index c74108a6a..fd045d05f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation2.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation2.java @@ -1,38 +1,38 @@ -/******************************************************************************* - * Copyright (c) 2011 Texas Instruments and others. +/******************************************************************************* + * Copyright (c) 2011 Texas Instruments and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Texas Instruments - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.ui.viewers.model.provisional; - -/** - * Extension to allow column presentation to specify initial column sizes in a - * TreeModelViewer. - * - * @since 3.7 - * - * @see TreeModelViewer - */ -public interface IColumnPresentation2 extends IColumnPresentation { - - /** - * Returns the initial column width for the column with the given identifier. - * - * @param id a column identifier included in getAvailableColumns() - * @param treeWidgetWidth tree widget width - * @param visibleColumnIds identifiers of visible columns - * @return initial column width. Return -1 if this implementation does not decide the width - * and let the caller to decide the width. The caller may make the initial width - * be treeWidgetWidth / visibleColumnIds.length - */ - int getInitialColumnWidth(String id, int treeWidgetWidth, String[] visibleColumnIds); - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Texas Instruments - initial API and implementation + *******************************************************************************/ +package org.eclipse.debug.internal.ui.viewers.model.provisional; + +/** + * Extension to allow column presentation to specify initial column sizes in a + * TreeModelViewer. + * + * @since 3.7 + * + * @see TreeModelViewer + */ +public interface IColumnPresentation2 extends IColumnPresentation { + + /** + * Returns the initial column width for the column with the given identifier. + * + * @param id a column identifier included in getAvailableColumns() + * @param treeWidgetWidth tree widget width + * @param visibleColumnIds identifiers of visible columns + * @return initial column width. Return -1 if this implementation does not decide the width + * and let the caller to decide the width. The caller may make the initial width + * be treeWidgetWidth / visibleColumnIds.length + */ + int getInitialColumnWidth(String id, int treeWidgetWidth, String[] visibleColumnIds); + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java index 76d53b5e0..db0609bbc 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java @@ -1,51 +1,51 @@ -/******************************************************************************* - * Copyright (c) 2009 Freescale Semiconductor and others. +/******************************************************************************* + * Copyright (c) 2009 Freescale Semiconductor and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Freescale Semiconductor - initial API and implementation � Bug 241336 - *******************************************************************************/ -package org.eclipse.debug.internal.ui.viewers.model.provisional; - -import org.eclipse.jface.viewers.TreePath; - -/** - * A model proxy factory creates model proxies for elements based on - * specific presentation contexts. A model proxy factory is provided for - * a model element by registering a model proxy factory adapter for - * an element. - *

- * This interface is an alternative to the {@link IModelProxyFactory} - * interface. Unlike its predecessor IModelProxyFactory2 allows - * the full path to the tree element to be specified when creating an - * IModelProxy instance. Using the full patch allows models to - * provide proper model deltas even if the root element of this proxy is at - * variable or unknown location in the viewer. - *

- *

- * Clients may implement this interface. - *

- * @see IModelProxyFactory - * @see IModelProxy - * @see IModelDelta - * - * @since 3.6 - */ -public interface IModelProxyFactory2 { - /** - * Creates and returns a model proxy for the given element in the specified - * context or null if none. - * - * @param input viewer input context - * @param path to model element to create a model proxy for - * @param context presentation context - * @return model proxy or null - */ - IModelProxy createTreeModelProxy(Object input, TreePath path, IPresentationContext context); -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Freescale Semiconductor - initial API and implementation � Bug 241336 + *******************************************************************************/ +package org.eclipse.debug.internal.ui.viewers.model.provisional; + +import org.eclipse.jface.viewers.TreePath; + +/** + * A model proxy factory creates model proxies for elements based on + * specific presentation contexts. A model proxy factory is provided for + * a model element by registering a model proxy factory adapter for + * an element. + *

+ * This interface is an alternative to the {@link IModelProxyFactory} + * interface. Unlike its predecessor IModelProxyFactory2 allows + * the full path to the tree element to be specified when creating an + * IModelProxy instance. Using the full patch allows models to + * provide proper model deltas even if the root element of this proxy is at + * variable or unknown location in the viewer. + *

+ *

+ * Clients may implement this interface. + *

+ * @see IModelProxyFactory + * @see IModelProxy + * @see IModelDelta + * + * @since 3.6 + */ +public interface IModelProxyFactory2 { + /** + * Creates and returns a model proxy for the given element in the specified + * context or null if none. + * + * @param input viewer input context + * @param path to model element to create a model proxy for + * @param context presentation context + * @return model proxy or null + */ + IModelProxy createTreeModelProxy(Object input, TreePath path, IPresentationContext context); +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointContainerProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointContainerProxy.java index 6bb79967a..ec9e20a17 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointContainerProxy.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointContainerProxy.java @@ -1,58 +1,58 @@ -/***************************************************************** - * Copyright (c) 2009 Texas Instruments and others +/***************************************************************** + * Copyright (c) 2009 Texas Instruments and others * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) - *****************************************************************/ -package org.eclipse.debug.internal.ui.viewers.update; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointContainer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckboxModelProxy; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; -import org.eclipse.jface.viewers.TreePath; - -/** - * Breakpoint container model proxy. - * - * @since 3.6 - */ -public class BreakpointContainerProxy extends AbstractModelProxy implements ICheckboxModelProxy { - - /** - * The breakpoint container - */ - private IBreakpointContainer fContainer; - - /** - * Constructor. - * - * @param container the breakpoint container. - */ - public BreakpointContainerProxy(IBreakpointContainer container) { - fContainer = container; - } - - @Override - public boolean setChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) { - boolean atLeastOne = false; - IBreakpoint[] breakpoints = fContainer.getBreakpoints(); - for (int i = 0; i < breakpoints.length; ++i) { - try { - breakpoints[i].setEnabled(checked); - atLeastOne = true; - } catch (CoreException e) {} - } - return atLeastOne; - } - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) + *****************************************************************/ +package org.eclipse.debug.internal.ui.viewers.update; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.model.IBreakpoint; +import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointContainer; +import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckboxModelProxy; +import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; +import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; +import org.eclipse.jface.viewers.TreePath; + +/** + * Breakpoint container model proxy. + * + * @since 3.6 + */ +public class BreakpointContainerProxy extends AbstractModelProxy implements ICheckboxModelProxy { + + /** + * The breakpoint container + */ + private IBreakpointContainer fContainer; + + /** + * Constructor. + * + * @param container the breakpoint container. + */ + public BreakpointContainerProxy(IBreakpointContainer container) { + fContainer = container; + } + + @Override + public boolean setChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) { + boolean atLeastOne = false; + IBreakpoint[] breakpoints = fContainer.getBreakpoints(); + for (int i = 0; i < breakpoints.length; ++i) { + try { + breakpoints[i].setEnabled(checked); + atLeastOne = true; + } catch (CoreException e) {} + } + return atLeastOne; + } + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointProxy.java index e62501e68..afa8a0d37 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointProxy.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointProxy.java @@ -1,54 +1,54 @@ -/***************************************************************** - * Copyright (c) 2009 Texas Instruments and others +/***************************************************************** + * Copyright (c) 2009 Texas Instruments and others * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) - *****************************************************************/ -package org.eclipse.debug.internal.ui.viewers.update; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckboxModelProxy; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; -import org.eclipse.jface.viewers.TreePath; - -/** - * Breakpoint model proxy. - * - * @since 3.6 - */ -public class BreakpointProxy extends AbstractModelProxy implements ICheckboxModelProxy { - - /** - * Breakpoint object - */ - protected IBreakpoint fBreakpoint; - - /** - * Constructor. - * - * @param breakpoint the breakpoint for this model proxy - */ - public BreakpointProxy(IBreakpoint breakpoint) { - fBreakpoint = breakpoint; - } - - @Override - public boolean setChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) { - try { - fBreakpoint.setEnabled(checked); - return fBreakpoint.isEnabled() == checked; - } catch (CoreException e) { - return false; - } - } - -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956) + *****************************************************************/ +package org.eclipse.debug.internal.ui.viewers.update; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.model.IBreakpoint; +import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckboxModelProxy; +import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; +import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; +import org.eclipse.jface.viewers.TreePath; + +/** + * Breakpoint model proxy. + * + * @since 3.6 + */ +public class BreakpointProxy extends AbstractModelProxy implements ICheckboxModelProxy { + + /** + * Breakpoint object + */ + protected IBreakpoint fBreakpoint; + + /** + * Constructor. + * + * @param breakpoint the breakpoint for this model proxy + */ + public BreakpointProxy(IBreakpoint breakpoint) { + fBreakpoint = breakpoint; + } + + @Override + public boolean setChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) { + try { + fBreakpoint.setEnabled(checked); + return fBreakpoint.isEnabled() == checked; + } catch (CoreException e) { + return false; + } + } + +} diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java index 2539c5ff0..14ec2c03e 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java @@ -1,264 +1,264 @@ -/******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. +/******************************************************************************* + * Copyright (c) 2000, 2016 IBM Corporation and others. * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - * Wind River Systems - bug 227877 - *******************************************************************************/ -package org.eclipse.debug.ui.actions; - - -import org.eclipse.core.commands.Command; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; -import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.internal.ui.DebugUIPlugin; -import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; -import org.eclipse.debug.internal.ui.actions.ActionMessages; -import org.eclipse.debug.internal.ui.actions.DebugLastAction; -import org.eclipse.debug.internal.ui.actions.ProfileLastAction; -import org.eclipse.debug.internal.ui.actions.RunLastAction; -import org.eclipse.debug.internal.ui.contextlaunching.ContextRunner; -import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.ILaunchGroup; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IActionDelegate2; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.commands.ICommandService; - -import com.ibm.icu.text.MessageFormat; - -/** - * Re-launches the last launch. - * - * @see ContextRunner - * @see ILaunchConfiguration - * @see RunLastAction - * @see DebugLastAction - * @see ProfileLastAction - * @since 3.8 - */ -public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelegate, IActionDelegate2 { - - private class Listener implements IPreferenceChangeListener { - @Override - public void preferenceChange(PreferenceChangeEvent event) { - if(event.getKey().equals(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH)) { - initialize(fAction); - } - } - } - - private Listener fListener = new Listener(); - private IWorkbenchWindow fWorkbenchWindow; - private IAction fAction; - - @Override - public void dispose(){ - IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier()); - if(prefs != null) { - prefs.removePreferenceChangeListener(fListener); - } - } - - @Override - public void init(IWorkbenchWindow window){ - fWorkbenchWindow = window; - IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier()); - if(prefs != null) { - prefs.addPreferenceChangeListener(fListener); - } - } - - /** - * @since 3.12 - */ - @Override - public void init(IAction action) { - initialize(action); - IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier()); - if (prefs != null) { - prefs.addPreferenceChangeListener(fListener); - } - } - - @Override - public void run(IAction action) { - runInternal(false); - } - - /** - * @since 3.12 - */ - @Override - public void runWithEvent(IAction action, Event event) { - runInternal(((event.stateMask & SWT.SHIFT) > 0) ? true : false); - } - - private void runInternal(boolean isShift) { - if(LaunchingResourceManager.isContextLaunchEnabled()) { - ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(getLaunchGroupId()); - ContextRunner.getDefault().launch(group, isShift); - return; - } - try { - final ILaunchConfiguration configuration = getLastLaunch(); - if (configuration != null) { - if (configuration.supportsMode(getMode())) { - DebugUITools.launch(configuration, getMode(), isShift); - } else { - String configName = configuration.getName(); - String title = ActionMessages.RelaunchLastAction_Cannot_relaunch_1; - String message = MessageFormat.format(ActionMessages.RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2, new Object[] { - configName, getMode() }); - MessageDialog.openError(getShell(), title, message); - } - } else { - // If the history is empty, just open the launch config dialog - openLaunchConfigurationDialog(); - } - } catch (CoreException ce) { - DebugUIPlugin.errorDialog(getShell(), ActionMessages.RelaunchLastAction_Error_relaunching_3, ActionMessages.RelaunchLastAction_Error_encountered_attempting_to_relaunch_4, ce); // - } - } - - /** - * Open the launch configuration dialog, passing in the current workbench selection. - */ - private void openLaunchConfigurationDialog() { - IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow(); - if (dwindow == null) { - return; - } - LaunchConfigurationsDialog dialog = new LaunchConfigurationsDialog(DebugUIPlugin.getShell(), DebugUIPlugin.getDefault().getLaunchConfigurationManager().getDefaultLaunchGroup(getMode())); - dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED); - dialog.open(); - } - - @Override - public void selectionChanged(IAction action, ISelection selection){ - if (fAction == null) { - initialize(action); - } - } - - /** - * Set the enabled state of the underlying action based on whether there are any - * registered launch configuration types that understand how to launch in the - * mode of this action. - * @param action the {@link IAction} to initialize - */ - private void initialize(IAction action) { - fAction = action; - if(fAction != null) { - fAction.setEnabled(existsConfigTypesForMode()); - fAction.setText(getText()); - fAction.setToolTipText(getTooltipText()); - String commandId = getCommandId(); - ICommandService service = PlatformUI.getWorkbench().getService(ICommandService.class); - if (service != null) { - Command command = service.getCommand(commandId); - command.undefine(); - command = service.getCommand(commandId); - command.define(DebugUIPlugin.removeAccelerators(getText()), getDescription(), service.getCategory("org.eclipse.debug.ui.category.run")); //$NON-NLS-1$ - } - } - } - - /** - * Return whether there are any registered launch configuration types for - * the mode of this action. - * - * @return whether there are any registered launch configuration types for - * the mode of this action - */ - private boolean existsConfigTypesForMode() { - ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes(); - for (int i = 0; i < configTypes.length; i++) { - ILaunchConfigurationType configType = configTypes[i]; - if (configType.supportsMode(getMode())) { - return true; - } - } - return false; - } - - /** - * Return the last launch that occurred in the workspace. - * @return the filtered last launch - */ - protected ILaunchConfiguration getLastLaunch() { - return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getFilteredLastLaunch(getLaunchGroupId()); - } - - /** - * Returns the parent shell for this menu item - * - * @return the parent shell - */ - protected Shell getShell() { - return fWorkbenchWindow.getShell(); - } - - /** - * Returns the mode (run or debug) of this action. - * @return the mode - */ - protected abstract String getMode(); - - /** - * Returns the launch group id of this action. - * - * @return the launch group id - */ - protected abstract String getLaunchGroupId(); - - /** - * Returns the text to display on the menu item. - * - * @return the text for the menu item - */ - protected abstract String getText(); - - /** - * Returns the text to display in the menu item tooltip - * - * @return the text for the tooltip - */ - protected abstract String getTooltipText(); - - /** - * Returns the command id this action is associated with. - * - * @return command id - */ - protected abstract String getCommandId(); - - /** - * Returns a description for this action (to associate with command). - * - * @return command description - */ - protected abstract String getDescription(); -} + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + * Wind River Systems - bug 227877 + *******************************************************************************/ +package org.eclipse.debug.ui.actions; + + +import org.eclipse.core.commands.Command; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; +import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; +import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.internal.ui.DebugUIPlugin; +import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; +import org.eclipse.debug.internal.ui.actions.ActionMessages; +import org.eclipse.debug.internal.ui.actions.DebugLastAction; +import org.eclipse.debug.internal.ui.actions.ProfileLastAction; +import org.eclipse.debug.internal.ui.actions.RunLastAction; +import org.eclipse.debug.internal.ui.contextlaunching.ContextRunner; +import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.debug.ui.ILaunchGroup; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IActionDelegate2; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; + +import com.ibm.icu.text.MessageFormat; + +/** + * Re-launches the last launch. + * + * @see ContextRunner + * @see ILaunchConfiguration + * @see RunLastAction + * @see DebugLastAction + * @see ProfileLastAction + * @since 3.8 + */ +public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelegate, IActionDelegate2 { + + private class Listener implements IPreferenceChangeListener { + @Override + public void preferenceChange(PreferenceChangeEvent event) { + if(event.getKey().equals(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH)) { + initialize(fAction); + } + } + } + + private Listener fListener = new Listener(); + private IWorkbenchWindow fWorkbenchWindow; + private IAction fAction; + + @Override + public void dispose(){ + IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier()); + if(prefs != null) { + prefs.removePreferenceChangeListener(fListener); + } + } + + @Override + public void init(IWorkbenchWindow window){ + fWorkbenchWindow = window; + IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier()); + if(prefs != null) { + prefs.addPreferenceChangeListener(fListener); + } + } + + /** + * @since 3.12 + */ + @Override + public void init(IAction action) { + initialize(action); + IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier()); + if (prefs != null) { + prefs.addPreferenceChangeListener(fListener); + } + } + + @Override + public void run(IAction action) { + runInternal(false); + } + + /** + * @since 3.12 + */ + @Override + public void runWithEvent(IAction action, Event event) { + runInternal(((event.stateMask & SWT.SHIFT) > 0) ? true : false); + } + + private void runInternal(boolean isShift) { + if(LaunchingResourceManager.isContextLaunchEnabled()) { + ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(getLaunchGroupId()); + ContextRunner.getDefault().launch(group, isShift); + return; + } + try { + final ILaunchConfiguration configuration = getLastLaunch(); + if (configuration != null) { + if (configuration.supportsMode(getMode())) { + DebugUITools.launch(configuration, getMode(), isShift); + } else { + String configName = configuration.getName(); + String title = ActionMessages.RelaunchLastAction_Cannot_relaunch_1; + String message = MessageFormat.format(ActionMessages.RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2, new Object[] { + configName, getMode() }); + MessageDialog.openError(getShell(), title, message); + } + } else { + // If the history is empty, just open the launch config dialog + openLaunchConfigurationDialog(); + } + } catch (CoreException ce) { + DebugUIPlugin.errorDialog(getShell(), ActionMessages.RelaunchLastAction_Error_relaunching_3, ActionMessages.RelaunchLastAction_Error_encountered_attempting_to_relaunch_4, ce); // + } + } + + /** + * Open the launch configuration dialog, passing in the current workbench selection. + */ + private void openLaunchConfigurationDialog() { + IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow(); + if (dwindow == null) { + return; + } + LaunchConfigurationsDialog dialog = new LaunchConfigurationsDialog(DebugUIPlugin.getShell(), DebugUIPlugin.getDefault().getLaunchConfigurationManager().getDefaultLaunchGroup(getMode())); + dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED); + dialog.open(); + } + + @Override + public void selectionChanged(IAction action, ISelection selection){ + if (fAction == null) { + initialize(action); + } + } + + /** + * Set the enabled state of the underlying action based on whether there are any + * registered launch configuration types that understand how to launch in the + * mode of this action. + * @param action the {@link IAction} to initialize + */ + private void initialize(IAction action) { + fAction = action; + if(fAction != null) { + fAction.setEnabled(existsConfigTypesForMode()); + fAction.setText(getText()); + fAction.setToolTipText(getTooltipText()); + String commandId = getCommandId(); + ICommandService service = PlatformUI.getWorkbench().getService(ICommandService.class); + if (service != null) { + Command command = service.getCommand(commandId); + command.undefine(); + command = service.getCommand(commandId); + command.define(DebugUIPlugin.removeAccelerators(getText()), getDescription(), service.getCategory("org.eclipse.debug.ui.category.run")); //$NON-NLS-1$ + } + } + } + + /** + * Return whether there are any registered launch configuration types for + * the mode of this action. + * + * @return whether there are any registered launch configuration types for + * the mode of this action + */ + private boolean existsConfigTypesForMode() { + ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes(); + for (int i = 0; i < configTypes.length; i++) { + ILaunchConfigurationType configType = configTypes[i]; + if (configType.supportsMode(getMode())) { + return true; + } + } + return false; + } + + /** + * Return the last launch that occurred in the workspace. + * @return the filtered last launch + */ + protected ILaunchConfiguration getLastLaunch() { + return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getFilteredLastLaunch(getLaunchGroupId()); + } + + /** + * Returns the parent shell for this menu item + * + * @return the parent shell + */ + protected Shell getShell() { + return fWorkbenchWindow.getShell(); + } + + /** + * Returns the mode (run or debug) of this action. + * @return the mode + */ + protected abstract String getMode(); + + /** + * Returns the launch group id of this action. + * + * @return the launch group id + */ + protected abstract String getLaunchGroupId(); + + /** + * Returns the text to display on the menu item. + * + * @return the text for the menu item + */ + protected abstract String getText(); + + /** + * Returns the text to display in the menu item tooltip + * + * @return the text for the tooltip + */ + protected abstract String getTooltipText(); + + /** + * Returns the command id this action is associated with. + * + * @return command id + */ + protected abstract String getCommandId(); + + /** + * Returns a description for this action (to associate with command). + * + * @return command description + */ + protected abstract String getDescription(); +} -- cgit v1.2.3