/** * Applies the original attributes to the new breakpoint * * @param breakpoint the new breakpoint * @throws CoreException */ protected void apply(IJavaBreakpoint breakpoint) throws CoreException { breakpoint.setHitCount(fHitCount); for (int i = 0; i < fInstanceFilters.length; i++) { breakpoint.addInstanceFilter(fInstanceFilters[i]); } breakpoint.setSuspendPolicy(fSuspendPolicy); for (int i = 0; i < fThreadFilters.length; i++) { breakpoint.setThreadFilter(fThreadFilters[i]); } breakpoint.setEnabled(fEnabled); }
public Change perform(IProgressMonitor pm) throws CoreException { getOriginalBreakpoint().delete(); return new NullChange(); }
/** * Constructor * @param breakpoint * @throws CoreException */ public BreakpointChange(IJavaBreakpoint breakpoint) throws CoreException { fBreakpoint = breakpoint; fTypeName = breakpoint.getTypeName(); fHitCount = breakpoint.getHitCount(); fInstanceFilters = breakpoint.getInstanceFilters(); fSuspendPolicy = breakpoint.getSuspendPolicy(); fThreadFilters = breakpoint.getThreadFilters(); fEnabled = breakpoint.isEnabled(); }
/** * @see BreakpointToggleAction#doAction(IJavaBreakpoint) */ public void doAction(IJavaBreakpoint breakpoint) throws CoreException { if(breakpoint.getSuspendPolicy() != fCurrentPolicy) { breakpoint.setSuspendPolicy(fCurrentPolicy); } }
while (iter.hasNext()) { IJavaBreakpoint bp = (IJavaBreakpoint)iter.next(); IJavaObject[] filters = bp.getInstanceFilters(); for (int i = 0; i < filters.length; i++) { if (filters[i].equals(object)) { bp.addInstanceFilter(object); existing.remove(bp); while (iter.hasNext()) { IJavaBreakpoint bp = (IJavaBreakpoint)iter.next(); bp.removeInstanceFilter(object);
protected void doStore() { try { IJavaObject[] objects = fBreakpoint.getInstanceFilters(); for (int i= 0; i < objects.length; i++) { if (!fInstanceViewer.getChecked(objects[i])) { fBreakpoint.removeInstanceFilter(objects[i]); } } } catch (CoreException e) { JDIDebugUIPlugin.log(e); } }
/** * Returns the class load breakpoint for the specified type or null if none found * @param type the type to search for a class load breakpoint for * @return the existing class load breakpoint, or null if none * @throws CoreException * @since 3.3 */ protected IBreakpoint getClassLoadBreakpoint(IType type) throws CoreException { IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(JDIDebugModel.getPluginIdentifier()); IBreakpoint existing = null; IJavaBreakpoint breakpoint = null; for (int i = 0; i < breakpoints.length; i++) { breakpoint = (IJavaBreakpoint) breakpoints[i]; if (breakpoint instanceof IJavaClassPrepareBreakpoint && createQualifiedTypeName(type).equals(breakpoint.getTypeName())) { existing = breakpoint; break; } } return existing; }
protected String getMarkerTypeName(IJavaBreakpoint breakpoint, boolean qualified) throws CoreException { String typeName= null; if (breakpoint instanceof IJavaPatternBreakpoint) { typeName = breakpoint.getMarker().getResource().getName(); } else { typeName = breakpoint.getTypeName(); } if (!qualified) { int index= typeName.lastIndexOf('.'); if (index != -1) { typeName= typeName.substring(index + 1); } } return typeName; }
public void run(IProgressMonitor monitor) throws CoreException { IJavaBreakpoint breakpoint = getBreakpoint(); boolean delOnCancel = breakpoint.getMarker().getAttribute(ATTR_DELETE_ON_CANCEL) != null; if (delOnCancel) { // if this breakpoint is being created, remove the "delete on cancel" attribute // and register with the breakpoint manager breakpoint.getMarker().setAttribute(ATTR_DELETE_ON_CANCEL, (String)null); breakpoint.setRegistered(true); } doStore(); } };
/** * Check to see if the breakpoint should be deleted. */ public boolean performCancel() { try { if (getBreakpoint().getMarker().getAttribute(ATTR_DELETE_ON_CANCEL) != null) { // if this breakpoint is being created, delete on cancel getBreakpoint().delete(); } } catch (CoreException e) { JDIDebugUIPlugin.statusDialog(PropertyPageMessages.JavaBreakpointPage_9, e.getStatus()); } return super.performCancel(); }
/** * @see IActionDelegate#run(IAction) */ public void run(IAction action) { IStructuredSelection selection= getCurrentSelection(); if (selection == null) { return; } Iterator itr= selection.iterator(); if (!itr.hasNext()) { return; } while (itr.hasNext()) { IJavaBreakpoint breakpoint= (IJavaBreakpoint)itr.next(); try { int oldHitCount= breakpoint.getHitCount(); int newHitCount= hitCountDialog(breakpoint); if (newHitCount != -1) { if (oldHitCount == newHitCount && newHitCount == 0) { return; } breakpoint.setHitCount(newHitCount); } } catch (CoreException ce) { JDIDebugUIPlugin.statusDialog(ce.getStatus()); } } }
valid = wp; } else if (superTypeNames.contains(jbp.getTypeName()) || jbp instanceof IJavaExceptionBreakpoint) { valid = jbp; if (valid != null && valid.supportsInstanceFilters()) { breakpoints.add(valid);
int flags= 0; try { if (breakpoint.isEnabled()) { flags |= JDIImageDescriptor.ENABLED; if (breakpoint.isInstalled()) { flags |= JDIImageDescriptor.INSTALLED;
/** * @see ITreeContentProvider#getChildren(Object) */ public Object[] getChildren(Object parent) { if (parent instanceof IJavaBreakpoint) { try { return ((IJavaBreakpoint)parent).getInstanceFilters(); } catch (CoreException e) { JDIDebugUIPlugin.log(e); } } return new Object[0]; }
protected StringBuffer appendHitCount(IJavaBreakpoint breakpoint, StringBuffer label) throws CoreException { int hitCount= breakpoint.getHitCount(); if (hitCount > 0) { label.append(" ["); //$NON-NLS-1$ label.append(DebugUIMessages.JDIModelPresentation_hit_count__67); label.append(' '); label.append(hitCount); label.append(']'); } return label; }
protected void appendSuspendPolicy(IJavaBreakpoint breakpoint, StringBuffer buffer) throws CoreException { if (breakpoint.getSuspendPolicy() == IJavaBreakpoint.SUSPEND_VM) { buffer.append(' '); buffer.append(DebugUIMessages.JDIModelPresentation_Suspend_VM); } }
/** * Returns the type that the given Java breakpoint refers to * * @param breakpoint Java breakpoint * @return the type the breakpoint is associated with */ public static IType getType(IJavaBreakpoint breakpoint) { String handle = breakpoint.getMarker().getAttribute(HANDLE_ID, null); if (handle != null) { IJavaElement je = JavaCore.create(handle); if (je != null) { if (je instanceof IType) { return (IType)je; } if (je instanceof IMember) { return ((IMember)je).getDeclaringType(); } } } return null; }
/** * Creates the button to toggle enablement of the breakpoint * @param parent * @throws CoreException */ protected void createEnabledButton(Composite parent) throws CoreException { fEnabledButton = createCheckButton(parent, PropertyPageMessages.JavaBreakpointPage_5); fEnabledButton.setSelection(getBreakpoint().isEnabled()); }
protected void appendThreadFilter(IJavaBreakpoint breakpoint, StringBuffer buffer) throws CoreException { if (breakpoint.getThreadFilters().length != 0) { buffer.append(' '); buffer.append(DebugUIMessages.JDIModelPresentation_thread_filtered); } }
/** * Sets the initial checked state of the tree viewer. * The initial state should reflect the current state * of the breakpoint. If the breakpoint has a thread * filter in a given thread, that thread should be * checked. */ protected void setInitialCheckedState() { try { IDebugTarget[] targets= getDebugTargets(); for (int i= 0, numTargets= targets.length; i < numTargets; i++) { IJavaDebugTarget target = (IJavaDebugTarget)targets[i].getAdapter(IJavaDebugTarget.class); if (target != null) { IJavaThread filteredThread= fPage.getBreakpoint().getThreadFilter(target); if (filteredThread != null) { fCheckHandler.checkThread(filteredThread, true); } } } } catch (CoreException e) { JDIDebugUIPlugin.log(e); } }