net.rim.device.api.system
Class ApplicationDescriptor

java.lang.Object
  |
  +--net.rim.device.api.system.ApplicationDescriptor

public final class ApplicationDescriptor
extends Object

Encapsulates descriptive information for an application.

See Also:
Application, ApplicationDescriptor, ApplicationManager

Field Summary
static byte FLAG_AUTO_RESTART
          Automatically restart this application if it exits.
static byte FLAG_RUN_ON_STARTUP
          Run this application on device startup.
static byte FLAG_SYSTEM
          System application.
 
Constructor Summary
ApplicationDescriptor(ApplicationDescriptor original, String[] args)
          Constructs a new ApplicationDescriptor, using another descriptor as a template.
ApplicationDescriptor(ApplicationDescriptor original, String name, String[] args)
          Constructs a new named ApplicationDescriptor, using another descriptor as a template.
ApplicationDescriptor(ApplicationDescriptor original, String name, String[] args, Bitmap icon, int position, String nameResourceBundle, int nameResourceId)
          Constructs a new named ApplicationDescriptor, using another descriptor as a template, and providing initial settings.
ApplicationDescriptor(ApplicationDescriptor original, String name, String[] args, Bitmap icon, int position, String nameResourceBundle, int nameResourceId, int flags)
          Constructs a new named ApplicationDescriptor, using another descriptor as a template, and providing initial settings.
 
Method Summary
static ApplicationDescriptor currentApplicationDescriptor()
          Retrieves the descriptor used to start the current process.
 boolean equals(Object o)
          Compares this descriptor to another object for equivalency.
 String[] getArgs()
          Retrieves the argument array from this descriptor.
 int getFlags()
          Retrieves the flags from this descriptor.
 Bitmap getIcon()
          Retrieves the icon from this descriptor.
 int getIndex()
          Retrieves the application index from this descriptor.
 int getModuleHandle()
          Retrieves handle for this descriptor's code module.
 String getModuleName()
          Retrieves name of this descriptor's code module.
 String getName()
          Retrieves the application name from this descriptor.
 String getNameResourceBundle()
          Retrieves the resource bundle from this descriptor.
 int getNameResourceId()
          Retrieves the resource ID from this descriptor.
 int getPosition()
          Returns the application's suggested position on the ribbon.
 String getVersion()
          Retrieves the version string from this descriptor.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLAG_RUN_ON_STARTUP

public static final byte FLAG_RUN_ON_STARTUP
Run this application on device startup.

FLAG_SYSTEM

public static final byte FLAG_SYSTEM
System application.

FLAG_AUTO_RESTART

public static final byte FLAG_AUTO_RESTART
Automatically restart this application if it exits.
Since:
JDE 3.6.0
Constructor Detail

ApplicationDescriptor

public ApplicationDescriptor(ApplicationDescriptor original,
                             String[] args)
Constructs a new ApplicationDescriptor, using another descriptor as a template.

Note that this builds a new application descriptor but does not provide it with a name.

Parameters:
original - Application descriptor template from which to build this new one.
args - Initial arguments for this new descriptor.
Since:
JDE 3.6.0

ApplicationDescriptor

public ApplicationDescriptor(ApplicationDescriptor original,
                             String name,
                             String[] args)
Constructs a new named ApplicationDescriptor, using another descriptor as a template.

Parameters:
original - Application descriptor template from which to build this new one.
name - Name for this new descriptor.
args - Initial arguments for this new descriptor.
Since:
JDE 3.6.0

ApplicationDescriptor

public ApplicationDescriptor(ApplicationDescriptor original,
                             String name,
                             String[] args,
                             Bitmap icon,
                             int position,
                             String nameResourceBundle,
                             int nameResourceId)
Constructs a new named ApplicationDescriptor, using another descriptor as a template, and providing initial settings.

Parameters:
original - Application descriptor template from which to build this new one.
name - Name for this new descriptor
args - Initial arguments for this new descriptor.
icon - Display icon for this new descriptor.
position - Ribbon position for this new descriptor's icon.
nameResourceBundle - Resource bundle containing localized version of this descriptor's name.
nameResourceId - Resource ID containing localized version of this descriptor's name.
Since:
JDE 3.6.0

ApplicationDescriptor

public ApplicationDescriptor(ApplicationDescriptor original,
                             String name,
                             String[] args,
                             Bitmap icon,
                             int position,
                             String nameResourceBundle,
                             int nameResourceId,
                             int flags)
Constructs a new named ApplicationDescriptor, using another descriptor as a template, and providing initial settings.

Parameters:
original - Application descriptor template from which to build this new one.
name - Name for this new descriptor
args - Initial arguments for this new descriptor.
icon - Display icon for this new descriptor.
position - Ribbon position for this new descriptor's icon.
nameResourceBundle - Resource bundle containing localized version of this descriptor's name.
nameResourceId - Resource ID containing localized version of this descriptor's name.
flags - Application flags for this new descriptor.
Since:
JDE 3.6.0
Method Detail

getModuleHandle

public int getModuleHandle()
Retrieves handle for this descriptor's code module.

Returns:
Handle for the code module containing this descriptor's application.

getModuleName

public String getModuleName()
Retrieves name of this descriptor's code module.

Returns:
Name of the code module containing this descriptor's application.

getName

public String getName()
Retrieves the application name from this descriptor.

Returns:
Name of this descriptor's application.

getIndex

public int getIndex()
Retrieves the application index from this descriptor. Each application in a code module has a unique index.

Returns:
Index of this descriptor's application.

getNameResourceBundle

public String getNameResourceBundle()
Retrieves the resource bundle from this descriptor.

Returns:
Resource bundle containing a localized version of the application name, or null if no localized version exists.

getNameResourceId

public int getNameResourceId()
Retrieves the resource ID from this descriptor.

Returns:
Resource ID containing a localized version of the application name.

getVersion

public String getVersion()
Retrieves the version string from this descriptor.

Returns:
Application version.

getArgs

public String[] getArgs()
Retrieves the argument array from this descriptor.

Returns:
Application arguments.

getFlags

public int getFlags()
Retrieves the flags from this descriptor.

Returns:
Application flags.

getIcon

public Bitmap getIcon()
Retrieves the icon from this descriptor.

Returns:
Application icon as a Bitmap.

getPosition

public int getPosition()
Returns the application's suggested position on the ribbon.

Applications with identical positions are placed on a first-come, first-serve basis. A lower value of position means that the application is placed closer to the start of the "ribbon paragraph" (i.e. positions up and to the left).

Returns:
Application's suggested position on the ribbon between 1 and 255, or 0 if no position was specified.

equals

public boolean equals(Object o)
Compares this descriptor to another object for equivalency.

Equivalency is ensured if your object is an application descriptor, has the same module handle, and has the same list of arguments.

Overrides:
equals in class Object
Parameters:
o - Object to compare to this descriptor.
Returns:
True if your provided object is equivalent to this descriptor; otherwise, false.
Since:
JDE 4.0.2

currentApplicationDescriptor

public static ApplicationDescriptor currentApplicationDescriptor()
Retrieves the descriptor used to start the current process.

Returns:
Descriptor for the application that started the current process.


Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.