Package org.eclipse.birt.core.ui.utils
Class UIHelper
java.lang.Object
org.eclipse.birt.core.ui.utils.UIHelper
This class has been created to hold methods that provide specific
functionality or services.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
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
This method returns an URL for a resource given its plugin relative path.static boolean
Returns if running in eclipse mode or stand-alone mode currently.
-
Field Details
-
IMAGE_NAV_FORWARD
- See Also:
-
IMAGE_NAV_FORWARD_DIS
- See Also:
-
IMAGE_NAV_BACKWARD
- See Also:
-
IMAGE_NAV_BACKWARD_DIS
- See Also:
-
-
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
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
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.
-