IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.rcp.xui
Class Util

java.lang.Object
  extended by com.ibm.btt.rcp.xui.Util

public abstract class Util
extends java.lang.Object

XUI Utility class


Constructor Summary
Util()
           
 
Method Summary
static void arrangeTabIndex(IXUIComposite composite)
          Arrange tabIndex of XUIWidgets in specified XUIComposite NOTE: not present Follow default behavior of element.
static void clearComposite(org.eclipse.swt.widgets.Composite composite)
          Dispose all children of specified composite
static int convertStyle(java.lang.String value)
          Convert string style to SWT int style
static java.util.List<java.lang.Class<?>> getAllInterfaces(java.lang.Class<?> target)
          Get all interfaces that target class implemented.
static IXUIWidget getXUIWidget(org.eclipse.swt.widgets.Widget widget)
          Get XUI widget instance from wrapped SWT widget using widget.getData()
static boolean isNullString(java.lang.String string)
          Check if param is empty string
static boolean isSubClass(java.lang.Class<?> parentClass, java.lang.Class<?> subClass)
          Justify if parentClass is the super class or interface for subClass
static boolean isValidPathProtocol(java.lang.String path)
          Justify if current path is valid protocol, a valid path should be start with jar:///, file:///, http://, ftp:// or any other URL protocol.
static boolean keyStrokeMatch(org.eclipse.swt.events.KeyEvent e, java.lang.String shortcutStr)
          This function is see whether the key stroke matches the short cut string definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

isNullString

public static boolean isNullString(java.lang.String string)
Check if param is empty string

Parameters:
string -
Returns:
if param is empty string

convertStyle

public static int convertStyle(java.lang.String value)
Convert string style to SWT int style

Parameters:
value -
Returns:

getXUIWidget

public static IXUIWidget getXUIWidget(org.eclipse.swt.widgets.Widget widget)
Get XUI widget instance from wrapped SWT widget using widget.getData()

Parameters:
widget -
Returns:

isSubClass

public static boolean isSubClass(java.lang.Class<?> parentClass,
                                 java.lang.Class<?> subClass)
Justify if parentClass is the super class or interface for subClass

Parameters:
parentClass -
subClass -
Returns:

clearComposite

public static void clearComposite(org.eclipse.swt.widgets.Composite composite)
Dispose all children of specified composite

Parameters:
composite -

getAllInterfaces

public static java.util.List<java.lang.Class<?>> getAllInterfaces(java.lang.Class<?> target)
Get all interfaces that target class implemented.

Parameters:
target -
Returns:

arrangeTabIndex

public static void arrangeTabIndex(IXUIComposite composite)
Arrange tabIndex of XUIWidgets in specified XUIComposite

NOTE:

  • not present Follow default behavior of element.
  • zero - tabIndex="0" Yes In tab order relative to element's position in document
  • positive - tabIndex="x" (where x is a positive integer between 1 and 32768) Yes tabIndex value directly specifies where this element is positioned in the tab order
  • negative - tabIndex="-1" Yes Not in tab order, author must focus it with element.focus() as result of a key press.

    Description: duplicated/nested tabIndexs are supported


  • keyStrokeMatch

    public static boolean keyStrokeMatch(org.eclipse.swt.events.KeyEvent e,
                                         java.lang.String shortcutStr)
    This function is see whether the key stroke matches the short cut string definition.

    The modifierKeys are the combination of {ALT, COMMAND, CTRL, SHIFT, M1, M2, M3, M4}. They can be lowercase or uppercase. for more detail. @see SWTKeyLookup

    A natural key is any Unicode character (e.g., "backspace", etc.), any character belonging to a natural language (e.g., "a", "1", "[", etc.), or any special control character specific to computers (e.g., "F10", "PageUp", etc.).

    Note:

  • There should be only one natural key in the end of the shortcutStr.
  • The shortcut key setting yields to the OS/SWT default shortcut setting . That is, the OS 'ctrl+alt+del' takes privilege over this function the SWT 'ctrl+f8' invoking SWTProposal will take privilege over this function.
  • Keep in mind set the initial key without any decoration That is: '9' instead of '('; 'a' instead of 'A'
  • Parameters:
    e - KeyEvent
    shortcutStr - It follows the format of modifierKeys + A naturalKey
    Returns:
    true if the event keystroke matches the shortcutStr setting

    isValidPathProtocol

    public static boolean isValidPathProtocol(java.lang.String path)
    Justify if current path is valid protocol, a valid path should be start with jar:///, file:///, http://, ftp:// or any other URL protocol.

    Parameters:
    path -
    Returns:

    IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

    (c) Copyright IBM Corporation 1998, 2010