Class TargetPlatform

java.lang.Object
org.eclipse.pde.core.plugin.TargetPlatform

public class TargetPlatform extends Object
The central class for the plug-in development target platform. This class cannot be instantiated or subclassed by clients; all functionality is provided by static methods. Features include:
  • the target platform's OS/WS/ARCH
  • the default application and product
  • the available applications and products
Since:
3.3
Restriction:
This class is not intended to be subclassed by clients.
Restriction:
This class is not intended to be instantiated by clients.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String[]
    Returns a list of identifiers for all available applications (i.e.
    static String
    The comma-separated list of bundles which are automatically installed and optionally started.
    static String
    Returns the ID for the default application (org.eclipse.core.runtime.applications extension) for the current target platform.
    static String
    Returns the location of the default target platform, namely the location of the host (running) instance of Eclipse.
    static String
    Returns the ID for the default product (org.eclipse.core.runtime.products extension) for the current target platform, or null if none can be determined.
    static String
    Returns the target platform's main location.
    static String
    Returns the target locale as specified on the Environment tab of the Plug-in Development > Target Platform preference page.
    static String
    Returns the target operating system as specified on the Environment tab of the Plug-in Development > Target Platform preference page.
    static String
    Returns the target system architecture as specified on the Environment tab of the Plug-in Development > Target Platform preference page.
    static String[]
    Returns a list of identifiers for all available products (i.e.
    static String
    Returns the target windowing system as specified on the Environment tab of the Plug-in Development > Target Platform preference page.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TargetPlatform

      public TargetPlatform()
  • Method Details

    • getLocation

      public static String getLocation()
      Returns the target platform's main location. As target platforms may contain multiple locations it is recommended that you use ITargetPlatformService instead.
      Returns:
      the target platform's main location
    • getDefaultLocation

      public static String getDefaultLocation()
      Returns the location of the default target platform, namely the location of the host (running) instance of Eclipse.
      Returns:
      the location of the default target platform
    • getOS

      public static String getOS()
      Returns the target operating system as specified on the Environment tab of the Plug-in Development > Target Platform preference page.
      Returns:
      the target operating system
    • getWS

      public static String getWS()
      Returns the target windowing system as specified on the Environment tab of the Plug-in Development > Target Platform preference page.
      Returns:
      the target windowing system
    • getNL

      public static String getNL()
      Returns the target locale as specified on the Environment tab of the Plug-in Development > Target Platform preference page.
      Returns:
      the target locale
    • getOSArch

      public static String getOSArch()
      Returns the target system architecture as specified on the Environment tab of the Plug-in Development > Target Platform preference page.
      Returns:
      the target system architecture
    • getApplications

      public static String[] getApplications()
      Returns a list of identifiers for all available applications (i.e. org.eclipse.core.runtime.applications extensions) declared in the workspace and target platform plug-ins.

      If a workspace plug-in has the same ID as a plug-in in the target platform, the extensions declared in the target counterpart are ignored.

      Returns:
      a list of identifiers for all available applications
    • getProducts

      public static String[] getProducts()
      Returns a list of identifiers for all available products (i.e. org.eclipse.core.runtime.products extensions) declared in the workspace and target platform plug-ins.

      If a workspace plug-in has the same ID as a plug-in in the target platform, the extensions declared in the target counterpart are ignored.

      Returns:
      a list of identifiers for all available products
    • getDefaultProduct

      public static String getDefaultProduct()
      Returns the ID for the default product (org.eclipse.core.runtime.products extension) for the current target platform, or null if none can be determined. If any of the
      Returns:
      the ID for the default product or null if none could be determined
    • getDefaultApplication

      public static String getDefaultApplication()
      Returns the ID for the default application (org.eclipse.core.runtime.applications extension) for the current target platform.

      If none could be determined, then org.eclipse.ui.ide.workbench application is returned.

      Returns:
      the default application to run when launching an Eclipse application
    • getBundleList

      public static String getBundleList()
      The comma-separated list of bundles which are automatically installed and optionally started.

      Each entry if of the form <bundleID>[@ [<startlevel>] [":start"]] If the startlevel is omitted then the framework will use the default start level for the bundle. If the "start" tag is added then the bundle will be marked as started after being installed.

      The list computed is based on the osgi.bundles key found in the config.ini file of the target platform. If no such key is found, then a suitable list is computed based on the target platform version.

      Returns:
      a comma-separated list of bundles that are automatically installed and optionally started when a runtime Eclipse application is launched.