public String getCurrentURL () { String s = cp1.getCurrentURL (); if (s.trim ().length () < 1) return cp2.getCurrentURL (); return s; }
/** * Returns URL of source currently selected in editor or <code>null</code>. * * @return URL of source currently selected in editor or <code>null</code> */ public static String getCurrentURL () { return getContext ().getCurrentURL (); }
/** * Returns URL of source currently selected in editor or * <code>null</code>. * * @return URL of source currently selected in editor or <code>null</code> */ public static String getCurrentURL() { return getContext().getCurrentURL(); }
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(); } } }); }
private static LineBreakpoint createBreakpoint () { LineBreakpoint mb = LineBreakpoint.create ( EditorContextBridge.getContext().getCurrentURL (), EditorContextBridge.getContext().getCurrentLineNumber () ); mb.setPrintText ( NbBundle.getBundle (LineBreakpointPanel.class).getString ("CTL_Line_Breakpoint_Print_Text") ); return mb; }
public void doAction (Object action) { // 1) set breakpoint removeBreakpoint (); createBreakpoint (LineBreakpoint.create ( editor.getCurrentURL (), editor.getCurrentLineNumber () )); // 2) start debugging of project invokeAction(); }
private boolean shouldBeEnabled () { if (editor.getCurrentLineNumber () < 0) return false; if (!editor.getCurrentURL ().endsWith (".scala")) return false; // check if current project supports this action Project p = MainProjectManager.getDefault ().getMainProject (); if (p == null) return false; ActionProvider actionProvider = (ActionProvider) p.getLookup (). lookup (ActionProvider.class); if (actionProvider == null) return false; String[] sa = actionProvider.getSupportedActions (); int i, k = sa.length; for (i = 0; i < k; i++) if (ActionProvider.COMMAND_DEBUG.equals (sa [i])) break; if (i == k) return false; // check if this action should be enabled return ((ActionProvider) p.getLookup ().lookup ( ActionProvider.class )).isActionEnabled ( ActionProvider.COMMAND_DEBUG, MainProjectManager.getDefault ().getMainProject ().getLookup () ); }
@Override public void propertyChange(PropertyChangeEvent evt) { String url = EditorContextBridge.getContext().getCurrentURL(); FileObject fo; try { fo = URLMapper.findFileObject(new URL(url)); } catch (MalformedURLException muex) { fo = null; } setEnabled( ActionsManager.ACTION_TOGGLE_BREAKPOINT, (EditorContextBridge.getContext().getCurrentLineNumber() >= 0) && // "text/x-scala" MIMEType will be resolved by scala.editing module, thus this module should run-dependency on scala.editing (fo != null && "text/x-scala".equals(fo.getMIMEType())) // NOI18N //(fo != null && (url.endsWith (".scala"))) // NOI18N ); if (debugger != null && debugger.getState() == JPDADebugger.STATE_DISCONNECTED) { destroy(); } }
String url = EditorContextBridge.getContext().getCurrentURL(); if ("".equals(url.trim())) { return;
final String url = EditorContextBridge.getContext().getCurrentURL (); final java.awt.IllegalComponentStateException[] exs = new java.awt.IllegalComponentStateException[] { cex, fex, mex }; } else { int ln = EditorContextBridge.getContext().getCurrentLineNumber (); String url = EditorContextBridge.getContext().getCurrentURL (); return submitFieldOrMethodBreakpoint(className[0], fieldName[0], methodName, methodSignature,