com.creamtec.ajaxswing.gui
Class AjaxSwingUIManager

java.lang.Object
  extended by com.creamtec.ajaxswing.gui.AjaxSwingUIManager

public class AjaxSwingUIManager
extends java.lang.Object

Manages the UI elements such as windows and components. Maintains the information on the stack of windows (top to bottom) and provides various helper methods.


Field Summary
static int END_OPERATION_NEW_WINDOW
          Specifies taht the operation should be ended when a new window is displayed at the top (not an existing one moved to the top)
static int END_OPERATION_NEXT_WINDOW
          Specifies that the operation should be ended when there is a different top level window
static int END_OPERATION_NONE
          Specifies that the operation should not be ended by UI events
static int END_OPERATION_TITLED_WINDOW
          Specifies that the operation should be ended when a window with a certain title is shown
static java.lang.String[] JAVA_PACKAGE_NAMES
           
static boolean LFInstalled
           
static boolean undecorateFirstFrame
           
 
Constructor Summary
AjaxSwingUIManager(ClientAgent agent)
          Instantiates the manager for the given client agent
 
Method Summary
 void centerWindowIfNeeded(java.awt.Container window)
           
 void closeWindow(java.awt.Window window)
          Closes given window
 AjaxSwingInternalFrameListener getInternalFrameListener()
           
 java.util.List getTopWindows()
          Returns the top level window for this agent
 java.awt.Window getWindowInFocus()
          Returns the top level window for this agent
 java.lang.String getWindowInFocusTitle()
          Convenience method that returns the title of the top level window If there is no window or if the focused window is not Dialog or Frame returns null
 java.util.List getWindows()
           
static boolean hasCustomClasses(java.lang.Object[] list)
           
 void hideWindow(java.awt.Window window)
          Called by Window peer to indicate that a window is being hidden Removes the window from top of the window stack and processes window-related operations
 void init()
          Initializes the manager and installs a trap to prevent look and feel changes (they slow down the performance and can lead to various exceptions)
 void installLFTrap()
          Installs look and feel trap
static boolean isCustomClass(java.lang.String className)
           
static boolean isServerSideBrowsingEnabled(ClientAgent agent, java.awt.Container cont)
           
 void maximizeFrame(java.awt.Frame frame)
          Sets the window size to the maximim possible for the current browser window
 void preRenderWindows()
          Called after the emulation of the request is finished
 void resizeWindows()
          Updates sizes of maximized windows to match the client agent's current browser size
 void restoreFrame(java.awt.Frame frame)
          Sets the window size to the normal bounds for the current browser window
 void setEndOperationEvent(int eventCode)
          Sets code of the operation that needs to be executed when a window is closed See AjaxSwing documentation on how to configure and use operations
 void setEndOperationWindowTitle(java.lang.String windowTitle)
          Sets the title of the window that should trigger an operation
 void setInternalFrameListener(AjaxSwingInternalFrameListener internalFrameListener)
           
static boolean shouldRenderStandardFileOpenDialog(ClientAgent agent, java.awt.Container cont)
          Deprecated. Not used in v.4, replaced by isServerSideBrowsingEnabled(ClientAgent, Container)
 void showWindow(java.awt.Window window)
          Called by Window peer to indicate that a window is being shown.
 void shutdown()
          Disposes of all currently open windows
 void windowToBack(java.awt.Window window)
          Moves the given window to the bottom of the window stack
 void windowToFront(java.awt.Window window)
          Moves the given window on top of the window stack
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LFInstalled

public static boolean LFInstalled

undecorateFirstFrame

public static boolean undecorateFirstFrame

JAVA_PACKAGE_NAMES

public static java.lang.String[] JAVA_PACKAGE_NAMES

END_OPERATION_NONE

public static final int END_OPERATION_NONE
Specifies that the operation should not be ended by UI events

See Also:
Constant Field Values

END_OPERATION_NEXT_WINDOW

public static final int END_OPERATION_NEXT_WINDOW
Specifies that the operation should be ended when there is a different top level window

See Also:
Constant Field Values

END_OPERATION_NEW_WINDOW

public static final int END_OPERATION_NEW_WINDOW
Specifies taht the operation should be ended when a new window is displayed at the top (not an existing one moved to the top)

See Also:
Constant Field Values

END_OPERATION_TITLED_WINDOW

public static final int END_OPERATION_TITLED_WINDOW
Specifies that the operation should be ended when a window with a certain title is shown

See Also:
Constant Field Values
Constructor Detail

AjaxSwingUIManager

public AjaxSwingUIManager(ClientAgent agent)
                   throws java.lang.Exception
Instantiates the manager for the given client agent

Parameters:
agent - ClientAgent
Throws:
java.lang.Exception
Method Detail

init

public void init()
          throws java.lang.Exception
Initializes the manager and installs a trap to prevent look and feel changes (they slow down the performance and can lead to various exceptions)

Throws:
java.lang.Exception

getWindowInFocus

public java.awt.Window getWindowInFocus()
                                 throws java.lang.Exception
Returns the top level window for this agent

Returns:
Window
Throws:
java.lang.Exception

getTopWindows

public java.util.List getTopWindows()
                             throws java.lang.Exception
Returns the top level window for this agent

Returns:
Window
Throws:
java.lang.Exception

getWindows

public java.util.List getWindows()

resizeWindows

public void resizeWindows()
                   throws java.lang.Exception
Updates sizes of maximized windows to match the client agent's current browser size

Throws:
java.lang.Exception

maximizeFrame

public void maximizeFrame(java.awt.Frame frame)
Sets the window size to the maximim possible for the current browser window

Parameters:
frame -

restoreFrame

public void restoreFrame(java.awt.Frame frame)
Sets the window size to the normal bounds for the current browser window

Parameters:
frame -

showWindow

public void showWindow(java.awt.Window window)
Called by Window peer to indicate that a window is being shown. Stores the window on top of the window stack and processes window-related operations.

Parameters:
window - Window

centerWindowIfNeeded

public void centerWindowIfNeeded(java.awt.Container window)

hideWindow

public void hideWindow(java.awt.Window window)
Called by Window peer to indicate that a window is being hidden Removes the window from top of the window stack and processes window-related operations

Parameters:
window - Window

windowToFront

public void windowToFront(java.awt.Window window)
Moves the given window on top of the window stack

Parameters:
window - Window

windowToBack

public void windowToBack(java.awt.Window window)
Moves the given window to the bottom of the window stack

Parameters:
window - Window

closeWindow

public void closeWindow(java.awt.Window window)
Closes given window


shutdown

public void shutdown()
Disposes of all currently open windows


setEndOperationEvent

public void setEndOperationEvent(int eventCode)
Sets code of the operation that needs to be executed when a window is closed See AjaxSwing documentation on how to configure and use operations

Parameters:
eventCode - one of END_OPERATION_XXX constants

setEndOperationWindowTitle

public void setEndOperationWindowTitle(java.lang.String windowTitle)
Sets the title of the window that should trigger an operation

Parameters:
windowTitle - String

installLFTrap

public void installLFTrap()
                   throws java.lang.Exception
Installs look and feel trap

Throws:
java.lang.Exception

isServerSideBrowsingEnabled

public static boolean isServerSideBrowsingEnabled(ClientAgent agent,
                                                  java.awt.Container cont)
Returns:
true if the given FileChooser should browse the server machine for file open/save

shouldRenderStandardFileOpenDialog

public static boolean shouldRenderStandardFileOpenDialog(ClientAgent agent,
                                                         java.awt.Container cont)
Deprecated. Not used in v.4, replaced by isServerSideBrowsingEnabled(ClientAgent, Container)

Returns:
true if the given window should be rendered as a standard file open dialog with the view of the client machine for file upload

preRenderWindows

public void preRenderWindows()
                      throws java.lang.Exception
Called after the emulation of the request is finished

Throws:
java.lang.Exception

getWindowInFocusTitle

public java.lang.String getWindowInFocusTitle()
Convenience method that returns the title of the top level window If there is no window or if the focused window is not Dialog or Frame returns null

Returns:
String title or null

hasCustomClasses

public static boolean hasCustomClasses(java.lang.Object[] list)

isCustomClass

public static boolean isCustomClass(java.lang.String className)

getInternalFrameListener

public AjaxSwingInternalFrameListener getInternalFrameListener()

setInternalFrameListener

public void setInternalFrameListener(AjaxSwingInternalFrameListener internalFrameListener)


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