|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.j2s.ajax.AClass
net.sf.j2s.ajax.ASWTClass
This class is designed to load class asynchronously within the same thread of given Shell or Display. Because executing callback after given class is loaded will be in another thread scope of current Display. In order to avoid nasty codes of such
Display.getDefault().asyncExec(new Runnable() { public void run() { //... } });This class ASWTClass is designed so developer won't need to code in such nasty way. Just call
ASWTClass#swtLoad
with the same
parameter as AClass#load
. Or call ASWTClass#shellLoad
or ASWTClass#displayLoad
with extra Shell/Display argument.
Method Summary | |
static void |
displayLoad(org.eclipse.swt.widgets.Display display,
java.lang.String clazzName,
java.lang.Runnable afterLoaded)
Load class asynchronously and execute callback in the same thread of given Display's thread. |
static void |
shellLoad(org.eclipse.swt.widgets.Shell shell,
java.lang.String clazzName,
java.lang.Runnable afterLoaded)
Load class asynchronously and execute callback in the same thread of given Shell's Display. |
static void |
swtLoad(java.lang.String clazzName,
java.lang.Runnable afterLoaded)
Load class by given class name and execute callback in the same thread of default Display's thread. |
Methods inherited from class net.sf.j2s.ajax.AClass |
load |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void swtLoad(java.lang.String clazzName, java.lang.Runnable afterLoaded)
clazzName
- String given class name.afterLoaded
- Runnable given callback. If this parameter is an
instance of ARunnable
, the callback will receive the
loaded class automatically.public static void displayLoad(org.eclipse.swt.widgets.Display display, java.lang.String clazzName, java.lang.Runnable afterLoaded)
display
- Display given displayclazzName
- String given class name.afterLoaded
- Runnable given callback. If this parameter is an
instance of ARunnable
, the callback will receive the
loaded class automatically.public static void shellLoad(org.eclipse.swt.widgets.Shell shell, java.lang.String clazzName, java.lang.Runnable afterLoaded)
shell
- Shell given shellclazzName
- String given class name.afterLoaded
- Runnable given callback. If this parameter is an
instance of ARunnable
, the callback will receive the
loaded class automatically.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |