private static void writeCloseListener(final Shell shell) throws IOException {
   //    JSWriter writer = JSWriter.getWriterFor( shell );
   Boolean newValue = Boolean.valueOf(ShellEvent.hasListener(shell));
   Boolean defValue = Boolean.FALSE;
   //    writer.set( PROP_SHELL_LISTENER, "hasShellListener", newValue, defValue );
   boolean hasChanged = WidgetLCAUtil.hasChanged(shell, PROP_SHELL_LISTENER, newValue, defValue);
   if (hasChanged) {
     IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(shell);
     if (newValue.booleanValue()) {
       synchronizer.addListener("closelistener");
     } else {
       synchronizer.removeListener("closelistener");
     }
   }
 }
 static String getLibraryName(String mozillaPath) {
   /*
    * The name of the Gecko library to glue to changed between the XULRunner 10 and
    * 24 releases.  However it's not possible to programmatically know the version
    * of a XULRunner that's being used before it has been glued.  To determine the
    * appropriate Gecko library name to return, look for the presence of an "xpcom"
    * library in the mozilla path, which is present in all supported XULRunner releases
    * prior to XULRunner 24.  If this library is there then return it, and if it's not
    * there then assume that XULRunner 24 is being used and return the new library name
    * instead ("xul").
    */
   if (IsXULRunner24 == null) {
       /* IsXULRunner24 not yet initialized */
     IsXULRunner24 = new File(mozillaPath, LIB_XPCOM).exists() ? Boolean.FALSE : Boolean.TRUE;
   }
   return IsXULRunner24.booleanValue() ? LIB_XUL : LIB_XPCOM;
 }