com.creamtec.ajaxswing

## Class AjaxSwingManager

- java.lang.Object
- - com.creamtec.ajaxswing.AjaxSwingManager

-     public class AjaxSwingManager
      extends java.lang.Object

  AjaxSwingManager is a helper class containing miscellaneous methods that provide simple means of integration with AjaxSwing system. Even though a typical application doesn't need to do anything to take advantage of AjaxSwing, in some cases where multithreading is used to perforam background operations or differed user interface updates AjaxSwing may render intermediate state of UI. In those cases the application programmer has 2 options. One is to remove multithreading or wait for other threads to complete in the event handling thread or main() method (e.g. using join). Second option is to explicitly mark the beginning and the end of the client operation taking control over the emulation and rendering process. First option does not require any integration with AjaxSwing. Second option will require the programmer to make a cal to AjaxSwingManager.beginOperation() from the main thread (main() function during startup or event handling routine) and AjaxSwingManager.endOperation() when the client operation is complete and the UI state is updated. Right after endOperation() call AjaxSwing will begin rendering of the topmost window. Even if cals to AjaxSwingManager methods have been made the application remains fully functional when run as a standalone Java application without AjaxSwing. AjaxSwingManager will check if AjaxSwing is currently active and if not, it will do nothing.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `beginOperation()` Marks the beginning of a complete sequence of steps letting AjaxSwing know that rendering of HTML page should be deferred until the application calls endOperation().
    `static void` | `endOperation()` Marks the end of a complete sequence of steps prompting AjaxSwing to begin rendering of the currently topmost window.
    `static void` | `endOperation(boolean endAfterNextModalDialog)` Marks after next modal dialog the end of a complete sequence of steps prompting AjaxSwing to begin rendering of the currently topmost window.
    `static AjaxSwingSessionListener` | `getAjaxSwingSessionListener()` Returns client session listener
    `static int` | `getClientId()` Allows the running application to determine the ID of the client that is using the application.
    `static java.util.HashMap` | `getRequestParameters()` Returns name-value pairs of parameters received with the HTTP request.
    `static boolean` | `isAjaxSwingRunning()` Returns true if AjaxSwing classes are in the classpath
    `static void` | `openInNewTab(java.lang.String url)` Opens URL in new tab
    `static void` | `setAjaxSwingSessionListener(AjaxSwingSessionListener sessionListener)` Sets client session listener that is called by AjaxSwing when a client session is created or destroyed

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### beginOperation

          public static void beginOperation()

      Marks the beginning of a complete sequence of steps letting AjaxSwing know that rendering of HTML page should be deferred until the application calls endOperation(). If the application is ran not through AjaxSwing, the method does nothing

    - #### endOperation

          public static void endOperation()

      Marks the end of a complete sequence of steps prompting AjaxSwing to begin rendering of the currently topmost window. If the application is ran not through AjaxSwing, the method does nothing

    - #### endOperation

          public static void endOperation(boolean endAfterNextModalDialog)

      Marks after next modal dialog the end of a complete sequence of steps prompting AjaxSwing to begin rendering of the currently topmost window. If the application is ran not through AjaxSwing, the method does nothing

    - #### openInNewTab

          public static void openInNewTab(java.lang.String url)

      Opens URL in new tab

    - #### getClientId

          public static int getClientId()

      Allows the running application to determine the ID of the client that is using the application. It especially is useful for Shared execution mode when multiple users share a JVM. The IDs can be used for instance as hash values the singleton pattern. For example, if you used to have a singleton class Client with a method getInstance() that would return the shared instance, you can change the implementation of getInstance() to maintain a hashtable of all instances and use AjaxSwingManager.getClientId() as a hash value. If the client identity can not be established, the method returns 0. This can happen if you are using mutliple threads or if AjaxSwing is not currently running

    - #### isAjaxSwingRunning

          public static boolean isAjaxSwingRunning()

      Returns true if AjaxSwing classes are in the classpath

    - #### getRequestParameters

          public static java.util.HashMap getRequestParameters()

      Returns name-value pairs of parameters received with the HTTP request. Can be called only during an active request emulation

    - #### setAjaxSwingSessionListener

          public static void setAjaxSwingSessionListener(AjaxSwingSessionListener sessionListener)

      Sets client session listener that is called by AjaxSwing when a client session is created or destroyed

    - #### getAjaxSwingSessionListener

          public static AjaxSwingSessionListener getAjaxSwingSessionListener()

      Returns client session listener

Copyright © 2000-2012 CreamTec LLC. All Rights Reserved.