public final class Program extends Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Compares the argument to the receiver, and returns true
if they represent the same object using a class
specific comparison.
|
boolean |
execute(String fileName)
Executes the program with the file as the single argument
in the operating system.
|
static Program |
findProgram(String extension)
Finds the program that is associated with an extension.
|
static String[] |
getExtensions()
Answer all program extensions in the operating system.
|
ImageData |
getImageData()
Returns the receiver's image data.
|
String |
getName()
Returns the receiver's name.
|
static Program[] |
getPrograms()
Answers all available programs in the operating system.
|
int |
hashCode()
Returns an integer hash code for the receiver.
|
static boolean |
launch(String fileName)
Launches the operating system executable associated with the file or
URL (http:// or https://).
|
static boolean |
launch(String fileName,
String workingDir)
Launches the operating system executable associated with the file or
URL (http:// or https://).
|
String |
toString()
Returns a string containing a concise, human-readable
description of the receiver.
|
public static Program findProgram(String extension)
Display must already exist to guarantee that
this method returns an appropriate result.extension - the program extensionnullIllegalArgumentException - public static String[] getExtensions()
Display must already exist to guarantee
that this method returns an appropriate result.public static Program[] getPrograms()
Display must already exist to guarantee
that this method returns an appropriate result.public static boolean launch(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 falseIllegalArgumentException - public static boolean launch(String fileName, 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 falseIllegalArgumentException - public boolean execute(String fileName)
fileName - the file or program nametrue if the file is launched, otherwise falseIllegalArgumentException - public ImageData getImageData()
public String getName()
public boolean equals(Object other)
equals in class Objectother - 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 Objectequals(Object)
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.