public int getCurrentLineNumber () { int i = cp1.getCurrentLineNumber (); if (i < 1) return cp2.getCurrentLineNumber (); return i; }
public String getCurrentURL () { String s = cp1.getCurrentURL (); if (s.trim ().length () < 1) return cp2.getCurrentURL (); return s; }
@Override public Object annotate(String url, int lineNumber, String annotationType, Object timeStamp, JPDAThread thread) { CompoundAnnotation ca = new CompoundAnnotation (); ca.annotation1 = cp1.annotate (url, lineNumber, annotationType, timeStamp, thread); ca.annotation2 = cp2.annotate (url, lineNumber, annotationType, timeStamp, thread); if (ca.annotation1 != null || ca.annotation2 != null) { return ca; } else { return null; } }
public void postAction(Object action, final Runnable actionPerformedNotifier) { final LineBreakpoint newBreakpoint = LineBreakpoint.create ( editor.getCurrentURL (), editor.getCurrentLineNumber () ); RequestProcessor.getDefault().post(new Runnable() { public void run() { // 1) set breakpoint removeBreakpoint (); createBreakpoint (newBreakpoint); try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { invokeAction(); } }); } catch (InterruptedException iex) { // Procceed } catch (java.lang.reflect.InvocationTargetException itex) { ErrorManager.getDefault().notify(itex); } finally { actionPerformedNotifier.run(); } } }); }
java.awt.IllegalComponentStateException mex; try { className[0] = EditorContextBridge.getContext().getCurrentClassName(); cex = null; } catch (java.awt.IllegalComponentStateException icsex) { fieldName[0] = EditorContextBridge.getContext().getCurrentFieldName(); fex = null; } catch (java.awt.IllegalComponentStateException icsex) { String[] methodInfo; try { methodInfo = EditorContextBridge.getContext().getCurrentMethodDeclaration(); mex = null; } catch (java.awt.IllegalComponentStateException icsex) { final int ln = EditorContextBridge.getContext().getCurrentLineNumber (); final String url = EditorContextBridge.getContext().getCurrentURL (); final java.awt.IllegalComponentStateException[] exs = new java.awt.IllegalComponentStateException[] { cex, fex, mex }; return false; } else { int ln = EditorContextBridge.getContext().getCurrentLineNumber (); String url = EditorContextBridge.getContext().getCurrentURL (); return submitFieldOrMethodBreakpoint(className[0], fieldName[0], methodName, methodSignature,
public boolean showSource (String sourceName, int lineNumber, Object timeStamp) { return cp1.showSource (sourceName, lineNumber, timeStamp) | cp2.showSource (sourceName, lineNumber, timeStamp); }
lineNumbers = new int[URLs.length]; for (int i = 0; i < URLs.length; i++) { lineNumbers[i] = getContext().getFieldLineNumber(URLs[i], className, ((FieldBreakpoint) b).getFieldName()); int[] newlns = new int[newUrls.length]; for (int j = 0; j < newUrls.length; j++) { newlns[j] = getContext().getMethodLineNumber(newUrls[j], filters[i], ((MethodBreakpoint) b).getMethodName(), ((MethodBreakpoint) b).getMethodSignature()); for (int i = 0; i < URLs.length; i++) { if (lineNumbers[i] >= 1) { Object annotation = getContext().annotate (URLs[i], lineNumbers[i], annotationType, null); if (annotation != null) { annotations.add(annotation);
public boolean showSource (Field v) { String fieldName = ((Field) v).getName (); String className = className = ((Field) v).getClassName (); String url = getURL ( EditorContextBridge.getRelativePath (className), true ); if (url == null) return false; int lineNumber = lineNumber = EditorContextBridge.getContext().getFieldLineNumber ( url, className, fieldName ); if (lineNumber < 1) lineNumber = 1; return EditorContextBridge.getContext().showSource ( url, lineNumber, debugger ); }
public void createTimeStamp (Object timeStamp) { cp1.createTimeStamp (timeStamp); cp2.createTimeStamp (timeStamp); }
public void removeAnnotation (Object value) { if (value instanceof List) { for (Iterator iter = ((List) value).iterator(); iter.hasNext();) { CompoundAnnotation ca = (CompoundAnnotation) iter.next(); if (ca.annotation1 != null) { cp1.removeAnnotation (ca.annotation1); } if (ca.annotation2 != null) { cp2.removeAnnotation (ca.annotation2); } } return; } CompoundAnnotation ca = (CompoundAnnotation) value; if (ca.annotation1 != null) { cp1.removeAnnotation (ca.annotation1); } if (ca.annotation2 != null) { cp2.removeAnnotation (ca.annotation2); } }
public void disposeTimeStamp (Object timeStamp) { cp1.disposeTimeStamp (timeStamp); cp2.disposeTimeStamp (timeStamp); }
public int getLineNumber (Object annotation, Object timeStamp) { CompoundAnnotation ca = new CompoundAnnotation (); int ln; if (ca.annotation1 != null) { ln = cp1.getLineNumber (ca.annotation1, timeStamp); } else { ln = -1; } if (ln >= 0) return ln; if (ca.annotation2 != null) { return cp2.getLineNumber (ca.annotation2, timeStamp); } else { return -1; } }
public void updateTimeStamp (Object timeStamp, String url) { cp1.updateTimeStamp (timeStamp, url); cp2.updateTimeStamp (timeStamp, url); }
public void doAction (Object action) { // 1) set breakpoint removeBreakpoint (); createBreakpoint (LineBreakpoint.create ( editor.getCurrentURL (), editor.getCurrentLineNumber () )); // 2) start debugging of project invokeAction(); }
/** * Shows source with given url on given line number. * * @param url a url of source to be shown * @param lineNumber a number of line to be shown */ public static boolean showSource(String url, int lineNumber, Object timeStamp) { return getContext().showSource(url, lineNumber, timeStamp); }
/** * Creates a new time stamp. * * @param timeStamp a new time stamp */ public static void createTimeStamp (Object timeStamp) { getContext ().createTimeStamp (timeStamp); }
/** * Removes given annotation. * * @return true if annotation has been successfully removed */ public static void removeAnnotation ( Object annotation ) { getContext ().removeAnnotation (annotation); }
/** * Disposes given time stamp. * * @param timeStamp a time stamp to be disposed */ public static void disposeTimeStamp (Object timeStamp) { getContext ().disposeTimeStamp (timeStamp); }
public static int getLineNumber(Object annotation, Object timeStamp) { return getContext().getLineNumber(annotation, timeStamp); }
String url = classToSourceURL (fo2, logger); if (url != null) editorContext.updateTimeStamp (debugger, url); InputStream is = fo2.getInputStream (); long fileSize = fo2.getSize ();