|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.izforge.izpack.util.os.Shortcut
public abstract class Shortcut
This class represents a shortcut in a operating system independent way. OS specific subclasses are used to implement the necessary mapping from this generic API to the classes that reflect the system dependent AIP.
TargetFactory| Field Summary | |
|---|---|
static int |
ALL_USERS
ALL_USERS = 2 (identifies the user type as valid for all users) |
static int |
APPLICATIONS
APPLICATIONS = 1 |
static int |
CURRENT_USER
CURRENT_USER = 1 (identifies the user type as the current user) |
static int |
DESKTOP
DESKTOP = 3 |
static int |
HIDE
HIDE = 0 (Hide the window when starting.) |
static int |
MAXIMIZED
MAXIMIZED = 3 (Show the window maximized when starting.) |
static int |
MINIMIZED
MINIMIZED = 2 |
static int |
NORMAL
NORMAL = 1 Show the window 'normal' when starting. |
static int |
START_MENU
START_MENU = 2 |
static int |
START_UP
START_UP = 4 |
protected UninstallData |
uninstaller
internal field UninstallData uninstaller |
| Constructor Summary | |
|---|---|
Shortcut()
|
|
| Method Summary | |
|---|---|
void |
cleanUp()
Clean Up Method to do some cleanups after Shortcut Creation. |
void |
execPostAction()
Dummy Method especially for the Unix Root User. |
String |
getBasePath()
Returns the base path of the shortcut depending on type. |
Boolean |
getCreateForAll()
Gets the create for All Flag |
abstract String |
getFileName()
Subclass implementations return the fully qualified file name under which the link is saved on disk. |
int |
getHotkey()
Gets the link hotKey |
abstract String |
getIconLocation()
Returns the path of the shortcut icon that will be shown on the desktop. |
abstract int |
getLinkType()
Gets the type of link types are: DESKTOP
APPLICATIONS
START_MENU
START_UP
|
abstract List<String> |
getProgramGroups(int userType)
Returns a list of currently existing program groups, based on the requested type. |
abstract String |
getProgramsFolder(int current_user)
Gets the Programs Folder for the given User. |
boolean |
getRunAsAdministrator()
Determines if the shortcut target should be run with administrator privileges. |
int |
getShowCommand()
|
abstract int |
getUserType()
Gets the user type for the link |
String |
getWorkingDirectory()
Gets the working directory for the link target. |
abstract void |
initialize(int type,
String name)
This method initializes the object. |
abstract boolean |
multipleUsers()
Returns true if the target OS supports current user and all users. |
abstract void |
save()
Saves this link. |
abstract void |
setArguments(String arguments)
Sets the command line arguments that will be passed to the target when the link is activated. |
void |
setCategories(String theCategories)
Sets the Categories Field On Unixes |
void |
setCreateForAll(Boolean aCreateForAll)
Sets the flag which indicates, that this should created for all. |
abstract void |
setDescription(String description)
Sets the description string that is used to identify the link in a menu or on the desktop. |
void |
setEncoding(String string)
Sets the Encoding |
void |
setHotkey(int hotkey)
Sets the link hotKey |
abstract void |
setIconLocation(String path,
int index)
Sets the path of the shortcut icon that will be shown on the desktop. |
void |
setKdeSubstUID(String string)
This sets the setKdeSubstUID |
void |
setKdeUserName(String string)
This sets the KdeUserName |
abstract void |
setLinkName(String name)
Sets the name shown in a menu or on the desktop for the link. |
abstract void |
setLinkType(int type)
Sets the type of link |
void |
setMimetype(String string)
This sets the Mimetype |
abstract void |
setProgramGroup(String groupName)
Sets the name of the program group this ShellLinbk should be placed in. |
void |
setRunAsAdministrator(boolean runAsAdministrator)
Determines if the shortcut target should be run with administrator privileges. |
abstract void |
setShowCommand(int show)
Sets the show command that is passed to the target application when the link is activated. |
abstract void |
setTargetPath(String path)
Sets the absolute path to the shortcut target. |
void |
setTerminal(String string)
Sets the terminal |
void |
setTerminalOptions(String string)
This sets the terminals-options |
void |
setTryExec(String aTryExec)
Sets the TryExecField on Unixes. |
void |
setType(String string)
This sets the shortcut type |
void |
setUninstaller(UninstallData theUninstaller)
Sets the Uninstaller field with the unique Uninstaller Instance. |
void |
setURL(String string)
This sets the URL |
abstract void |
setUserType(int type)
Sets the user type for the link |
abstract void |
setWorkingDirectory(String dir)
Sets the working directory for the link target. |
abstract boolean |
supported()
Determines if a specific instance of this class supports the creation of shortcuts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int APPLICATIONS
public static final int START_MENU
public static final int DESKTOP
public static final int START_UP
public static final int HIDE
public static final int NORMAL
public static final int MINIMIZED
public static final int MAXIMIZED
public static final int CURRENT_USER
public static final int ALL_USERS
protected UninstallData uninstaller
| Constructor Detail |
|---|
public Shortcut()
| Method Detail |
|---|
public abstract void initialize(int type,
String name)
throws Exception
TargetFactory.
type - the type or classification of the program group in which the link should exist.name - the name of the shortcut.
Exception
public String getBasePath()
throws Exception
ExceptionsetLinkType(int),
setUserType(int)public abstract List<String> getProgramGroups(int userType)
APPLICATIONS then all the names of the program groups in the
Start Menu\Programs menu would be returned.
userType - the type of user for the program group set.
Vector of String objects that represent the names of the
existing program groups. It is theoretically possible that this list is empty.APPLICATIONS,
START_MENUpublic abstract String getFileName()
Stringpublic abstract boolean multipleUsers()
true if the target OS supports current user and all users.
true if the target OS supports current and all users.public abstract boolean supported()
true if the creation of shortcuts is supported, false if
this is not supported.public abstract void setArguments(String arguments)
arguments - the command line argumentspublic abstract void setDescription(String description)
description - the descriptiojn string
public abstract void setIconLocation(String path,
int index)
path - a fully qualified file name of a file that contains the icon.index - the index of the specific icon to use in the file. If there is only one icon in
the file, use an index of 0.public abstract String getIconLocation()
public abstract void setProgramGroup(String groupName)
groupName - the name of the program grouppublic abstract void setShowCommand(int show)
HIDE will cause the target window not to show at all. There is not even a
button on the taskbar. This is a very useful setting when batch files are used to launch a
Java application as it will then appear to run just like any native Windows application.
public int getShowCommand()
public abstract void setTargetPath(String path)
path - the fully qualified file name of the targetpublic abstract void setWorkingDirectory(String dir)
dir - the working directorypublic String getWorkingDirectory()
public abstract void setLinkName(String name)
name - The name that the link should display on a menu or on the desktop. Do not include
a file extension.public abstract int getLinkType()
public abstract void setLinkType(int type)
throws IllegalArgumentException,
UnsupportedEncodingException
type - The type of link desired. The following values can be set:IllegalArgumentException - if an an invalid type is passed
UnsupportedEncodingExceptionpublic abstract void setUserType(int type)
type - the type of user for the link.CURRENT_USER,
ALL_USERSpublic abstract int getUserType()
CURRENT_USER,
ALL_USERSpublic void setRunAsAdministrator(boolean runAsAdministrator)
runAsAdministrator - if true, run the target with administrator privileges.public boolean getRunAsAdministrator()
true, if the target will run with administrator privileges
public abstract void save()
throws Exception
Exception - if problems are encounteredpublic int getHotkey()
public void setHotkey(int hotkey)
hotkey - public void setEncoding(String string)
string - public void setMimetype(String string)
string - public void setTerminal(String string)
string - public void setTerminalOptions(String string)
string - public void setType(String string)
string - public void setKdeUserName(String string)
string - The UserNamepublic void setKdeSubstUID(String string)
string - exactly "true" or "false" or nothingpublic void setURL(String string)
string - public abstract String getProgramsFolder(int current_user)
current_user - one of current or all
public void setCreateForAll(Boolean aCreateForAll)
aCreateForAll - A Flag - Set to true, if to create for All.public Boolean getCreateForAll()
public void setCategories(String theCategories)
theCategories - the categoriespublic void setTryExec(String aTryExec)
aTryExec - the try exec commandpublic void setUninstaller(UninstallData theUninstaller)
theUninstaller - the unique instancepublic void execPostAction()
public void cleanUp()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||