Пример #1
0
 /**
  * Used to indicate whether of not we are running in an environment where GUI interaction is
  * available.
  *
  * <p>Note that this method is security checked and is not available to (for example) untrusted
  * applets. More specifically, if there is a security manager, its <code>checkPropertiesAccess
  * </code> method is called. This could result in a SecurityException.
  *
  * @param isGuiAvailable True if GUI interaction is available.
  * @exception SecurityException if a security manager exists and its <code>checkPropertiesAccess
  *     </code> method doesn't allow setting of system properties.
  * @see SecurityManager#checkPropertiesAccess
  */
 public static void setGuiAvailable(boolean isGuiAvailable) throws SecurityException {
   SecurityManager sm = System.getSecurityManager();
   if (sm != null) {
     sm.checkPropertiesAccess();
   }
   ThreadGroupContext.getContext().setGuiAvailable(isGuiAvailable);
 }
Пример #2
0
 /**
  * Determines whether beans can assume a GUI is available.
  *
  * @return True if we are running in an environment where beans can assume that an interactive GUI
  *     is available, so they can pop up dialog boxes, etc. This will normally return true in a
  *     windowing environment, and will normally return false in a server environment or if an
  *     application is running as part of a batch job.
  * @see Visibility
  */
 public static boolean isGuiAvailable() {
   return ThreadGroupContext.getContext().isGuiAvailable();
 }
Пример #3
0
 /**
  * Test if we are in design-mode.
  *
  * @return True if we are running in an application construction environment.
  * @see DesignMode
  */
 public static boolean isDesignTime() {
   return ThreadGroupContext.getContext().isDesignTime();
 }