/** * Returns the line number of the first line in this frame's function or script, or <tt>???</tt> * if it cannot be determined. This is necessary because the line numbers provided by Rhino are unordered. * * @return the line number of the first line in this frame's function or script, or <tt>???</tt> * if it cannot be determined */ private String getFirstLine(final Context cx) { final Object line = cx.getThreadLocal(KEY_LAST_LINE); if (line == null) { return "unknown"; } return String.valueOf(line); }
/** * Called when the event being fired ends. */ @SuppressWarnings("unchecked") public void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
/** * Gets the scriptable used at starting scope for the execution of current script. * @return the scope as defined in {@link JavaScriptEngine#callFunction} * or {@link JavaScriptEngine#execute}. */ protected Scriptable getStartingScope() { return (Scriptable) Context.getCurrentContext().getThreadLocal(JavaScriptEngine.KEY_STARTING_SCOPE); }
/** * Gets the scriptable used at starting scope for the execution of current script. * @return the scope as defined in {@link JavaScriptEngine#callFunction} * or {@link JavaScriptEngine#execute}. */ protected Scriptable getStartingScope() { return (Scriptable) Context.getCurrentContext().getThreadLocal(JavaScriptEngine.KEY_STARTING_SCOPE); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
/** * Gets the scriptable used at starting scope for the execution of current script. * @return the scope as defined in {@link JavaScriptEngine#callFunction} * or {@link JavaScriptEngine#execute}. */ protected Scriptable getStartingScope() { @SuppressWarnings("unchecked") final Deque<Scriptable> stack = (Deque<Scriptable>) Context.getCurrentContext().getThreadLocal(JavaScriptEngine.KEY_STARTING_SCOPE); if (null == stack) { return null; } return stack.peek(); }
/** * Gets the scriptable used at starting scope for the execution of current script. * @return the scope as defined in {@link JavaScriptEngine#callFunction} * or {@link JavaScriptEngine#execute}. */ protected Scriptable getStartingScope() { return (Scriptable) Context.getCurrentContext().getThreadLocal(JavaScriptEngine.KEY_STARTING_SCOPE); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
/** * Called when the event being fired ends. */ @SuppressWarnings("unchecked") public void endFire() { ((LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT)).removeLast(); }
/** * Returns the mouse event currently firing, or <tt>null</tt> if no mouse event is being processed. * @return the mouse event currently firing */ @SuppressWarnings("unchecked") public static MouseEvent getCurrentMouseEvent() { final LinkedList<Event> events = (LinkedList<Event>) Context.getCurrentContext() .getThreadLocal(KEY_CURRENT_EVENT); if (events != null && !events.isEmpty() && events.getLast() instanceof MouseEvent) { return (MouseEvent) events.getLast(); } return null; }
/** * Returns the mouse event currently firing, or <tt>null</tt> if no mouse event is being processed. * @return the mouse event currently firing */ @SuppressWarnings("unchecked") public static MouseEvent getCurrentMouseEvent() { final LinkedList<Event> events = (LinkedList<Event>) Context.getCurrentContext() .getThreadLocal(KEY_CURRENT_EVENT); if (events != null && !events.isEmpty() && events.getLast() instanceof MouseEvent) { return (MouseEvent) events.getLast(); } return null; }
/** * Returns the mouse event currently firing, or {@code null} if no mouse event is being processed. * @return the mouse event currently firing */ @SuppressWarnings("unchecked") public static MouseEvent getCurrentMouseEvent() { final Context context = Context.getCurrentContext(); if (context != null) { final LinkedList<Event> events = (LinkedList<Event>) context.getThreadLocal(KEY_CURRENT_EVENT); if (events != null && !events.isEmpty() && events.getLast() instanceof MouseEvent) { return (MouseEvent) events.getLast(); } } return null; }
/** * Returns the mouse event currently firing, or <tt>null</tt> if no mouse event is being processed. * @return the mouse event currently firing */ @SuppressWarnings("unchecked") public static MouseEvent getCurrentMouseEvent() { final LinkedList<Event> events = (LinkedList<Event>) Context.getCurrentContext() .getThreadLocal(KEY_CURRENT_EVENT); if (events != null && !events.isEmpty() && events.getLast() instanceof MouseEvent) { return (MouseEvent) events.getLast(); } return null; }
/** * Gets the scriptable used at starting scope for the execution of current script. * @return the scope as defined in {@link JavaScriptEngine#callFunction} * or {@link JavaScriptEngine#execute}. */ protected Scriptable getStartingScope() { @SuppressWarnings("unchecked") final Deque<Scriptable> stack = (Deque<Scriptable>) Context.getCurrentContext().getThreadLocal(JavaScriptEngine.KEY_STARTING_SCOPE); if (null == stack) { return null; } return stack.peek(); }
/** * Called when the event starts being fired. */ @SuppressWarnings("unchecked") public void startFire() { final Context context = Context.getCurrentContext(); LinkedList<Event> events = (LinkedList<Event>) context.getThreadLocal(KEY_CURRENT_EVENT); if (events == null) { events = new LinkedList<>(); context.putThreadLocal(KEY_CURRENT_EVENT, events); } events.add(this); }
/** * Called when the event starts being fired. */ @SuppressWarnings("unchecked") public void startFire() { final Context context = Context.getCurrentContext(); LinkedList<Event> events = (LinkedList<Event>) context.getThreadLocal(KEY_CURRENT_EVENT); if (events == null) { events = new LinkedList<>(); context.putThreadLocal(KEY_CURRENT_EVENT, events); } events.add(this); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void startFire() { LinkedList<Event> events = (LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT); if (events == null) { events = new LinkedList<Event>(); Context.getCurrentContext().putThreadLocal(KEY_CURRENT_EVENT, events); } events.add(this); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void startFire() { LinkedList<Event> events = (LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT); if (events == null) { events = new LinkedList<Event>(); Context.getCurrentContext().putThreadLocal(KEY_CURRENT_EVENT, events); } events.add(this); }
/** * Called when the event starts being fired */ @SuppressWarnings("unchecked") void startFire() { LinkedList<Event> events = (LinkedList<Event>) Context.getCurrentContext().getThreadLocal(KEY_CURRENT_EVENT); if (events == null) { events = new LinkedList<Event>(); Context.getCurrentContext().putThreadLocal(KEY_CURRENT_EVENT, events); } events.add(this); }