org.eclipse.birt.core.ui.utils
Class UIHelper

java.lang.Object
  extended by org.eclipse.birt.core.ui.utils.UIHelper

public final class UIHelper
extends java.lang.Object

This class has been created to hold methods that provide specific functionality or services.


Field Summary
static java.lang.String IMAGE_NAV_BACKWARD
           
static java.lang.String IMAGE_NAV_BACKWARD_DIS
           
static java.lang.String IMAGE_NAV_FORWARD
           
static java.lang.String IMAGE_NAV_FORWARD_DIS
           
 
Constructor Summary
UIHelper()
           
 
Method Summary
static void centerOnMonitor(Monitor monitor, Shell shell)
          Center shell on specified monitor.
static void centerOnScreen(Shell shell)
          This is a helper method created to center a shell on the screen.
static Image getImage(java.lang.String sPluginRelativePath)
          This is a convenience method to get an imgIcon from a URL.
static Point getScreenLocation(Composite cmpTarget)
          This is a helper method created to get the location on screen of a composite.
static java.net.URL getURL(java.lang.String sPluginRelativePath)
          This method returns an URL for a resource given its plugin relative path.
static boolean isEclipseMode()
          Returns if running in eclipse mode or stand-alone mode currently.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_NAV_FORWARD

public static final java.lang.String IMAGE_NAV_FORWARD
See Also:
Constant Field Values

IMAGE_NAV_FORWARD_DIS

public static final java.lang.String IMAGE_NAV_FORWARD_DIS
See Also:
Constant Field Values

IMAGE_NAV_BACKWARD

public static final java.lang.String IMAGE_NAV_BACKWARD
See Also:
Constant Field Values

IMAGE_NAV_BACKWARD_DIS

public static final java.lang.String IMAGE_NAV_BACKWARD_DIS
See Also:
Constant Field Values
Constructor Detail

UIHelper

public UIHelper()
Method Detail

getScreenLocation

public static Point getScreenLocation(Composite cmpTarget)
This is a helper method created to get the location on screen of a composite. It does not take into account multiple monitors.

Parameters:
cmpTarget - The composite whose location on screen is required
Returns:
The location of the composite on screen.

centerOnScreen

public static void centerOnScreen(Shell shell)
This is a helper method created to center a shell on the screen. It centers the shell on the primary monitor in a multi-monitor configuration.

Parameters:
shell - The shell to be centered on screen

centerOnMonitor

public static void centerOnMonitor(Monitor monitor,
                                   Shell shell)
Center shell on specified monitor.

Parameters:
monitor - specified monitor will display shell.
shell - the shell to be centered on monitor.

getURL

public static java.net.URL getURL(java.lang.String sPluginRelativePath)
This method returns an URL for a resource given its plugin relative path. It is intended to be used to abstract out the usage of the UI as a plugin or standalone component when it comes to accessing resources.

Parameters:
sPluginRelativePath - The path to the resource relative to the plugin location.
Returns:
URL representing the location of the resource.

getImage

public static Image getImage(java.lang.String sPluginRelativePath)
This is a convenience method to get an imgIcon from a URL.

Parameters:
sPluginRelativePath - The URL for the imgIcon.
Returns:
The imgIcon represented by the given URL.
See Also:
#setImageCached( boolean )

isEclipseMode

public static boolean isEclipseMode()
Returns if running in eclipse mode or stand-alone mode currently.



Copyright © 2008 Actuate Corp. All rights reserved.