public final class LauncherHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int |
countLaunchers()
Counts the number of launchers available.
|
static ej.wadapps.admin.Application |
getApplication(ej.wadapps.app.Activity activity)
Gets the application that owns an activity.
|
static ej.wadapps.admin.Application |
getApplication(ej.wadapps.app.BackgroundService bg)
Gets the application that owns the given background service.
|
static ej.wadapps.app.Activity |
getFirstActivity(ej.wadapps.admin.Application application)
Gets the first activity of an application.
|
static boolean |
hasActivity(ej.wadapps.admin.Application application)
Checks whether an application has some an activity.
|
static boolean |
hasService(ej.wadapps.admin.Application application)
Checks whether an application has some background services.
|
static boolean |
isCurrentApplication(ej.wadapps.admin.Application app)
Gets whether the application is the current application.
|
static boolean |
isCurrentLauncher(ej.wadapps.admin.Application application)
Checks whether the main launcher is a given application.
|
static boolean |
isLauncher(ej.wadapps.admin.Application application)
Checks whether an application is a launcher.
|
static boolean |
isResident(ej.wadapps.admin.Application application)
Checks whether an application is resident.
|
static boolean |
isSystemApp(ej.wadapps.admin.Application application)
Checks whether an application is a system app.
|
static void |
setNextLauncher()
Set the next launcher as default launcher.
|
static void |
show(ej.wadapps.admin.Application application)
Shows an application.
|
static void |
show(ej.wadapps.admin.Application application,
int timeout)
Shows an application.
|
static void |
start(ej.wadapps.admin.Application application)
Starts an application if necessary.
|
static void |
start(ej.wadapps.admin.Application application,
org.eclipse.core.runtime.IProgressMonitor monitor)
Starts an application if necessary.
|
static void |
startAndShow(ej.wadapps.admin.Application application)
Starts an application if necessary and shows its activity
|
static void |
startAndShow(ej.wadapps.admin.Application application,
org.eclipse.core.runtime.IProgressMonitor monitor)
Starts an application if necessary and shows its activity
|
public static boolean isCurrentLauncher(ej.wadapps.admin.Application application) throws java.lang.NullPointerException
application
- the application.true
if the given application is the current launcher.java.lang.NullPointerException
- if application is null
.public static void startAndShow(ej.wadapps.admin.Application application) throws java.lang.IllegalStateException, java.lang.SecurityException, ej.wadapps.admin.ApplicationOperationException, java.lang.NullPointerException
application
- the application.java.lang.IllegalStateException
- if the application state is not Application.State.INSTALLED
or Application.State.STARTED
state.java.lang.SecurityException
- if a security manager exits and if the caller does not have the appropriate permissions.ej.wadapps.admin.ApplicationOperationException
- If any unexpected errors occur while starting this application.java.lang.NullPointerException
- if application is null
.public static void start(ej.wadapps.admin.Application application) throws ej.wadapps.admin.ApplicationOperationException
application
- the application.java.lang.IllegalStateException
- if the application state is not Application.State.INSTALLED
or Application.State.STARTED
state.java.lang.SecurityException
- if a security manager exits and if the caller does not have the appropriate permissions.ej.wadapps.admin.ApplicationOperationException
- If any unexpected errors occur while starting this application.java.lang.NullPointerException
- if application is null
.public static void startAndShow(ej.wadapps.admin.Application application, org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.IllegalStateException, java.lang.SecurityException, ej.wadapps.admin.ApplicationOperationException, java.lang.NullPointerException
application
- the application.monitor
- the monitor to use to follow the start.java.lang.IllegalStateException
- if the application state is not Application.State.INSTALLED
or Application.State.STARTED
state.java.lang.SecurityException
- if a security manager exits and if the caller does not have the appropriate permissions.ej.wadapps.admin.ApplicationOperationException
- If any unexpected errors occur while starting this application.java.lang.NullPointerException
- if application is null
.public static void start(ej.wadapps.admin.Application application, org.eclipse.core.runtime.IProgressMonitor monitor) throws ej.wadapps.admin.ApplicationOperationException
application
- the application.monitor
- the monitor to use to follow the start.java.lang.IllegalStateException
- if the application state is not Application.State.INSTALLED
or Application.State.STARTED
state.java.lang.SecurityException
- if a security manager exits and if the caller does not have the appropriate permissions.ej.wadapps.admin.ApplicationOperationException
- If any unexpected errors occur while starting this application.java.lang.NullPointerException
- if application is null
.public static void show(ej.wadapps.admin.Application application) throws java.lang.NullPointerException
application
- the application.java.lang.NullPointerException
- if application is null
.public static void show(ej.wadapps.admin.Application application, int timeout) throws java.lang.NullPointerException
application
- the application.timeout
- the maximum amount of time to wait for an activity of this application to be registered before
cancelling this operationjava.lang.NullPointerException
- if application is null
.public static boolean isResident(ej.wadapps.admin.Application application) throws java.lang.NullPointerException
application
- the application.true
if the application is resident.java.lang.NullPointerException
- if application is null
.public static boolean isSystemApp(ej.wadapps.admin.Application application) throws java.lang.NullPointerException
application
- the application.true
if the application is a system app.java.lang.NullPointerException
- if application is null
.public static boolean hasService(ej.wadapps.admin.Application application) throws java.lang.NullPointerException
application
- the application.true
if the application has at least one background service.java.lang.NullPointerException
- if application is null
.public static boolean hasActivity(ej.wadapps.admin.Application application) throws java.lang.NullPointerException
application
- the application.true
if the application has at least one activity.java.lang.NullPointerException
- if application is null
.public static ej.wadapps.app.Activity getFirstActivity(ej.wadapps.admin.Application application) throws java.lang.NullPointerException
application
- the application.null
otherwise.java.lang.NullPointerException
- if application is null
.public static boolean isLauncher(ej.wadapps.admin.Application application) throws java.lang.NullPointerException
application
- the application.true
if the application is the launcher.java.lang.NullPointerException
- if application is null
.public static int countLaunchers()
public static ej.wadapps.admin.Application getApplication(ej.wadapps.app.BackgroundService bg) throws java.lang.IllegalArgumentException
bg
- the background service.java.lang.IllegalArgumentException
- when the background service is null.public static ej.wadapps.admin.Application getApplication(ej.wadapps.app.Activity activity) throws java.lang.IllegalArgumentException
activity
- the activity.java.lang.IllegalArgumentException
- when the activity is null.public static void setNextLauncher()
public static boolean isCurrentApplication(ej.wadapps.admin.Application app)
app
- the Application to checktrue
if the application is the current application.