Eclipse Rich Ajax Platform

org.eclipse.rwt.lifecycle
Class ControlLCAUtil

java.lang.Object
  extended by org.eclipse.rwt.lifecycle.ControlLCAUtil

public class ControlLCAUtil
extends java.lang.Object

Utility class that provides a number of useful static methods to support the implementation of life cycle adapters for Controls.

Since:
1.0
See Also:
WidgetLCAUtil

Method Summary
static int getZIndex(Control control)
          Determines the z-index to render for a given control.
static void preserveBackgroundImage(Control control)
          Preserves the value of the specified widget's background image.
static void preserveMenuDetectListener(Control control)
          Preserves whether the given widget has one or more MenuDetects attached.
static void preserveValues(Control control)
          Preserves the values of the following properties of the specified control: bounds z-index (except for Shells) tab index tool tip text menu visible enabled foreground background background image font cursor whether ControlListeners are registered whether ActivateListeners are registered whether MouseListeners are registered whether FocusListeners are registered whether KeyListeners are registered whether TraverseListeners are registered whether HelpListeners are registered whether MenuDetectListeners are registered
static void processKeyEvents(Control control)
           
static void processMenuDetect(Control control)
          Process a HelpEvent if the current request specifies that there occured a help event for the given widget.
static void processMouseEvents(Control control)
           
static void processSelection(Widget widget, Item item, boolean readBounds)
           
static void readBounds(Control control)
          Reads the bounds of the specified control from the current request and applies it to the control.
static void renderBackground(Control control)
          Determines whether the property background of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side background property.
static void renderBackgroundImage(Control control)
          Determines whether the background image of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side background image property.
static void renderBounds(Control control)
          Determines whether the bounds of the given control have changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side bounds.
static void renderChanges(Control control)
          Determines for all of the following properties of the specified control whether the property has changed during the processing of the current request and if so, writes a protocol message to the response that updates the corresponding client-side property.
static void renderEnabled(Control control)
          Determines whether the property enabled of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side enabled property.
static void renderFont(Control control)
          Determines whether the property font of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side font property.
static void renderForeground(Control control)
          Determines whether the property foreground of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side foreground property.
static void renderListenActivate(Control control)
           
static void renderListenMenuDetect(Control control)
          Adds or removes client-side menu detect listeners for the the given control as necessary.
static void renderMenu(Control control)
          Determines whether the property menu of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side menu property.
static void renderTabIndex(Control control)
           
static void renderToolTip(Control control)
          Determines whether the tool tip of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side tool tip.
static void renderVisible(Control control)
          Determines whether the visibility of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side visibility.
static void renderZIndex(Control control)
          Determines whether the z-index of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side z-index.
static void writeActivateListener(Control control)
           
static void writeBackground(Control control)
          Determines whether the property background of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side background property.
static void writeBackgroundImage(Control control)
          Determines whether the background image of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side background image property.
static void writeBounds(Control control)
          Determines whether the bounds of the given control have changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side bounds.
static void writeChanges(Control control)
          Determines for all of the following properties of the specified control whether the property has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the corresponding client-side property.
static void writeEnabled(Control control)
          Determines whether the property enabled of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side enabled property.
static void writeFont(Control control)
          Determines whether the property font of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side font property.
static void writeForeground(Control control)
          Determines whether the property foreground of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side foreground property.
static void writeMenu(Control control)
          Determines whether the property menu of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side menu property.
static void writeMenuDetectListener(Control control)
          Adds or removes client-side menu detect listeners for the the given control as necessary.
static void writeStyleFlags(Control control)
          Checks the given control for common SWT style flags (e.g.
static void writeToolTip(Control control)
          Determines whether the tool tip of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side tool tip.
static void writeVisible(Control control)
          Determines whether the visibility of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side visibility.
static void writeZIndex(Control control)
          Determines whether the z-index of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side z-index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

preserveValues

public static void preserveValues(Control control)
Preserves the values of the following properties of the specified control:

Parameters:
control - the control whose parameters to preserve
See Also:
writeChanges(Control)

preserveBackgroundImage

public static void preserveBackgroundImage(Control control)
Preserves the value of the specified widget's background image.

Parameters:
control - the control whose background image property to preserve
See Also:
writeBackgroundImage(Control)

preserveMenuDetectListener

public static void preserveMenuDetectListener(Control control)
Preserves whether the given widget has one or more MenuDetects attached.

Parameters:
control - the widget to preserve
Since:
1.3

readBounds

public static void readBounds(Control control)
Reads the bounds of the specified control from the current request and applies it to the control. If no bounds are not submitted for the control, it remains unchanged.

Parameters:
control - the control whose bounds to read and set

processMouseEvents

public static void processMouseEvents(Control control)

processKeyEvents

public static void processKeyEvents(Control control)

processSelection

public static void processSelection(Widget widget,
                                    Item item,
                                    boolean readBounds)

writeChanges

public static void writeChanges(Control control)
                         throws java.io.IOException
Determines for all of the following properties of the specified control whether the property has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the corresponding client-side property.

Parameters:
control - the control whose properties to set
Throws:
java.io.IOException
See Also:
preserveValues(Control)

renderChanges

public static void renderChanges(Control control)
                          throws java.io.IOException
Determines for all of the following properties of the specified control whether the property has changed during the processing of the current request and if so, writes a protocol message to the response that updates the corresponding client-side property.

Parameters:
control - the control whose properties to set
Throws:
java.io.IOException
See Also:
preserveValues(Control)

writeBounds

public static void writeBounds(Control control)
                        throws java.io.IOException
Determines whether the bounds of the given control have changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side bounds.

Parameters:
control - the control whose bounds to write
Throws:
java.io.IOException

renderBounds

public static void renderBounds(Control control)
                         throws java.io.IOException
Determines whether the bounds of the given control have changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side bounds.

Parameters:
control - the control whose bounds to write
Throws:
java.io.IOException

writeZIndex

public static void writeZIndex(Control control)
                        throws java.io.IOException
Determines whether the z-index of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side z-index.

Parameters:
control - the control whose z-index to write
Throws:
java.io.IOException

renderZIndex

public static void renderZIndex(Control control)
                         throws java.io.IOException
Determines whether the z-index of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side z-index.

Parameters:
control - the control whose z-index to write
Throws:
java.io.IOException

renderTabIndex

public static void renderTabIndex(Control control)

writeToolTip

public static void writeToolTip(Control control)
                         throws java.io.IOException
Determines whether the tool tip of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side tool tip.

Parameters:
control - the control whose tool tip to write
Throws:
java.io.IOException

renderToolTip

public static void renderToolTip(Control control)
                          throws java.io.IOException
Determines whether the tool tip of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side tool tip.

Parameters:
control - the control whose tool tip to write
Throws:
java.io.IOException

writeMenu

public static void writeMenu(Control control)
                      throws java.io.IOException
Determines whether the property menu of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side menu property.

Parameters:
control - the control whose menu property to write
Throws:
java.io.IOException

renderMenu

public static void renderMenu(Control control)
                       throws java.io.IOException
Determines whether the property menu of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side menu property.

Parameters:
control - the control whose menu property to write
Throws:
java.io.IOException

writeVisible

public static void writeVisible(Control control)
                         throws java.io.IOException
Determines whether the visibility of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side visibility.

Parameters:
control - the control whose visibility to write
Throws:
java.io.IOException

renderVisible

public static void renderVisible(Control control)
                          throws java.io.IOException
Determines whether the visibility of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side visibility.

Parameters:
control - the control whose visibility to write
Throws:
java.io.IOException

writeEnabled

public static void writeEnabled(Control control)
                         throws java.io.IOException
Determines whether the property enabled of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side enabled property.

Parameters:
control - the control whose enabled property to write
Throws:
java.io.IOException

renderEnabled

public static void renderEnabled(Control control)
                          throws java.io.IOException
Determines whether the property enabled of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side enabled property.

Parameters:
control - the control whose enabled property to write
Throws:
java.io.IOException

writeForeground

public static void writeForeground(Control control)
                            throws java.io.IOException
Determines whether the property foreground of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side foreground property.

Parameters:
control - the control whose foreground property to write
Throws:
java.io.IOException

renderForeground

public static void renderForeground(Control control)
                             throws java.io.IOException
Determines whether the property foreground of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side foreground property.

Parameters:
control - the control whose foreground property to write
Throws:
java.io.IOException

writeBackground

public static void writeBackground(Control control)
                            throws java.io.IOException
Determines whether the property background of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side background property.

Parameters:
control - the control whose background property to write
Throws:
java.io.IOException

renderBackground

public static void renderBackground(Control control)
                             throws java.io.IOException
Determines whether the property background of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side background property.

Parameters:
control - the control whose background property to write
Throws:
java.io.IOException

writeBackgroundImage

public static void writeBackgroundImage(Control control)
                                 throws java.io.IOException
Determines whether the background image of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side background image property.

Parameters:
control - the control whose background image property to write
Throws:
java.io.IOException

renderBackgroundImage

public static void renderBackgroundImage(Control control)
                                  throws java.io.IOException
Determines whether the background image of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side background image property.

Parameters:
control - the control whose background image property to write
Throws:
java.io.IOException

writeFont

public static void writeFont(Control control)
                      throws java.io.IOException
Determines whether the property font of the given control has changed during the processing of the current request and if so, writes JavaScript code to the response that updates the client-side font property.

Parameters:
control - the control whose font property to write
Throws:
java.io.IOException

renderFont

public static void renderFont(Control control)
                       throws java.io.IOException
Determines whether the property font of the given control has changed during the processing of the current request and if so, writes a protocol message to the response that updates the client-side font property.

Parameters:
control - the control whose font property to write
Throws:
java.io.IOException

writeActivateListener

public static void writeActivateListener(Control control)
                                  throws java.io.IOException
Throws:
java.io.IOException

renderListenActivate

public static void renderListenActivate(Control control)

writeMenuDetectListener

public static void writeMenuDetectListener(Control control)
                                    throws java.io.IOException
Adds or removes client-side menu detect listeners for the the given control as necessary.

Parameters:
control -
Throws:
java.io.IOException
Since:
1.3

renderListenMenuDetect

public static void renderListenMenuDetect(Control control)
Adds or removes client-side menu detect listeners for the the given control as necessary.

Parameters:
control -
Since:
1.3

writeStyleFlags

public static void writeStyleFlags(Control control)
                            throws java.io.IOException
Checks the given control for common SWT style flags (e.g. SWT.BORDER) and if present, writes code to pass the according states to the client.

Parameters:
control -
Throws:
java.io.IOException

processMenuDetect

public static void processMenuDetect(Control control)
Process a HelpEvent if the current request specifies that there occured a help event for the given widget.

Parameters:
control - the control to process
Since:
1.3

getZIndex

public static int getZIndex(Control control)
Determines the z-index to render for a given control.

Parameters:
control - the control whose z-index is requested
Returns:
the z-index

Eclipse Rich Ajax Platform

Copyright (c) EclipseSource and others 2002, 2011. All rights reserved.