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.

gio_execute
bool gio_execute(String fileName)

GIO - Execute the program for the given file.

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.

findProgram
Program findProgram(Display display, String extension)
Undocumented in source. Be warned that the author may not have intended to support it.
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.

getPrograms
Program[] getPrograms(Display display)
Undocumented in source. Be warned that the author may not have intended to support it.
gio_getMimeInfo
String[][String] gio_getMimeInfo()
Undocumented in source. Be warned that the author may not have intended to support it.
gio_getMimeType
String gio_getMimeType(String extension)
Undocumented in source. Be warned that the author may not have intended to support it.
gio_getProgram
Program gio_getProgram(Display display, String mimeType)
Undocumented in source. Be warned that the author may not have intended to support it.
gio_getProgram
Program gio_getProgram(Display display, GAppInfo* application)
Undocumented in source. Be warned that the author may not have intended to support it.
gio_launch
bool gio_launch(String fileName)

GIO - Launch the default program for the given file.

isExecutable
bool isExecutable(String fileName)
Undocumented in source. Be warned that the author may not have intended to support it.
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.

launch
bool launch(String fileName, String workingDir)

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. The program is launched with the specified working directory only when the <code>workingDir</code> exists and <code>fileName</code> is an executable. Note that a <code>Display</code> must already exist to guarantee that this method returns an appropriate result.

launch
bool launch(Display display, String fileName, String workingDir)
Undocumented in source. Be warned that the author may not have intended to support it.
parseCommand
String[] parseCommand(String cmd)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

PREFIX_HTTP
String PREFIX_HTTP;
Undocumented in source.
PREFIX_HTTPS
String PREFIX_HTTPS;
Undocumented in source.
mimeTable
String[][String] mimeTable;
Undocumented in source.
modTime
ptrdiff_t modTime;
Undocumented in source.

Variables

command
String command;
Undocumented in source.
display
Display display;
Undocumented in source.
gioExpectUri
bool gioExpectUri;
Undocumented in source.
iconPath
String iconPath;
Undocumented in source.
name
String name;
Undocumented in source.

Meta