aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-05-30 16:22:00 (EDT)
committerEugene Tarassov2012-05-31 15:17:55 (EDT)
commite21ca821a986017f7b74d387a06f7dd0236b2667 (patch)
tree5288dddcbcdaf1c433d16440758ded3b3307c101
parent02388c958af07b015c2dd463c259dd703ba47c14 (diff)
downloadorg.eclipse.tcf-e21ca821a986017f7b74d387a06f7dd0236b2667.zip
org.eclipse.tcf-e21ca821a986017f7b74d387a06f7dd0236b2667.tar.gz
org.eclipse.tcf-e21ca821a986017f7b74d387a06f7dd0236b2667.tar.bz2
Bug 373278 - [breakpoints] Upgrade breakpoint scope page for editing prior to breakpoint creation
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/plugin.xml25
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/BreakpointScopeCategory.java4
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java1
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java56
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointThreadFilterPage.java42
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java19
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFToggleBreakpointAdapter.java145
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties1
8 files changed, 129 insertions, 164 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/plugin.xml b/plugins/org.eclipse.tcf.cdt.ui/plugin.xml
index 4edf7ab..0d09993 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/plugin.xml
+++ b/plugins/org.eclipse.tcf.cdt.ui/plugin.xml
@@ -75,14 +75,23 @@
name="%breakpoints.filterPage.name">
<filter name="debugModelId" value="org.eclipse.tcf.debug"/>
<enabledWhen>
- <and>
- <adapt type="org.eclipse.cdt.debug.core.model.ICBreakpoint"/>
- <not>
- <adapt type="org.eclipse.cdt.debug.core.model.ICTracepoint"/>
- </not>
- </and>
- </enabledWhen>
- </page>
+ <or>
+ <and>
+ <adapt type="org.eclipse.cdt.debug.core.model.ICBreakpoint"/>
+ <not>
+ <adapt type="org.eclipse.cdt.debug.core.model.ICTracepoint"/>
+ </not>
+ </and>
+ <and>
+ <instanceof value="org.eclipse.cdt.debug.ui.breakpoints.ICBreakpointContext"/>
+ <test property="org.eclipse.cdt.debug.ui.createBreakpointAdapt" value="org.eclipse.cdt.debug.core.model.ICBreakpoint" />
+ <not>
+ <test property="org.eclipse.cdt.debug.ui.createBreakpointAdapt" value="org.eclipse.cdt.debug.core.model.ICTracepoint"/>
+ </not>
+ </and>
+ </or>
+ </enabledWhen>
+ </page>
</extension>
<extension point="org.eclipse.ui.propertyPages">
<page class="org.eclipse.tcf.internal.cdt.ui.breakpoints.TCFBreakpointThreadFilterPage"
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/BreakpointScopeCategory.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/BreakpointScopeCategory.java
index 4588768..03361aa 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/BreakpointScopeCategory.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/BreakpointScopeCategory.java
@@ -87,7 +87,9 @@ public class BreakpointScopeCategory extends PlatformObject implements IWorkbenc
}
public String getLabel(Object o) {
- if (getFilter() != null) {
+ if (getFilter() != null && getContextIds() != null) {
+ return MessageFormat.format(Messages.BreakpointScopeCategory_filter_and_contexts_label, new Object[] { getFilter(), getContextIds() });
+ } else if (getFilter() != null) {
return MessageFormat.format(Messages.BreakpointScopeCategory_filter_label, new Object[] { getFilter() });
} else if (getContextIds() != null) {
return MessageFormat.format(Messages.BreakpointScopeCategory_contexts_label, new Object[] { getContextIds() });
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java
index 038d80c..1939ee8 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/Messages.java
@@ -36,6 +36,7 @@ public class Messages extends NLS {
public static String TCFBreakpointPrefrencesError;
public static String BreakpointScopeCategory_filter_label;
public static String BreakpointScopeCategory_contexts_label;
+ public static String BreakpointScopeCategory_filter_and_contexts_label;
public static String BreakpointScopeCategory_global_label;
static {
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java
index 6fa9166..6f28f18 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java
@@ -17,6 +17,7 @@ import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.tcf.internal.cdt.ui.Activator;
import org.eclipse.tcf.internal.debug.model.TCFBreakpointsModel;
@@ -25,10 +26,20 @@ public class TCFBreakpointScopeExtension implements ICBreakpointExtension {
private String fContextIds;
private String fProperties;
private ICBreakpoint fBreakpoint;
-
+ private IPreferenceStore fPreferenceStore;
+
+ public void initialize(IPreferenceStore prefStore) {
+ fPreferenceStore = prefStore;
+ fContextIds = fPreferenceStore.getString(TCFBreakpointsModel.ATTR_CONTEXTIDS);
+ if (fContextIds != null && fContextIds.length() == 0) {
+ fContextIds = null;
+ }
+ fProperties = fPreferenceStore.getString(TCFBreakpointsModel.ATTR_CONTEXT_QUERY);
+ }
+
public void initialize(ICBreakpoint breakpoint) throws CoreException {
fBreakpoint = breakpoint;
- IMarker m = breakpoint.getMarker();
+ IMarker m = fBreakpoint.getMarker();
if (m != null && m.exists()) {
fContextIds = m.getAttribute(TCFBreakpointsModel.ATTR_CONTEXTIDS, null);
fProperties = m.getAttribute(TCFBreakpointsModel.ATTR_CONTEXT_QUERY, null);
@@ -61,7 +72,10 @@ public class TCFBreakpointScopeExtension implements ICBreakpointExtension {
void setRawContextIds(String contextIDs) {
fContextIds = contextIDs;
- if (fBreakpoint != null) {
+ if (fPreferenceStore!= null) {
+ fPreferenceStore.setValue(TCFBreakpointsModel.ATTR_CONTEXTIDS, contextIDs);
+ }
+ else if (fBreakpoint != null) {
try {
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
@@ -80,22 +94,26 @@ public class TCFBreakpointScopeExtension implements ICBreakpointExtension {
public void setPropertiesFilter(String properties) {
fProperties = properties;
- if (fBreakpoint == null) return;
- try {
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- final IMarker m = fBreakpoint.getMarker();
- if (m == null || !m.exists()) return;
- if (fProperties.length() != 0)
- m.setAttribute(TCFBreakpointsModel.ATTR_CONTEXT_QUERY, fProperties);
- else
- m.setAttribute(TCFBreakpointsModel.ATTR_CONTEXT_QUERY, null);
-
- }
- }, null);
- }
- catch (Exception e) {
- Activator.log(e);
+ if (fPreferenceStore!= null) {
+ fPreferenceStore.setValue(TCFBreakpointsModel.ATTR_CONTEXT_QUERY, properties);
+ }
+ else if (fBreakpoint != null) {
+ try {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ final IMarker m = fBreakpoint.getMarker();
+ if (m == null || !m.exists()) return;
+ if (fProperties.length() != 0)
+ m.setAttribute(TCFBreakpointsModel.ATTR_CONTEXT_QUERY, fProperties);
+ else
+ m.setAttribute(TCFBreakpointsModel.ATTR_CONTEXT_QUERY, null);
+
+ }
+ }, null);
+ }
+ catch (Exception e) {
+ Activator.log(e);
+ }
}
}
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointThreadFilterPage.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointThreadFilterPage.java
index 5cb89ab..90d24bc 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointThreadFilterPage.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointThreadFilterPage.java
@@ -12,7 +12,10 @@
package org.eclipse.tcf.internal.cdt.ui.breakpoints;
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
+import org.eclipse.cdt.debug.ui.breakpoints.ICBreakpointContext;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -26,15 +29,15 @@ import org.eclipse.ui.dialogs.PropertyPage;
public class TCFBreakpointThreadFilterPage extends PropertyPage {
private TCFThreadFilterEditor fThreadFilterEditor;
- private TCFBreakpointScopeExtension fCategoryScopeExtension;
+ private TCFBreakpointScopeExtension fFilterExtension;
@Override
protected Control createContents(Composite parent) {
BreakpointScopeCategory category = getScopeCategory();
if (category != null) {
- fCategoryScopeExtension = new TCFBreakpointScopeExtension();
- fCategoryScopeExtension.setPropertiesFilter(category.getFilter());
- fCategoryScopeExtension.setRawContextIds(category.getContextIds());
+ fFilterExtension = new TCFBreakpointScopeExtension();
+ fFilterExtension.setPropertiesFilter(category.getFilter());
+ fFilterExtension.setRawContextIds(category.getContextIds());
}
noDefaultAndApplyButton();
@@ -46,9 +49,20 @@ public class TCFBreakpointThreadFilterPage extends PropertyPage {
}
protected ICBreakpoint getBreakpoint() {
+ if (getElement() instanceof ICBreakpointContext) {
+ return ((ICBreakpointContext)getElement()).getBreakpoint();
+ }
return (ICBreakpoint) getElement().getAdapter(ICBreakpoint.class);
}
+ public IPreferenceStore getPreferenceStore() {
+ IAdaptable element = getElement();
+ if (element instanceof ICBreakpointContext) {
+ return ((ICBreakpointContext)element).getPreferenceStore();
+ }
+ return getContainer().getPreferenceStore();
+ }
+
protected BreakpointScopeCategory getScopeCategory() {
if (getElement() instanceof BreakpointScopeCategory) {
return (BreakpointScopeCategory)getElement();
@@ -57,19 +71,22 @@ public class TCFBreakpointThreadFilterPage extends PropertyPage {
}
protected TCFBreakpointScopeExtension getFilterExtension() {
+ if (fFilterExtension != null) return fFilterExtension;
+
ICBreakpoint bp = getBreakpoint();
if (bp != null) {
try {
- TCFBreakpointScopeExtension filter =
- (TCFBreakpointScopeExtension) bp.getExtension(
- ITCFConstants.ID_TCF_DEBUG_MODEL, TCFBreakpointScopeExtension.class);
- filter.initialize(bp);
- return filter;
+ fFilterExtension = bp.getExtension(
+ ITCFConstants.ID_TCF_DEBUG_MODEL, TCFBreakpointScopeExtension.class);
} catch (CoreException e) {
// potential race condition: ignore
}
}
- return fCategoryScopeExtension;
+ if (fFilterExtension == null) {
+ fFilterExtension = new TCFBreakpointScopeExtension();
+ fFilterExtension.initialize(getPreferenceStore());
+ }
+ return fFilterExtension;
}
protected void createThreadFilterEditor(Composite parent) {
@@ -91,8 +108,9 @@ public class TCFBreakpointThreadFilterPage extends PropertyPage {
*/
protected void doStore() {
fThreadFilterEditor.doStore();
- if (fCategoryScopeExtension != null) {
- getScopeCategory().setFilter(fCategoryScopeExtension.getPropertiesFilter(), fCategoryScopeExtension.getRawContextIds());
+ BreakpointScopeCategory scopeCategory = getScopeCategory();
+ if (scopeCategory != null && fFilterExtension != null) {
+ scopeCategory.setFilter(fFilterExtension.getPropertiesFilter(), fFilterExtension.getRawContextIds());
}
}
}
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java
index a56f3db..2a280ee 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java
@@ -328,24 +328,7 @@ public class TCFThreadFilterEditor {
}
private String getBPFilterExpression() {
- String expression = null;
- ICBreakpoint bp = (ICBreakpoint)fPage.getElement().getAdapter(ICBreakpoint.class);
- if (bp != null) {
- IMarker marker = bp.getMarker();
- if (marker != null) {
- try {
- expression = (String)marker.getAttribute(TCFBreakpointsModel.ATTR_CONTEXT_QUERY);
- }
- catch (CoreException e) {
- e.printStackTrace();
- }
- }
- }
- if (fPage.getElement() instanceof BreakpointScopeCategory) {
- expression = ((BreakpointScopeCategory)fPage.getElement()).getFilter();
- }
-
- return expression;
+ return fPage.getFilterExtension().getPropertiesFilter();
}
private String[] getAvailableAttributes() {
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFToggleBreakpointAdapter.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFToggleBreakpointAdapter.java
index 0381f0e..042b382 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFToggleBreakpointAdapter.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFToggleBreakpointAdapter.java
@@ -11,7 +11,8 @@
package org.eclipse.tcf.internal.cdt.ui.breakpoints;
import java.math.BigInteger;
-import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.model.ICBreakpointType;
@@ -20,19 +21,15 @@ import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
import org.eclipse.cdt.debug.ui.breakpoints.AbstractToggleBreakpointAdapter;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.tcf.internal.cdt.ui.Activator;
import org.eclipse.tcf.internal.cdt.ui.preferences.PreferenceConstants;
-import org.eclipse.tcf.internal.debug.model.ITCFConstants;
import org.eclipse.tcf.internal.debug.model.TCFBreakpointsModel;
import org.eclipse.tcf.internal.debug.ui.model.TCFNode;
import org.eclipse.ui.IWorkbenchPart;
@@ -43,37 +40,9 @@ import org.eclipse.ui.IWorkbenchPart;
public class TCFToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter {
private final String TOGGLE_TYPE;
- private bpAttributes attributes;
TCFToggleBreakpointAdapter(String toggle_type ) {
TOGGLE_TYPE = toggle_type;
- attributes = new bpAttributes();
- }
-
- private class bpAttributes {
- private HashMap<String, Object> attributes;
- private String error;
-
- bpAttributes() {
- attributes = new HashMap<String, Object>();
- error = null;
- }
-
- public void put (String str, Object obj) {
- attributes.put(str, obj);
- }
-
- public HashMap<String, Object> getMap() {
- return attributes;
- }
-
- public void clear() {
- attributes.clear();
- }
-
- public String getError() {
- return error;
- }
}
private static IStructuredSelection getDebugContext(IWorkbenchPart part) {
@@ -101,8 +70,8 @@ public class TCFToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter
null);
}
- private static Boolean checkToggleType ( IWorkbenchPart part, final String toggleType, final bpAttributes attributes) {
- Boolean bFoundError = false;
+ private Map<String, Object> getDefaultAttributes ( IWorkbenchPart part, final String toggleType) {
+ Map<String, Object> attributes = new TreeMap<String, Object>();
if ( part != null ) {
Object obj = getDebugContext(part).getFirstElement();
if ( obj instanceof TCFNode ) {
@@ -115,7 +84,7 @@ public class TCFToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter
}
}
}
- return bFoundError;
+ return attributes;
}
/* (non-Javadoc)
@@ -131,22 +100,15 @@ public class TCFToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter
*/
@Override
protected void createLineBreakpoint( boolean interactive, IWorkbenchPart part, final String sourceHandle, final IResource resource, final int lineNumber ) throws CoreException {
- Boolean bFoundError = checkToggleType(part, TOGGLE_TYPE, attributes);
- if (!bFoundError ) {
- ICLineBreakpoint lineBp = CDIDebugModel.createBlankLineBreakpoint();
- CDIDebugModel.setLineBreakpointAttributes(
- attributes.getMap(), sourceHandle, getBreakpointType(), lineNumber, true, 0, "" ); //$NON-NLS-1$
- if ( !interactive ) {
- CDIDebugModel.createBreakpointMarker(lineBp, resource, attributes.getMap(), true);
- }
- else {
- openBreakpointPropertiesDialog(lineBp, part, resource, attributes.getMap());
- }
+ Map<String, Object> attributes = getDefaultAttributes(part, TOGGLE_TYPE);
+ ICLineBreakpoint lineBp = CDIDebugModel.createBlankLineBreakpoint();
+ CDIDebugModel.setLineBreakpointAttributes(
+ attributes, sourceHandle, getBreakpointType(), lineNumber, true, 0, "" ); //$NON-NLS-1$
+ if ( !interactive ) {
+ CDIDebugModel.createBreakpointMarker(lineBp, resource, attributes, true);
}
else {
- // Throw an error to the user.
- IStatus error = new Status(IStatus.ERROR, ITCFConstants.ID_TCF_DEBUG_MODEL, attributes.getError(), null);
- ErrorDialog.openError(null, Messages.TCFBreakpointToggleError, null, error);
+ openBreakpointPropertiesDialog(lineBp, part, resource, attributes);
}
}
@@ -154,43 +116,27 @@ public class TCFToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractToggleBreakpointAdapter#findFunctionBreakpoint(java.lang.String, org.eclipse.core.resources.IResource, java.lang.String)
*/
@Override
- protected ICFunctionBreakpoint findFunctionBreakpoint(
- String sourceHandle,
- IResource resource,
- String functionName ) throws CoreException {
- return CDIDebugModel.functionBreakpointExists( sourceHandle, resource, functionName );
+ protected ICFunctionBreakpoint findFunctionBreakpoint(String sourceHandle, IResource resource, String functionName) throws CoreException {
+ return CDIDebugModel.functionBreakpointExists(sourceHandle, resource, functionName);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractToggleBreakpointAdapter#createFunctionBreakpoint(java.lang.String, org.eclipse.core.resources.IResource, java.lang.String, int, int, int)
*/
@Override
- protected void createFunctionBreakpoint(
- boolean interactive,
- IWorkbenchPart part,
- String sourceHandle,
- IResource resource,
- String functionName,
- int charStart,
- int charEnd,
- int lineNumber ) throws CoreException {
- Boolean bFoundError = checkToggleType(part, TOGGLE_TYPE, attributes);
- if (!bFoundError) {
- ICFunctionBreakpoint bp = CDIDebugModel.createBlankFunctionBreakpoint();
- CDIDebugModel.setFunctionBreakpointAttributes( attributes.getMap(), sourceHandle, getBreakpointType(), functionName,
- charStart, charEnd, lineNumber, true, 0, "" ); //$NON-NLS-1$
- if (!interactive) {
- CDIDebugModel.createBreakpointMarker(bp, resource, attributes.getMap(), true);
- }
- else {
- openBreakpointPropertiesDialog(bp, part, resource, attributes.getMap());
- }
- }
- else {
- // Throw an error to the user.
- IStatus error = new Status(IStatus.ERROR, ITCFConstants.ID_TCF_DEBUG_MODEL, attributes.getError(), null);
- ErrorDialog.openError(null, Messages.TCFBreakpointToggleError, null, error);
- }
+ protected void createFunctionBreakpoint(boolean interactive, IWorkbenchPart part, String sourceHandle, IResource resource, String functionName, int charStart, int charEnd,
+ int lineNumber) throws CoreException
+ {
+ Map<String, Object> attributes = getDefaultAttributes(part, TOGGLE_TYPE);
+ ICFunctionBreakpoint bp = CDIDebugModel.createBlankFunctionBreakpoint();
+ CDIDebugModel.setFunctionBreakpointAttributes( attributes, sourceHandle, getBreakpointType(), functionName,
+ charStart, charEnd, lineNumber, true, 0, "" ); //$NON-NLS-1$
+ if (!interactive) {
+ CDIDebugModel.createBreakpointMarker(bp, resource, attributes, true);
+ }
+ else {
+ openBreakpointPropertiesDialog(bp, part, resource, attributes);
+ }
}
/* (non-Javadoc)
@@ -207,33 +153,20 @@ public class TCFToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter
@Override
protected void createWatchpoint(boolean interactive, IWorkbenchPart part, String sourceHandle, IResource resource, int charStart, int charEnd, int lineNumber,
- String expression, String memorySpace, String range) throws CoreException {
- Boolean bFoundError = checkToggleType(part, TOGGLE_TYPE, attributes);
- if (!bFoundError) {
- ICWatchpoint bp = CDIDebugModel.createBlankWatchpoint();
- CDIDebugModel.setWatchPointAttributes(attributes.getMap(), sourceHandle, resource, true, false,
- expression, memorySpace, new BigInteger(range), true, 0, ""); //$NON-NLS-1$
- openBreakpointPropertiesDialog(bp, part, resource, attributes.getMap());
- }
- else {
- // Throw an error to the user.
- IStatus error = new Status(IStatus.ERROR, ITCFConstants.ID_TCF_DEBUG_MODEL, attributes.getError(), null);
- ErrorDialog.openError(null, Messages.TCFBreakpointToggleError, null, error);
- }
+ String expression, String memorySpace, String range) throws CoreException
+ {
+ Map<String, Object> attributes = getDefaultAttributes(part, TOGGLE_TYPE);
+ ICWatchpoint bp = CDIDebugModel.createBlankWatchpoint();
+ CDIDebugModel.setWatchPointAttributes(attributes, sourceHandle, resource, true, false,
+ expression, memorySpace, new BigInteger(range), true, 0, ""); //$NON-NLS-1$
+ openBreakpointPropertiesDialog(bp, part, resource, attributes);
}
@Override
protected void createEventBreakpoint(boolean interactive, IWorkbenchPart part, IResource resource, String type, String arg) throws CoreException {
- Boolean bFoundError = checkToggleType(part, TOGGLE_TYPE, attributes);
- if (!bFoundError) {
- ICEventBreakpoint bp = CDIDebugModel.createBlankEventBreakpoint();
- CDIDebugModel.setEventBreakpointAttributes(attributes.getMap(),type, arg);
- openBreakpointPropertiesDialog(bp, part, resource, attributes.getMap());
- }
- else {
- // Throw an error to the user.
- IStatus error = new Status(IStatus.ERROR, ITCFConstants.ID_TCF_DEBUG_MODEL, attributes.getError(), null);
- ErrorDialog.openError(null, Messages.TCFBreakpointToggleError, null, error);
- }
+ Map<String, Object> attributes = getDefaultAttributes(part, TOGGLE_TYPE);
+ ICEventBreakpoint bp = CDIDebugModel.createBlankEventBreakpoint();
+ CDIDebugModel.setEventBreakpointAttributes(attributes,type, arg);
+ openBreakpointPropertiesDialog(bp, part, resource, attributes);
}
}
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties
index 9e26f3c..6dad281 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/messages.properties
@@ -30,4 +30,5 @@ TCFBreakpointToggleError=Error In Processing Breakpoint
BreakpointScopeCategory_filter_label=Filter: {0}
BreakpointScopeCategory_contexts_label=Contexts: {0}
+BreakpointScopeCategory_filter_and_contexts_label=Filter: {0}, Contexts: {1}
BreakpointScopeCategory_global_label=Global (no scope restriction) \ No newline at end of file