1 11 package org.eclipse.help.internal.base; 12 13 import java.lang.reflect.*; 14 15 import org.eclipse.core.runtime.*; 16 import org.osgi.framework.*; 17 18 22 public class DisplayUtils { 23 private static final String HELP_UI_PLUGIN_ID = "org.eclipse.help.ui"; private static final String LOOP_CLASS_NAME = "org.eclipse.help.ui.internal.HelpUIEventLoop"; 26 static void runUI() { 27 invoke("run"); } 29 static void wakeupUI() { 30 invoke("wakeup"); } 32 33 static void waitForDisplay() { 34 invoke("waitFor"); } 36 37 private static void invoke(String method) { 38 try { 39 Bundle bundle = Platform.getBundle(HELP_UI_PLUGIN_ID); 40 if (bundle == null) { 41 return; 42 } 43 Class c = bundle.loadClass(LOOP_CLASS_NAME); 44 Method m = c.getMethod(method, new Class []{}); 45 m.invoke(null, new Object []{}); 46 } catch (Exception e) { 47 } 48 } 49 } 50 | Popular Tags |