|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Micro//S ystems, Inc. Portions Copyright 1997-2004 Sun * Micro//S ystems, Inc. All Rights Reserved. */ package org.netbeans.modules.web.debug; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.List; import java.beans.PropertyChangeListener; import org.netbeans.api.debugger.DebuggerManager; import org.netbeans.api.debugger.jpda.*; import org.netbeans.spi.debugger.jpda.*; import org.netbeans.modules.web.debug.breakpoints.JspLineBreakpoint; /** * * @author Martin Grebac */ public class Context { private static EditorContext editorContext; private static EditorContext getContext () { if (editorContext == null) { List l = DebuggerManager.getDebuggerManager().lookup(null, EditorContext.class); editorContext = (EditorContext) l.get (0); } return editorContext; } // EditorContext methods ................................................. /** * 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); } /** * Adds annotation to given url on given line. * * @param url a url of source annotation should be set into * @param lineNumber a number of line annotation should be set into * @param annotationType a type of annotation to be set * * @return annotation */ public static Object annotate ( String url, int lineNumber, String annotationType, Object timeStamp ) { return getContext ().annotate (url, lineNumber, annotationType, timeStamp); } /** * Removes given annotation. * * @return true if annotation has been successfully removed */ public static void removeAnnotation ( Object annotation ) { getContext ().removeAnnotation (annotation); } public static int getLineNumber (Object annotation, Object timeStamp) { return getContext ().getLineNumber (annotation, timeStamp); } /** * Returns number of line currently selected in editor or |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.