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 Details

  • 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:
      • #setImageCached(boolean)
    • isEclipseMode

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