From 6b690a51433a052d1a94664fe75b2032a4fafd85 Mon Sep 17 00:00:00 2001 From: Sarika Sinha Date: Wed, 14 Sep 2016 12:16:30 +0530 Subject: Bug 501333 - Trigger Points -- remove "Active Trigger" state Change-Id: I533652d802fac7de2db1ea8a98893cc02fbeca4e --- .../org/eclipse/debug/core/IBreakpointManager.java | 6 ++-- .../org/eclipse/debug/core/model/Breakpoint.java | 41 ++-------------------- .../org/eclipse/debug/core/model/IBreakpoint.java | 27 -------------- .../debug/internal/core/BreakpointManager.java | 24 +++++-------- 4 files changed, 15 insertions(+), 83 deletions(-) (limited to 'org.eclipse.debug.core/core/org/eclipse') diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java index e232732e7..d4ea08698 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java @@ -334,11 +334,12 @@ public interface IBreakpointManager { /** * Revisit all the trigger points to activate/deactivate trigger points. * - * @param triggerointList list of trigger points to be deactivated or + * @param triggerpoints list of trigger points to be deactivated or * null to deactivate all trigger points + * @param enable enable if true or disable if false * @since 3.11 */ - public default void deActivateTriggerpoints(IBreakpoint[] triggerointList) { + public default void enableTriggerpoints(IBreakpoint[] triggerpoints, boolean enable) { } /** @@ -347,7 +348,6 @@ public interface IBreakpointManager { * @since 3.11 */ public default void refreshTriggerpointDisplay() { - } } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java index aee0df9e5..0d2322066 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java @@ -54,17 +54,6 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint { */ private static final String TRIGGEREPOINT = "org.eclipse.debug.core.triggerpoint"; //$NON-NLS-1$ - /** - * Persisted breakpoint marker attribute (value - * "org.eclipse.debug.core.triggerpointactive"). The attribute - * is a boolean corresponding to whether the trigger breakpoint - * is active or not. - * - * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean) - * @since 3.11 - */ - private static final String TRIGGEREPOINTACTIVE = "org.eclipse.debug.core.triggerpointactive"; //$NON-NLS-1$ - /** * Creates a breakpoint. * @@ -115,6 +104,9 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint { public void setEnabled(boolean enabled) throws CoreException { if (enabled != isEnabled()) { setAttribute(ENABLED, enabled); + if (isTriggerPoint()) { + DebugPlugin.getDefault().getBreakpointManager().refreshTriggerpointDisplay(); + } } } @@ -213,26 +205,6 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint { } - /** - * @see IBreakpoint#isTriggerPointActive() - * @since 3.11 - */ - @Override - public boolean isTriggerPointActive() throws CoreException { - return getMarker().getAttribute(TRIGGEREPOINTACTIVE, false); - } - - /** - * @see IBreakpoint#setTriggerPointActive(boolean) - * @since 3.11 - */ - @Override - public void setTriggerPointActive(boolean triggerPointActive) throws CoreException { - if (isTriggerPointActive() != triggerPointActive) { - setAttribute(TRIGGEREPOINTACTIVE, triggerPointActive); - } - } - /** * Convenience method to set the given boolean attribute of this * breakpoint's underlying marker in a workspace runnable. Setting marker @@ -429,11 +401,4 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint { } } - /** - * @since 3.11 - */ - protected static String getTriggerActivePropertyString() { - return TRIGGEREPOINTACTIVE; - } - } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java index c59601c0f..cb3523eff 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java @@ -244,33 +244,6 @@ public interface IBreakpoint extends IAdaptable { public default void setTriggerPoint(boolean trigger) throws CoreException { } - /** - * Sets if the breakpoint is a trigger point and is active. If trigger point - * is active TRIGGERPOINTACTIVE attribute on this breakpoint's - * marker is set to true. - * - * @param active whether this breakpoint is to be treated as trigger point - * for the workspace - * @exception CoreException if unable to set the associated attribute on - * this breakpoint's underlying marker. - * @since 3.11 - */ - public default void setTriggerPointActive(boolean active) throws CoreException { - } - - /** - * Returns whether this breakpoint is a trigger point and is active. - * - * @return whether this breakpoint is a trigger point and it is active - * @exception CoreException if unable to access the associated attribute on - * this breakpoint's underlying marker - * @since 3.11 - */ - public default boolean isTriggerPointActive() throws CoreException { - return false; - } - - } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java index e073dfc00..94c8fd678 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java @@ -1403,7 +1403,6 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis IBreakpoint[] triggerPointBreakpointList = fTriggerPointBreakpointList.toArray(new IBreakpoint[0]); for (IBreakpoint iBreakpoint : triggerPointBreakpointList) { iBreakpoint.setTriggerPoint(false); - iBreakpoint.setTriggerPointActive(false); } refreshTriggerpointDisplay(); } @@ -1415,7 +1414,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis } for (IBreakpoint iBreakpoint : fTriggerPointBreakpointList) { try { - if (iBreakpoint.isTriggerPointActive()) { + if (iBreakpoint.isEnabled()) { return false; } } catch (CoreException e) { @@ -1425,27 +1424,22 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis return true; } - - /* - * (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointManager#revisitTriggerpoints() - * This version of implementation deactivate all the active trigger points - */ @Override - public void deActivateTriggerpoints(IBreakpoint[] triggerointList) { - if (triggerointList == null) { - triggerointList = fTriggerPointBreakpointList.toArray(new IBreakpoint[0]); + public void enableTriggerpoints(IBreakpoint[] triggerpoints, boolean enable) { + IBreakpoint[] triggerpointList = triggerpoints; + if (triggerpoints == null) { + triggerpointList = fTriggerPointBreakpointList.toArray(new IBreakpoint[0]); } - for (IBreakpoint iBreakpoint : triggerointList) { + for (IBreakpoint iBreakpoint : triggerpointList) { try { - if (iBreakpoint.isTriggerPointActive()) { - iBreakpoint.setTriggerPointActive(false); + IMarker m = iBreakpoint.getMarker(); + if (m != null && m.exists()) { + iBreakpoint.setEnabled(enable); } } catch (CoreException e) { e.printStackTrace(); } } - refreshTriggerpointDisplay(); } @Override -- cgit v1.2.3