Package org.eclipse.birt.core.ui.utils

# Class UIHelper

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

public final class UIHelper extends Object
This class has been created to hold methods that provide specific functionality or services.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`IMAGE_NAV_BACKWARD`
`static final String`
`IMAGE_NAV_BACKWARD_DIS`
`static final String`
`IMAGE_NAV_FORWARD`
`static final String`
`IMAGE_NAV_FORWARD_DIS`

## Constructor Summary

Constructors
Constructor
Description
`UIHelper()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`centerOnMonitor(org.eclipse.swt.widgets.Monitor monitor, org.eclipse.swt.widgets.Shell shell)`
Center shell on specified monitor.
`static void`
`centerOnScreen(org.eclipse.swt.widgets.Shell shell)`
This is a helper method created to center a shell on the screen.
`static org.eclipse.swt.graphics.Image`
`getImage(String sPluginRelativePath)`
This is a convenience method to get an imgIcon from a URL.
`static org.eclipse.swt.graphics.Point`
`getScreenLocation(org.eclipse.swt.widgets.Composite cmpTarget)`
This is a helper method created to get the location on screen of a composite.
`static URL`
`getURL(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 Details

### IMAGE_NAV_FORWARD

public static final String IMAGE_NAV_FORWARD

See Also:
  - Constant Field Values

### IMAGE_NAV_FORWARD_DIS

public static final String IMAGE_NAV_FORWARD_DIS

See Also:
  - Constant Field Values

### IMAGE_NAV_BACKWARD

public static final String IMAGE_NAV_BACKWARD

See Also:
  - Constant Field Values

### IMAGE_NAV_BACKWARD_DIS

public static final String IMAGE_NAV_BACKWARD_DIS

See Also:
  - Constant Field Values

## Constructor Details

### UIHelper

public UIHelper()

## Method Details

### getScreenLocation

public static org.eclipse.swt.graphics.Point getScreenLocation(org.eclipse.swt.widgets.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(org.eclipse.swt.widgets.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(org.eclipse.swt.widgets.Monitor monitor, org.eclipse.swt.widgets.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 URL getURL(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 org.eclipse.swt.graphics.Image getImage(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:
  - invalid reference

        #setImageCached(boolean)

### isEclipseMode

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