public WatchpointChange(IJavaWatchpoint watchpoint) throws CoreException { super(watchpoint); fFieldName = watchpoint.getFieldName(); fAccess = watchpoint.isAccess(); fModification = watchpoint.isModification(); }
protected void apply(IJavaWatchpoint breakpoint) throws CoreException { super.apply(breakpoint); breakpoint.setAccess(fAccess); breakpoint.setModification(fModification); } }
protected String getWatchpointText(IJavaWatchpoint watchpoint) throws CoreException { String typeName= watchpoint.getTypeName(); IMember member= BreakpointUtils.getMember(watchpoint); StringBuffer label= new StringBuffer(); label.append(getQualifiedName(typeName)); appendHitCount(watchpoint, label); appendSuspendPolicy(watchpoint,label); appendThreadFilter(watchpoint, label); boolean access= watchpoint.isAccess(); boolean modification= watchpoint.isModification(); if (access && modification) { label.append(DebugUIMessages.JDIModelPresentation_access_and_modification_70); } else if (access) { label.append(DebugUIMessages.JDIModelPresentation_access_71); } else if (modification) { label.append(DebugUIMessages.JDIModelPresentation_modification_72); } label.append(" - "); //$NON-NLS-1$ if (member != null) { label.append(getJavaLabelProvider().getText(member)); } else { label.append(watchpoint.getFieldName()); } return label.toString(); }
boolean access = fFieldAccess.getSelection(); boolean modification = fFieldModification.getSelection(); if (access != watchpoint.isAccess()) { watchpoint.setAccess(access); if (modification != watchpoint.isModification()) { watchpoint.setModification(modification);
/** * Returns any existing watchpoint for the given field, or <code>null</code> if none. * * @param typeName fully qualified type name on which watchpoint may exist * @param fieldName field name * @return any existing watchpoint for the given field, or <code>null</code> if none * @throws CoreException */ private IJavaWatchpoint getWatchpoint(String typeName, String fieldName) throws CoreException { IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager(); IBreakpoint[] breakpoints = breakpointManager.getBreakpoints(JDIDebugModel.getPluginIdentifier()); for (int i = 0; i < breakpoints.length; i++) { IBreakpoint breakpoint = breakpoints[i]; if (breakpoint instanceof IJavaWatchpoint) { IJavaWatchpoint watchpoint = (IJavaWatchpoint) breakpoint; if (typeName.equals(watchpoint.getTypeName()) && fieldName.equals(watchpoint.getFieldName())) { return watchpoint; } } } return null; }
fEnabledButton.addSelectionListener(watchpointValidator); fFieldAccess = createCheckButton(parent, PropertyPageMessages.JavaLineBreakpointPage_7); fFieldAccess.setSelection(watchpoint.isAccess()); fFieldAccess.addSelectionListener(watchpointValidator); fFieldModification = createCheckButton(parent, PropertyPageMessages.JavaLineBreakpointPage_8); fFieldModification.setSelection(watchpoint.isModification()); fFieldModification.addSelectionListener(watchpointValidator);
} else if (breakpoint instanceof IJavaWatchpoint) { IJavaWatchpoint wp = (IJavaWatchpoint)breakpoint; String fieldName = wp.getFieldName(); args = new String[] {thread.getName(), fieldName, typeName}; if (wp.isAccessSuspend(thread.getDebugTarget())) { key.append("_fieldaccess"); //$NON-NLS-1$ } else {
/** * Returns the field associated with the watchpoint. * * @param breakpoint Java watchpoint * @return field */ public static IField getField(IJavaWatchpoint breakpoint) { String handle = breakpoint.getMarker().getAttribute(HANDLE_ID, null); if (handle != null) { IJavaElement je = JavaCore.create(handle); if (je != null) { if (je instanceof IField) { return (IField)je; } } } return null; }
IJavaWatchpoint wp = (IJavaWatchpoint)jbp; IJavaFieldVariable fv = (IJavaFieldVariable)variable; if (variable.getName().equals(wp.getFieldName()) && fv.getDeclaringType().getName().equals(wp.getTypeName())) { valid = wp;
JDIImageDescriptor descriptor= null; boolean enabled= (flags & JDIImageDescriptor.ENABLED) != 0; if (watchpoint.isAccess()) { if (watchpoint.isModification()) { } else if (watchpoint.isModification()) { if (enabled) { descriptor= new JDIImageDescriptor(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_MODIFICATION_WATCHPOINT), flags);