src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java

Print this page

        

*** 148,157 **** --- 148,161 ---- }); } }); } + public static LWCToolkit getLWCToolkit() { + return (LWCToolkit)Toolkit.getDefaultToolkit(); + } + @Override protected PlatformWindow createPlatformWindow(PeerType peerType) { if (peerType == PeerType.EMBEDDEDFRAME) { return new CPlatformEmbeddedFrame(); } else {
*** 405,415 **** public int getNumberOfButtons(){ return BUTTONS; } - @Override public boolean isTraySupported() { return true; } --- 409,418 ----
*** 487,496 **** --- 490,515 ---- }}}, c); } catch (Exception e) { e.printStackTrace(); } synchronized(ret) { return ret[0]; } } + /** + * Just a wrapper for LWCToolkit.invokeAndWait. Posts an empty event to the + * appropriate event queue and waits for it to finish. + */ + public static void flushPendingEventsOnAppkit(final Component component) { + try { + invokeAndWait(new Runnable() { + @Override + public void run() { + } + }, component); + } catch (Exception e) { + e.printStackTrace(); + } + } + // 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 CInvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop public static void invokeAndWait(Runnable event, Component component) throws InterruptedException, InvocationTargetException {