static SourcePathProvider getDefaultContext() { List providers = DebuggerManager.getDebuggerManager(). lookup("netbeans-JPDASession", SourcePathProvider.class); for (Iterator it = providers.iterator(); it.hasNext(); ) { Object provider = it.next(); // Hack - find our provider: if (provider.getClass().getName().equals("org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl")) { return (SourcePathProvider) provider; } } return null; }
private static EditorContext getContext() { if (editorContext == null) { List l = DebuggerManager.getDebuggerManager().lookup(null, EditorContext.class); if (!l.isEmpty()) { editorContext = (EditorContext) l.get(0); } } return editorContext; }
private static EditorContext getContext () { if (editorContext == null) { List l = DebuggerManager.getDebuggerManager().lookup(null, EditorContext.class); if (!l.isEmpty()) { editorContext = (EditorContext) l.get (0); } } return editorContext; }
private static SourcePathProvider getDefaultContext() { List providers = DebuggerManager.getDebuggerManager(). lookup("netbeans-JPDASession", SourcePathProvider.class); for (Iterator it = providers.iterator(); it.hasNext(); ) { Object provider = it.next(); // Hack - find our provider: if (provider != null && provider.getClass().getName().equals("org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl")) { return (SourcePathProvider) provider; } } return null; }
public static EditorContext getContext () { if (context == null) { List l = DebuggerManager.getDebuggerManager ().lookup (null, EditorContext.class); context = (EditorContext) l.get (0); int i, k = l.size (); for (i = 1; i < k; i++) context = new CompoundContextProvider ( (EditorContext) l.get (i), context ); } return context; }
private static NativeBreakpoint newBreakpointOfType(Class<? extends NativeBreakpointType> cls) { // NativeBreakpointType nbt = breakpointType(cls); NativeBreakpointType instance = (NativeBreakpointType)ContextAwareSupport.createInstance( cls.getCanonicalName(), org.netbeans.api.debugger.DebuggerManager.getDebuggerManager()); if (instance != null) { return instance.newInstance(NativeBreakpoint.TOPLEVEL); } else { // previous approach List breakpointTypes = org.netbeans.api.debugger.DebuggerManager.getDebuggerManager(). lookup(null, BreakpointType.class); if (breakpointTypes == null) { return null; } NativeBreakpointType nbt = null; for (int btx = 0; btx < breakpointTypes.size(); btx++) { BreakpointType bt = (BreakpointType) breakpointTypes.get(btx); if (cls.isInstance(bt)) { nbt = (NativeBreakpointType) bt; break; } } if (nbt == null) { return null; } NativeBreakpoint bpt = nbt.newInstance(NativeBreakpoint.TOPLEVEL); return bpt; } }
/** * Initialize the type name to a NativeBreakpointType map. */ private void initializeTypeLookup() { final List<? extends BreakpointType> breakpointTypes = DebuggerManager.getDebuggerManager().lookup(null, BreakpointType.class); if (breakpointTypes != null) { synchronized (breakpointTypes) { for (BreakpointType bt : breakpointTypes) { String category = bt.getCategoryDisplayName(); if (!NativeBreakpointType.isOurs(category)) continue; // can not check with instance of, because manager uses lazy class objects // not our real registered NativeBreakpointTypes // if (! (bt instanceof NativeBreakpointType)) // continue; types.put(((NativeBreakpointType)bt).id(), bt); // for compatibility with old localized style types.put(bt.getTypeDisplayName(), bt); } } } }
DebuggerManager.getDebuggerManager().lookup(null, BreakpointType.class);