public final class Program
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String[] |
ARGUMENTS |
(package private) java.lang.String |
command |
(package private) java.lang.String |
extension |
(package private) java.lang.String |
iconName |
(package private) java.lang.String |
name |
Constructor and Description |
---|
Program()
Prevents uninitialized instances from being created outside the package.
|
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.String |
assocQueryString(int assocStr,
TCHAR key,
boolean expand) |
boolean |
equals(java.lang.Object other)
Compares the argument to the receiver, and returns true
if they represent the same object using a class
specific comparison.
|
boolean |
execute(java.lang.String fileName)
Executes the program with the file as the single argument
in the operating system.
|
static Program |
findProgram(java.lang.String extension)
Finds the program that is associated with an extension.
|
static java.lang.String[] |
getExtensions()
Answer all program extensions in the operating system.
|
ImageData |
getImageData()
Returns the receiver's image data.
|
(package private) static java.lang.String |
getKeyValue(java.lang.String string,
boolean expand) |
java.lang.String |
getName()
Returns the receiver's name.
|
(package private) static Program |
getProgram(java.lang.String key,
java.lang.String extension) |
static Program[] |
getPrograms()
Answers all available programs in the operating system.
|
int |
hashCode()
Returns an integer hash code for the receiver.
|
static boolean |
launch(java.lang.String fileName)
Launches the operating system executable associated with the file or
URL (http:// or https://).
|
static boolean |
launch(java.lang.String fileName,
java.lang.String workingDir)
Launches the operating system executable associated with the file or
URL (http:// or https://).
|
java.lang.String |
toString()
Returns a string containing a concise, human-readable
description of the receiver.
|
java.lang.String name
java.lang.String command
java.lang.String iconName
java.lang.String extension
static final java.lang.String[] ARGUMENTS
Program()
static java.lang.String assocQueryString(int assocStr, TCHAR key, boolean expand)
public static Program findProgram(java.lang.String extension)
Display
must already exist to guarantee that
this method returns an appropriate result.extension
- the program extensionnull
java.lang.IllegalArgumentException
- public static java.lang.String[] getExtensions()
Display
must already exist to guarantee
that this method returns an appropriate result.static java.lang.String getKeyValue(java.lang.String string, boolean expand)
static Program getProgram(java.lang.String key, java.lang.String extension)
public static Program[] getPrograms()
Display
must already exist to guarantee
that this method returns an appropriate result.public static boolean launch(java.lang.String fileName)
Display
must already
exist to guarantee that this method returns an appropriate result.fileName
- the file or program name or URL (http:// or https://)true
if the file is launched, otherwise false
java.lang.IllegalArgumentException
- public static boolean launch(java.lang.String fileName, java.lang.String workingDir)
workingDir
exists and
fileName
is an executable.
Note that a Display
must already exist to guarantee
that this method returns an appropriate result.fileName
- the file name or program name or URL (http:// or https://)workingDir
- the name of the working directory or nulltrue
if the file is launched, otherwise false
java.lang.IllegalArgumentException
- public boolean execute(java.lang.String fileName)
fileName
- the file or program nametrue
if the file is launched, otherwise false
java.lang.IllegalArgumentException
- public ImageData getImageData()
public java.lang.String getName()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the object to compare with this objecttrue
if the object is the same as this object and false
otherwisehashCode()
public int hashCode()
true
when passed to
equals
must return the same value for this
method.hashCode
in class java.lang.Object
equals(Object)
public java.lang.String toString()
toString
in class java.lang.Object