java.awt.event.InvocationEvent Java Examples

The following examples show how to use java.awt.event.InvocationEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WEmbeddedFrame.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(final boolean activate) {
    if (!activate || EventQueue.isDispatchThread()) {
        ((WFramePeer)getPeer()).emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                ((WFramePeer)getPeer()).emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #2
Source File: WComponentPeer.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void replaceSurfaceDataLater() {
    Runnable r = new Runnable() {
        public void run() {
            // Shouldn't do anything if object is disposed in meanwhile
            // No need for sync as disposeAction in Window is performed
            // on EDT
            if (!isDisposed()) {
                try {
                    replaceSurfaceData();
                } catch (InvalidPipeException e) {
                    // REMIND : what do we do if our surface creation failed?
                }
            }
        }
    };
    Component c = (Component)target;
    // Fix 6255371.
    if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) {
        postEvent(new InvocationEvent(c, r));
    }
}
 
Example #3
Source File: LWCToolkit.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Checks if there's an active SelectorPerformer corresponding to the invocation's AppContext,
 * adds the invocation to the SelectorPerformer's queue and returns true.
 * Otherwise does nothing and returns false.
 */
public static boolean offer(InvocationEvent invocation) {
    Object source = invocation.getSource();

    SelectorPerformer performer = (source instanceof Component) ?
            getInstance((Component)source) :
            getInstance(Toolkit.getDefaultToolkit().getSystemEventQueue());

    if (performer == null) return false;

    synchronized (performer.invocations) {
        if (!performer.invocations.isEmpty()) {
            performer.invocations.peek().add(invocation);
            return true;
        }
    }
    return false;
}
 
Example #4
Source File: WEmbeddedFrame.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(final boolean activate) {
    if (!activate || EventQueue.isDispatchThread()) {
        ((WFramePeer)getPeer()).emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                ((WFramePeer)getPeer()).emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #5
Source File: WEmbeddedFrame.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(final boolean activate) {
    if (!activate || EventQueue.isDispatchThread()) {
        ((WFramePeer)getPeer()).emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                ((WFramePeer)getPeer()).emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #6
Source File: WEmbeddedFrame.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void synthesizeWindowActivation(final boolean activate) {
    final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this);
    if (!activate || EventQueue.isDispatchThread()) {
        peer.emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                peer.emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #7
Source File: WComponentPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void replaceSurfaceDataLater() {
    Runnable r = new Runnable() {
        @Override
        public void run() {
            // Shouldn't do anything if object is disposed in meanwhile
            // No need for sync as disposeAction in Window is performed
            // on EDT
            if (!isDisposed()) {
                try {
                    replaceSurfaceData();
                } catch (InvalidPipeException e) {
                    // REMIND : what do we do if our surface creation failed?
                }
            }
        }
    };
    Component c = (Component)target;
    // Fix 6255371.
    if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) {
        postEvent(new InvocationEvent(c, r));
    }
}
 
Example #8
Source File: WEmbeddedFrame.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(final boolean activate) {
    if (!activate || EventQueue.isDispatchThread()) {
        ((WFramePeer)getPeer()).emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                ((WFramePeer)getPeer()).emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #9
Source File: WEmbeddedFrame.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(final boolean activate) {
    if (!activate || EventQueue.isDispatchThread()) {
        ((WFramePeer)getPeer()).emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                ((WFramePeer)getPeer()).emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #10
Source File: LWCToolkit.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void invokeLater(Runnable event, Component component)
        throws InvocationTargetException {
    final InvocationEvent invocationEvent =
            new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event);

    if (component != null) {
        final AppContext appContext = SunToolkit.targetToAppContext(component);
        SunToolkit.postEvent(appContext, invocationEvent);

        // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
        SunToolkit.flushPendingEvents(appContext);
    } else {
        // This should be the equivalent to EventQueue.invokeAndWait
        ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent);
    }

    final Throwable eventException = invocationEvent.getException();
    if (eventException == null) return;

    if (eventException instanceof UndeclaredThrowableException) {
        throw new InvocationTargetException(((UndeclaredThrowableException)eventException).getUndeclaredThrowable());
    }
    throw new InvocationTargetException(eventException);
}
 
Example #11
Source File: LWCToolkit.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public static void invokeLater(Runnable event, Component component)
        throws InvocationTargetException {
    final InvocationEvent invocationEvent =
            new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event);

    if (component != null) {
        final AppContext appContext = SunToolkit.targetToAppContext(component);
        SunToolkit.postEvent(appContext, invocationEvent);

        // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
        SunToolkit.flushPendingEvents(appContext);
    } else {
        // This should be the equivalent to EventQueue.invokeAndWait
        ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent);
    }

    final Throwable eventException = invocationEvent.getException();
    if (eventException == null) return;

    if (eventException instanceof UndeclaredThrowableException) {
        throw new InvocationTargetException(((UndeclaredThrowableException)eventException).getUndeclaredThrowable());
    }
    throw new InvocationTargetException(eventException);
}
 
Example #12
Source File: WEmbeddedFrame.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(final boolean activate) {
    if (!activate || EventQueue.isDispatchThread()) {
        ((WFramePeer)getPeer()).emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                ((WFramePeer)getPeer()).emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #13
Source File: WEmbeddedFrame.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(final boolean activate) {
    if (!activate || EventQueue.isDispatchThread()) {
        ((WFramePeer)getPeer()).emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                ((WFramePeer)getPeer()).emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #14
Source File: WComponentPeer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void replaceSurfaceDataLater() {
    Runnable r = new Runnable() {
        @Override
        public void run() {
            // Shouldn't do anything if object is disposed in meanwhile
            // No need for sync as disposeAction in Window is performed
            // on EDT
            if (!isDisposed()) {
                try {
                    replaceSurfaceData();
                } catch (InvalidPipeException e) {
                    // REMIND : what do we do if our surface creation failed?
                }
            }
        }
    };
    Component c = (Component)target;
    // Fix 6255371.
    if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) {
        postEvent(new InvocationEvent(c, r));
    }
}
 
Example #15
Source File: WComponentPeer.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void replaceSurfaceDataLater() {
    Runnable r = new Runnable() {
        public void run() {
            // Shouldn't do anything if object is disposed in meanwhile
            // No need for sync as disposeAction in Window is performed
            // on EDT
            if (!isDisposed()) {
                try {
                    replaceSurfaceData();
                } catch (InvalidPipeException e) {
                    // REMIND : what do we do if our surface creation failed?
                }
            }
        }
    };
    Component c = (Component)target;
    // Fix 6255371.
    if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) {
        postEvent(new InvocationEvent(c, r));
    }
}
 
Example #16
Source File: WComponentPeer.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void replaceSurfaceDataLater() {
    Runnable r = new Runnable() {
        @Override
        public void run() {
            // Shouldn't do anything if object is disposed in meanwhile
            // No need for sync as disposeAction in Window is performed
            // on EDT
            if (!isDisposed()) {
                try {
                    replaceSurfaceData();
                } catch (InvalidPipeException e) {
                    // REMIND : what do we do if our surface creation failed?
                }
            }
        }
    };
    Component c = (Component)target;
    // Fix 6255371.
    if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) {
        postEvent(new InvocationEvent(c, r));
    }
}
 
Example #17
Source File: WEmbeddedFrame.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(final boolean activate) {
    if (!activate || EventQueue.isDispatchThread()) {
        ((WFramePeer)getPeer()).emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                ((WFramePeer)getPeer()).emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #18
Source File: LWCToolkit.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void invokeLater(Runnable event, Component component)
        throws InvocationTargetException {
    final InvocationEvent invocationEvent =
            new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event);

    if (component != null) {
        final AppContext appContext = SunToolkit.targetToAppContext(component);
        SunToolkit.postEvent(appContext, invocationEvent);

        // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
        SunToolkit.flushPendingEvents(appContext);
    } else {
        // This should be the equivalent to EventQueue.invokeAndWait
        ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent);
    }

    final Throwable eventException = invocationEvent.getException();
    if (eventException == null) return;

    if (eventException instanceof UndeclaredThrowableException) {
        throw new InvocationTargetException(((UndeclaredThrowableException)eventException).getUndeclaredThrowable());
    }
    throw new InvocationTargetException(eventException);
}
 
Example #19
Source File: WComponentPeer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void replaceSurfaceDataLater() {
    Runnable r = new Runnable() {
        @Override
        public void run() {
            // Shouldn't do anything if object is disposed in meanwhile
            // No need for sync as disposeAction in Window is performed
            // on EDT
            if (!isDisposed()) {
                try {
                    replaceSurfaceData();
                } catch (InvalidPipeException e) {
                    // REMIND : what do we do if our surface creation failed?
                }
            }
        }
    };
    Component c = (Component)target;
    // Fix 6255371.
    if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) {
        postEvent(new InvocationEvent(c, r));
    }
}
 
Example #20
Source File: WEmbeddedFrame.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(final boolean activate) {
    if (!activate || EventQueue.isDispatchThread()) {
        ((WFramePeer)getPeer()).emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                ((WFramePeer)getPeer()).emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
Example #21
Source File: LWCToolkit.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void invokeLater(Runnable event, Component component)
        throws InvocationTargetException {
    final InvocationEvent invocationEvent =
            new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event);

    if (component != null) {
        final AppContext appContext = SunToolkit.targetToAppContext(component);
        SunToolkit.postEvent(appContext, invocationEvent);

        // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
        SunToolkit.flushPendingEvents(appContext);
    } else {
        // This should be the equivalent to EventQueue.invokeAndWait
        ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent);
    }

    final Throwable eventException = invocationEvent.getException();
    if (eventException == null) return;

    if (eventException instanceof UndeclaredThrowableException) {
        throw new InvocationTargetException(((UndeclaredThrowableException)eventException).getUndeclaredThrowable());
    }
    throw new InvocationTargetException(eventException);
}
 
Example #22
Source File: XDecoratedPeer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void handleWindowFocusIn(long serial) {
    if (null == actualFocusedWindow) {
        super.handleWindowFocusIn(serial);
    } else {
        /*
         * Fix for 6314575.
         * If this is a result of clicking on one of the Frame's component
         * then 'actualFocusedWindow' shouldn't be focused. A decision of focusing
         * it or not should be made after the appropriate Java mouse event (if any)
         * is handled by the component where 'actualFocusedWindow' value may be reset.
         *
         * The fix is based on the empiric fact consisting in that the component
         * receives native mouse event nearly at the same time the Frame receives
         * WM_TAKE_FOCUS (when FocusIn is generated via XSetInputFocus call) but
         * definetely before the Frame gets FocusIn event (when this method is called).
         */
        postEvent(new InvocationEvent(target, new Runnable() {
            public void run() {
                XWindowPeer fw = null;
                synchronized (getStateLock()) {
                    fw = actualFocusedWindow;
                    actualFocusedWindow = null;
                    if (null == fw || !fw.isVisible() || !fw.isFocusableWindow()) {
                        fw = XDecoratedPeer.this;
                    }
                }
                fw.handleWindowFocusIn_Dispatch();
            }
        }));
    }
}
 
Example #23
Source File: LWCToolkit.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Kicks an event over to the appropriate eventqueue and waits for it to
 * finish To avoid deadlocking, we manually run the NSRunLoop while waiting
 * Any selector invoked using ThreadUtilities performOnMainThread will be
 * processed in doAWTRunLoop The InvocationEvent will call
 * LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual
 * runloop Does not dispatch native events while in the loop
 */
public static void invokeAndWait(Runnable runnable, Component component)
        throws InvocationTargetException {
    final long mediator = createAWTRunLoopMediator();

    InvocationEvent invocationEvent =
            new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(),
                    runnable,
                    () -> {
                        if (mediator != 0) {
                            stopAWTRunLoop(mediator);
                        }
                    },
                    true);

    if (component != null) {
        AppContext appContext = SunToolkit.targetToAppContext(component);
        SunToolkit.postEvent(appContext, invocationEvent);

        // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
        SunToolkit.flushPendingEvents(appContext);
    } else {
        // This should be the equivalent to EventQueue.invokeAndWait
        ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent);
    }

    doAWTRunLoop(mediator, false);

    Throwable eventException = invocationEvent.getException();
    if (eventException != null) {
        if (eventException instanceof UndeclaredThrowableException) {
            eventException = ((UndeclaredThrowableException)eventException).getUndeclaredThrowable();
        }
        throw new InvocationTargetException(eventException);
    }
}
 
Example #24
Source File: ExecutableInputMethodManager.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private void showInputMethodMenuOnRequesterEDT(Component requester)
    throws InterruptedException, InvocationTargetException {

    if (requester == null){
        return;
    }

    class AWTInvocationLock {}
    Object lock = new AWTInvocationLock();

    InvocationEvent event =
            new InvocationEvent(requester,
                                new Runnable() {
                                    public void run() {
                                        showInputMethodMenu();
                                    }
                                },
                                lock,
                                true);

    AppContext requesterAppContext = SunToolkit.targetToAppContext(requester);
    synchronized (lock) {
        SunToolkit.postEvent(requesterAppContext, event);
        while (!event.isDispatched()) {
            lock.wait();
        }
    }

    Throwable eventThrowable = event.getThrowable();
    if (eventThrowable != null) {
        throw new InvocationTargetException(eventThrowable);
    }
}
 
Example #25
Source File: ExecutableInputMethodManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void showInputMethodMenuOnRequesterEDT(Component requester)
    throws InterruptedException, InvocationTargetException {

    if (requester == null){
        return;
    }

    class AWTInvocationLock {}
    Object lock = new AWTInvocationLock();

    InvocationEvent event =
            new InvocationEvent(requester,
                                new Runnable() {
                                    public void run() {
                                        showInputMethodMenu();
                                    }
                                },
                                lock,
                                true);

    AppContext requesterAppContext = SunToolkit.targetToAppContext(requester);
    synchronized (lock) {
        SunToolkit.postEvent(requesterAppContext, event);
        while (!event.isDispatched()) {
            lock.wait();
        }
    }

    Throwable eventThrowable = event.getThrowable();
    if (eventThrowable != null) {
        throw new InvocationTargetException(eventThrowable);
    }
}
 
Example #26
Source File: ExecutableInputMethodManager.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void showInputMethodMenuOnRequesterEDT(Component requester)
    throws InterruptedException, InvocationTargetException {

    if (requester == null){
        return;
    }

    class AWTInvocationLock {}
    Object lock = new AWTInvocationLock();

    InvocationEvent event =
            new InvocationEvent(requester,
                                new Runnable() {
                                    public void run() {
                                        showInputMethodMenu();
                                    }
                                },
                                lock,
                                true);

    AppContext requesterAppContext = SunToolkit.targetToAppContext(requester);
    synchronized (lock) {
        SunToolkit.postEvent(requesterAppContext, event);
        while (!event.isDispatched()) {
            lock.wait();
        }
    }

    Throwable eventThrowable = event.getThrowable();
    if (eventThrowable != null) {
        throw new InvocationTargetException(eventThrowable);
    }
}
 
Example #27
Source File: LWCToolkit.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void invokeAndWait(Runnable runnable, Component component) throws InvocationTargetException {
    final long mediator = createAWTRunLoopMediator();

    InvocationEvent invocationEvent =
            new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(),
                    runnable,
                    () -> {
                        if (mediator != 0) {
                            stopAWTRunLoop(mediator);
                        }
                    },
                    true);

    if (component != null) {
        AppContext appContext = SunToolkit.targetToAppContext(component);
        SunToolkit.postEvent(appContext, invocationEvent);

        // 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock
        SunToolkit.flushPendingEvents(appContext);
    } else {
        // This should be the equivalent to EventQueue.invokeAndWait
        ((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent);
    }

    doAWTRunLoop(mediator, false);

    Throwable eventException = invocationEvent.getException();
    if (eventException != null) {
        if (eventException instanceof UndeclaredThrowableException) {
            eventException = ((UndeclaredThrowableException)eventException).getUndeclaredThrowable();
        }
        throw new InvocationTargetException(eventException);
    }
}
 
Example #28
Source File: WComponentPeer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void disposeLater() {
    postEvent(new InvocationEvent(target, new Runnable() {
        @Override
        public void run() {
            dispose();
        }
    }));
}
 
Example #29
Source File: GlobalCursorManager.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void postIfNotPending(Component heavy, InvocationEvent in) {
    boolean shouldPost = false;
    synchronized (this) {
        if (!pending) {
            pending = shouldPost = true;
        }
    }
    if (shouldPost) {
        SunToolkit.postEvent(SunToolkit.targetToAppContext(heavy), in);
    }
}
 
Example #30
Source File: WComponentPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void disposeLater() {
    postEvent(new InvocationEvent(target, new Runnable() {
        @Override
        public void run() {
            dispose();
        }
    }));
}