coreRuntime/src/sc/bind/BindingContext.java
public void queueEvent(int eventFlag, Object obj, IBeanMapper prop, IListener listener, Object eventDetail, CurrentScopeContext origCtx) {
      BindingEvent newEvent = new BindingEvent(eventFlag, obj, prop, listener, eventDetail, origCtx);
      BindingEvent oldEvent;
      BindingEvent prevEvent = null;

      synchronized (this) {
         for (oldEvent = queuedEvents; oldEvent != null; oldEvent = oldEvent.next) {
            double newPriority = newEvent.listener.getPriority();
            double oldPriority = oldEvent.listener.getPriority();
            // Higher priority numbers are at the top of the list - no need to check for dependencies in this case.   For the same priority, keep the order the same as when the events occurred.
            // It's particularly important that we deliver the invalidate event before the validate event.
            if (newPriority > oldPriority) {
               if (prevEvent == null) {
                  newEvent.next = queuedEvents;
                  queuedEvents = newEvent;
               }
               else {
                  newEvent.next = oldEvent;
                  prevEvent.next = newEvent;
               }
               break;
            }
            else if (newPriority == oldPriority) {
               if (newEvent.sameEvent(oldEvent)) {
                  if (Bind.trace)
                     Bind.logMessage("Ignoring duplicate event: ", obj, prop, eventDetail);
                  return;
               }
            }
            prevEvent = oldEvent;
         }
         if (Bind.trace)
            Bind.logMessage("Queuing event: ", obj, prop, eventDetail);

         if (oldEvent == null) {
            if (prevEvent == null) {
               newEvent.next = queuedEvents;
               queuedEvents = newEvent;
            }
            else {
               prevEvent.next = newEvent;
            }
         }
      }
   }
/*
   public static IListener.SyncType getCurrentDefaultSyncType() {
      BindingContext ctx = getBindingContext();
      // TODO: This should be set to IMMEDIATE by default so we can avoid the extra queuing step
      // at least for frameworks that don't need the queued behavior.  One option: BindSettings on the
      // base class.  Any bindings src'd on that class will pick up the default listener.  Add a new
      // option or flags arg to the bind call and propagate that through to make it easy to add new
      // flags.
      if (ctx == null)
         return IListener.SyncType.IMMEDIATE;
      else
         return ctx.getDefaultSyncType();
   }
   */
public static IListener.SyncType getCurrentDefaultSyncType() {
BindingContext ctx = getBindingContext();
TODO: This should be set to IMMEDIATE by default so we can avoid the extra queuing step
at least for frameworks that don't need the queued behavior.  One option: BindSettings on the
base class.  Any bindings src'd on that class will pick up the default listener.  Add a new
option or flags arg to the bind call and propagate that through to make it easy to add new
flags.
if (ctx == null)
return IListener.SyncType.IMMEDIATE;
else
return ctx.getDefaultSyncType();
}
public static IListener . SyncType getCurrentDefaultSyncType () { BindingContext ctx = getBindingContext () ; TODO : This should be set to IMMEDIATE by default so we can avoid the extra queuing step at least for frameworks that don ' t need the queued behavior . One option : BindSettings on the base class . Any bindings src ' d on that class will pick up the default listener . Add a new option or flags arg to the bind call and propagate that through to make it easy to add new flags . if ( ctx == null ) return IListener . SyncType . IMMEDIATE ; else return ctx . getDefaultSyncType () ; }
public void queueEvent(int eventFlag, Object obj, IBeanMapper prop, IListener listener, Object eventDetail, CurrentScopeContext origCtx) {
      BindingEvent newEvent = new BindingEvent(eventFlag, obj, prop, listener, eventDetail, origCtx);
      BindingEvent oldEvent;
      BindingEvent prevEvent = null;
      synchronized (this) {
         for (oldEvent = queuedEvents; oldEvent != null; oldEvent = oldEvent.next) {
            double newPriority = newEvent.listener.getPriority();
            double oldPriority = oldEvent.listener.getPriority();
            if (newPriority > oldPriority) {
               if (prevEvent == null) {
                  newEvent.next = queuedEvents;
                  queuedEvents = newEvent;
               }
               else {
                  newEvent.next = oldEvent;
                  prevEvent.next = newEvent;
               }
               break;
            }
            else if (newPriority == oldPriority) {
               if (newEvent.sameEvent(oldEvent)) {
                  if (Bind.trace)
                     Bind.logMessage("Ignoring duplicate event: ", obj, prop, eventDetail);
                  return;
               }
            }
            prevEvent = oldEvent;
         }
         if (Bind.trace)
            Bind.logMessage("Queuing event: ", obj, prop, eventDetail);
         if (oldEvent == null) {
            if (prevEvent == null) {
               newEvent.next = queuedEvents;
               queuedEvents = newEvent;
            }
            else {
               prevEvent.next = newEvent;
            }
         }
      }
   }
public void queueEvent ( int eventFlag , Object obj , IBeanMapper prop , IListener listener , Object eventDetail , CurrentScopeContext origCtx ) { BindingEvent newEvent = new BindingEvent ( eventFlag , obj , prop , listener , eventDetail , origCtx ) ; BindingEvent oldEvent ; BindingEvent prevEvent = null ; synchronized ( this ) { for ( oldEvent = queuedEvents ; oldEvent != null ; oldEvent = oldEvent . next ) { double newPriority = newEvent . listener . getPriority ( ) ; double oldPriority = oldEvent . listener . getPriority ( ) ; if ( newPriority > oldPriority ) { if ( prevEvent == null ) { newEvent . next = queuedEvents ; queuedEvents = newEvent ; } else { newEvent . next = oldEvent ; prevEvent . next = newEvent ; } break ; } else if ( newPriority == oldPriority ) { if ( newEvent . sameEvent ( oldEvent ) ) { if ( Bind . trace ) Bind . logMessage ( "Ignoring duplicate event: " , obj , prop , eventDetail ) ; return ; } } prevEvent = oldEvent ; } if ( Bind . trace ) Bind . logMessage ( "Queuing event: " , obj , prop , eventDetail ) ; if ( oldEvent == null ) { if ( prevEvent == null ) { newEvent . next = queuedEvents ; queuedEvents = newEvent ; } else { prevEvent . next = newEvent ; } } } }
public static IListener.SyncType getCurrentDefaultSyncType() {
BindingContext ctx = getBindingContext();
 TODO: This should be set to IMMEDIATE by default so we can avoid the extra queuing step
 at least for frameworks that don't need the queued behavior.
public static IListener . SyncType getCurrentDefaultSyncType () { BindingContext ctx = getBindingContext () ; TODO : This should be set to IMMEDIATE by default so we can avoid the extra queuing step at least for frameworks that don ' t need the queued behavior .
// Higher priority numbers are at the top of the list - no need to check for dependencies in this case.   For the same priority, keep the order the same as when the events occurred. // It's particularly important that we deliver the invalidate event before the validate event.