Interface IApplicationContext
This interface is not intended to be implemented by clients.
- Since:
- 1.0
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A key used to store arguments for the application.static final Object
Exit object that indicates the application result will be delivered asynchronously.static final String
A system property that may be set by an application to specify exit data for the application. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method should be called once the application is completely initialized and running.The arguments used for the application.Returns the application associated with this application context.Returns the bundle which is responsible for the definition of the product associated with this application context.Returns the text description of the product associated with this application context.Returns the unique product id of the product associated with this application context.Returns the name of the product associated with this application context.Returns the property with the given key of the product associated with this application context.void
setResult
(Object result, IApplication application) Sets the result of the application asynchronously.
-
Field Details
-
EXIT_DATA_PROPERTY
A system property that may be set by an application to specify exit data for the application. The value of the property must be aString
.Typically applications do not need to set this property. If an error is detected while launching or running an application then the launcher will set this property automatically in order to display a message to the end user. An application may set this property for the following reasons:
- To provide the command line arguments to relaunch the eclipse platform.
See
IApplication.EXIT_RELAUNCH
- To provide an error message that will be displayed to the end user. This will cause an error dialog to be displayed to the user, this option should not be used by headless applications.
- To suppress all error dialogs displayed by the launcher this property can
be set to the empty
String
. This is useful for headless applications where error dialogs must never be displayed.
- Since:
- 1.3
- See Also:
- To provide the command line arguments to relaunch the eclipse platform.
See
-
APPLICATION_ARGS
A key used to store arguments for the application. The content of this argument is unchecked and should conform to the expectations of the application being invoked. Typically this is aString
array.If the map used to launch an application
ApplicationDescriptor.launch(Map)
does not contain a value for this key then command line arguments used to launch the platform are set in the arguments of the application context.- See Also:
-
EXIT_ASYNC_RESULT
Exit object that indicates the application result will be delivered asynchronously. This object must be returned by the methodIApplication.start(IApplicationContext)
for applications which deliver a result asynchronously with the methodsetResult(Object, IApplication)
.- Since:
- 1.3
-
-
Method Details
-
getArguments
Map getArguments()The arguments used for the application. The arguments fromApplicationDescriptor.launch(Map)
are used as the arguments for this context when an application is launched.- Returns:
- a map of application arguments.
-
applicationRunning
void applicationRunning()This method should be called once the application is completely initialized and running. This method will perform certain operations that are needed once an application is running. One example is bringing down a splash screen if it exists. -
getBrandingApplication
String getBrandingApplication()Returns the application associated with this application context. This information is used to guide the runtime as to what application extension to create and execute.- Returns:
- this product's application or
null
if none
-
getBrandingName
String getBrandingName()Returns the name of the product associated with this application context. The name is typically used in the title bar of UI windows.- Returns:
- the name of the product or
null
if none
-
getBrandingDescription
String getBrandingDescription()Returns the text description of the product associated with this application context.- Returns:
- the description of the product or
null
if none
-
getBrandingId
String getBrandingId()Returns the unique product id of the product associated with this application context.- Returns:
- the id of the product
-
getBrandingProperty
Returns the property with the given key of the product associated with this application context.null
is returned if there is no such key/value pair.- Parameters:
key
- the name of the property to return- Returns:
- the value associated with the given key or
null
if none
-
getBrandingBundle
Bundle getBrandingBundle()Returns the bundle which is responsible for the definition of the product associated with this application context. Typically this is used as a base for searching for images and other files that are needed in presenting the product.- Returns:
- the bundle which defines the product or
null
if none
-
setResult
Sets the result of the application asynchronously. This method can only be used after the application'sstart
method has returned the value ofEXIT_ASYNC_RESULT
.The specified application must be the same application instance which is associated with this application context. In other word the application instance for which
IApplication.start(IApplicationContext)
was called with this application context; otherwise anIllegalArgumentException
is thrown.- Parameters:
result
- the result value for the application. May be null.application
- the application instance associated with this application context- Throws:
IllegalStateException
- ifEXIT_ASYNC_RESULT
was not returned by the application'sstart
method or if the result has already been set for this application context.IllegalArgumentException
- if the specified application is not the same application instance associated with this application context.- Since:
- 1.3
-