org.erights.e.elib.vat
Class AWTRunner

java.lang.Object
  |
  +--org.erights.e.elib.vat.Runner
        |
        +--org.erights.e.elib.vat.AWTRunner

final class AWTRunner
extends Runner


Field Summary
private static Object OUR_LOCK
           
private static AWTRunner THE_DEFAULT
           
 
Fields inherited from class org.erights.e.elib.vat.Runner
myOptServingVat, myServingTicket
 
Constructor Summary
private AWTRunner()
           
 
Method Summary
(package private)  void addDeadManSwitch(Object deadManSwitch)
          AWT doesn't shut down or merge, so do nothing.
(package private)  void disturbEvent(Throwable t)
          XXX Doesn't do anything, since I can't figure out how to get my hands on EventQueue.getDispatchThread(), which isn't public.
(package private)  Throwable enqueue(PendingEvent todo)
          Add todo to the queue my thread is servicing
(package private) static AWTRunner getDefault()
          Gets the one canonical AWTRunner.
(package private)  String getRunnerKind()
          What kind of Runner is this?
private static void initSwingLnF()
          I can't believe they didn't make platform l&f the default.
(package private) static boolean isAWTCurrent()
          Like AWTRunner.getDefault().isCurrent() except that it avoids doing a EventQueue.isDispatchThread() (or any other AWT operation) if no AWTRunner has yet been created.
(package private)  boolean isCurrent()
          Is the current thread this Runner's thread (the thread servicing this Vat)?
(package private)  void setPriority(int newPriority)
          XXX Doesn't do anything, since I can't figure out how to get my hands on EventQueue.getDispatchThread(), which isn't public.
 String toString()
          Suppressed: Returns a string representation of the object.
 
Methods inherited from class org.erights.e.elib.vat.Runner
getCurrentRunner, getOptCurrentRunner, getOptEStack, getOptServingVat, obtainRunner, obtainRunner, popEStackItem, pushEStackItem, requireCurrent, servingTicket, shorten
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OUR_LOCK

private static final Object OUR_LOCK

THE_DEFAULT

private static AWTRunner THE_DEFAULT
Constructor Detail

AWTRunner

private AWTRunner()
Method Detail

initSwingLnF

private static void initSwingLnF()
I can't believe they didn't make platform l&f the default.


getDefault

static AWTRunner getDefault()
Gets the one canonical AWTRunner.

The Runner is created the first time this is called. At that time, the look-n-feel is set according to the System properties.


isAWTCurrent

static boolean isAWTCurrent()
Like AWTRunner.getDefault().isCurrent() except that it avoids doing a EventQueue.isDispatchThread() (or any other AWT operation) if no AWTRunner has yet been created.

Believe it or not, this is the key to getting SWT working on Linux. On Linux, once an AWT operation has been invoked (or, at least, this one), then SWT no longer seems to be able to work. This seems to correspond to the SWT documentation.


isCurrent

boolean isCurrent()
Description copied from class: Runner
Is the current thread this Runner's thread (the thread servicing this Vat)?

If it is, we say we are executing inside this Runner.

r.isCurrent() implies Runner.getCurrentRunner() == r.

Specified by:
isCurrent in class Runner

toString

public String toString()
Description copied from class: Object
Suppressed: Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Object
Returns:
a string representation of the object.

setPriority

void setPriority(int newPriority)
XXX Doesn't do anything, since I can't figure out how to get my hands on EventQueue.getDispatchThread(), which isn't public.

Note that this is about the thread's priority, and not the AWT notion of priority among events within a thread.

Specified by:
setPriority in class Runner

disturbEvent

void disturbEvent(Throwable t)
XXX Doesn't do anything, since I can't figure out how to get my hands on EventQueue.getDispatchThread(), which isn't public.

Specified by:
disturbEvent in class Runner

getRunnerKind

String getRunnerKind()
Description copied from class: Runner
What kind of Runner is this?

A kind of Runner determines which kind of "devices" (eg, AWT or SWT widgets) may be synchronously accessed from within this Runner

Specified by:
getRunnerKind in class Runner
Returns:
"awt"

enqueue

Throwable enqueue(PendingEvent todo)
Description copied from class: Runner
Add todo to the queue my thread is servicing

Specified by:
enqueue in class Runner

addDeadManSwitch

void addDeadManSwitch(Object deadManSwitch)
AWT doesn't shut down or merge, so do nothing.

Specified by:
addDeadManSwitch in class Runner


comments?