Program

Instances of this class represent programs and their associated file extensions in the operating system.

@see <a href="http://www.eclipse.org/swt/snippets/#program">Program snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

Constructors

this
this()

Prevents uninitialized instances from being created outside the package.

Members

Functions

execute
bool execute(String fileName)

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.

getImageData
ImageData getImageData()

Returns the receiver's image data. This is the icon that is associated with the receiver in the operating system.

getName
String getName()

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.

gnome_24_execute
bool gnome_24_execute(String fileName)

GNOME 2.4 - Execute the program for the given file.

gnome_execute
bool gnome_execute(String fileName)

GNOME 2.2 - Execute the program for the given file.

gnome_getImageData
ImageData gnome_getImageData()

GNOME - Get Image Data

opEquals
equals_t opEquals(Object other)

Compares the argument to the receiver, and returns true if they represent the <em>same</em> object using a class specific comparison.

toHash
hash_t toHash()

Returns an integer hash code for the receiver. Any two objects that return <code>true</code> when passed to <code>equals</code> must return the same value for this method.

toString
String toString()

Returns a string containing a concise, human-readable description of the receiver.

Static functions

findProgram
Program findProgram(String extension)

Finds the program that is associated with an extension. The extension may or may not begin with a '.'. Note that a <code>Display</code> must already exist to guarantee that this method returns an appropriate result.

getExtensions
String[] getExtensions()

Answer all program extensions in the operating system. Note that a <code>Display</code> must already exist to guarantee that this method returns an appropriate result.

getPrograms
Program[] getPrograms()

Answers all available programs in the operating system. Note that a <code>Display</code> must already exist to guarantee that this method returns an appropriate result.

gnome24_getMimeInfo
String[][String] gnome24_getMimeInfo()

SWT Extension This is a temporary workaround until SWT will get the real implementation.

gnome_24_launch
bool gnome_24_launch(String fileName)

GNOME 2.4 - Launch the default program for the given file.

gnome_getMimeInfo
String[][String] gnome_getMimeInfo()

GNOME - Get mime types

launch
bool launch(String fileName)

Launches the operating system executable associated with the file or URL (http:// or https://). If the file is an executable then the executable is launched. Note that a <code>Display</code> must already exist to guarantee that this method returns an appropriate result.

Meta