| java.lang.Object org.eclipse.swt.program.Program
Program | final public class Program (Code) | | Instances of this class represent programs and
their associated file extensions in the operating
system.
|
Constructor Summary | |
| Program() Prevents uninitialized instances from being created outside the package. |
Method Summary | |
public boolean | equals(Object other) Compares the argument to the receiver, and returns true
if they represent the same object using a class
specific comparison. | public boolean | execute(String fileName) Executes the program with the file as the single argument
in the operating system. | public static Program | findProgram(String extension) Finds the program that is associated with an extension.
The extension may or may not begin with a '.'. | public static String[] | getExtensions() Answer all program extensions in the operating system. | public ImageData | getImageData() Returns the receiver's image data. | static String | getKeyValue(String string, boolean expand) | public String | getName() Returns the receiver's name. | static Program | getProgram(String key) | public static Program[] | getPrograms() Answers all available programs in the operating system. | public int | hashCode() Returns an integer hash code for the receiver. | public static boolean | launch(String fileName) Launches the executable associated with the file in
the operating system. | public String | toString() Returns a string containing a concise, human-readable
description of the receiver. |
Program | Program()(Code) | | Prevents uninitialized instances from being created outside the package.
|
equals | public boolean equals(Object other)(Code) | | Compares the argument to the receiver, and returns true
if they represent the same object using a class
specific comparison.
Parameters: other - the object to compare with this object true if the object is the same as this object and false otherwise See Also: Program.hashCode() |
execute | public boolean execute(String fileName)(Code) | | Executes the program with the file as the single argument
in the operating system. It is the responsibility of the
programmer to ensure that the file contains valid data for
this program.
Parameters: fileName - the file or program name true if the file is launched, otherwise false exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT when fileName is null
|
findProgram | public static Program findProgram(String extension)(Code) | | Finds the program that is associated with an extension.
The extension may or may not begin with a '.'. Note that
a Display must already exist to guarantee that
this method returns an appropriate result.
Parameters: extension - the program extension the program or null exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT when extension is null
|
getExtensions | public static String[] getExtensions()(Code) | | Answer all program extensions in the operating system. Note
that a Display must already exist to guarantee
that this method returns an appropriate result.
an array of extensions |
getImageData | public ImageData getImageData()(Code) | | Returns the receiver's image data. This is the icon
that is associated with the receiver in the operating
system.
the image data for the program, may be null |
getName | public String getName()(Code) | | Returns the receiver's name. This is as short and
descriptive a name as possible for the program. If
the program has no descriptive name, this string may
be the executable name, path or empty.
the name of the program |
getPrograms | public static Program[] getPrograms()(Code) | | Answers all available programs in the operating system. Note
that a Display must already exist to guarantee
that this method returns an appropriate result.
an array of programs |
hashCode | public int hashCode()(Code) | | Returns an integer hash code for the receiver. Any two
objects that return true when passed to
equals must return the same value for this
method.
the receiver's hash See Also: Program.equals(Object) |
launch | public static boolean launch(String fileName)(Code) | | Launches the executable associated with the file in
the operating system. If the file is an executable,
then the executable is launched. Note that a Display
must already exist to guarantee that this method returns
an appropriate result.
Parameters: fileName - the file or program name true if the file is launched, otherwise false exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT when fileName is null
|
toString | public String toString()(Code) | | Returns a string containing a concise, human-readable
description of the receiver.
a string representation of the program |
|
|