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(); } };
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; }
/** * 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; }
/** * 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(); }
if (type == null) { item = ((IJavaBreakpoint)item).getMarker().getResource(); } else { item = type;
if (getBreakpoint().getMarker().getAttribute(ATTR_DELETE_ON_CANCEL) != null) { getShell().addShellListener(new ShellListener() { public void shellActivated(ShellEvent e) {