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.
See Also:com.izforge.izpack.util.TargetFactory version: 0.0.1 / 3/4/02 author: Elmar Grom
getDirectoryCreated() Subclass implementations return the path of the directory where the link file is stored, if
it was necessary during the previous save operation to create the directory.
setIconLocation(String path, int index) Sets the location of the icon that is shown for the shortcut on the desktop.
Parameters: path - a fully qualified file name of a file that contains the icon. Parameters: index - the index of the specific icon to use in the file.
setLinkName(String name) Sets the name shown in a menu or on the desktop for the link.
Parameters: name - The name that the link should display on a menu or on the desktop.
public void
setLinkType(int type) Sets the type of link
Parameters: type - The type of link desired.
setProgramGroup(String groupName) Sets the name of the program group this ShellLinbk should be placed in.
public void
setShowCommand(int show) Sets the show command that is passed to the target application when the link is activated.
The show command determines if the the window will be restored to the previous size,
minimized, maximized or visible at all.
Returns the base path of the shortcut depending on type. The base path is the directory that
the short cut, (or its program group) will be created in. For instance, on Windows NT, a
shortcut with user-type ALL_USERS, and link-type DESKTOP might have the base path
"C:\Program Files\All Users\Desktop"
See Also:Shortcut.setLinkType(int) See Also:Shortcut.setUserType(int)
Subclass implementations return the path of the directory where the link file is stored, if
it was necessary during the previous save operation to create the directory. This method
returns null if no save operation was carried out or there was no need to
create a directory during the previous save operation.
this implementation returns always null.
Subclass implementations return the fully qualified file name under which the link is saved
on disk. Note: this method returns valid results only if the instance was created
from a file on disk or after a successful save operation. An instance of this class returns
an empty string.
an empty String
Returns a list of currently existing program groups, based on the requested type. For example
if the type is APPLICATIONS then all the names of the program groups in the
Start Menu\Programs menu would be returned.
Parameters: userType - the type of user for the program group set. a Vector of String objects that represent the names ofthe existing program groups. It is theoretically possible that this list is empty. See Also:Shortcut.APPLICATIONS See Also:Shortcut.START_MENU
Gets the Programs Folder for the given User. This is where to create subfolders or to place
or create shortcuts.
Parameters: current_user - one of current or all The Foldername or null on unsupported platforms.
This method initializes the object. It is used as a replacement for the contructor because of
the way it is instantiated through the TargetFactory.
Parameters: type - the type or classification of the program group in which the link should exist. Parameters: name - the name of the shortcut.
public void setIconLocation(String path, int index)(Code)
Sets the location of the icon that is shown for the shortcut on the desktop.
Parameters: path - a fully qualified file name of a file that contains the icon. Parameters: index - the index of the specific icon to use in the file. If there is only one icon inthe file, use an index of 0.
Sets the name shown in a menu or on the desktop for the link.
Parameters: name - The name that the link should display on a menu or on the desktop. Do not includea file extension.
Sets the show command that is passed to the target application when the link is activated.
The show command determines if the the window will be restored to the previous size,
minimized, maximized or visible at all.
Note:
Using 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.
Parameters: show - the show command. Valid settings are:
Determines if a specific instance of this class supports the creation of shortcuts. The use
of this method might seem odd, since one would not implement a flavor of this class that does
not actually support the creation of shortcuts. In other words all flavors will in all
probability return true. The only version that can be expected to return false is this class
itself, since it has no actual implementation for shortcut creation. This is left to OS
specific flavors. If the installer is launched on a unsupported OS there will be no
appropriate flavor of this class, which will cause this class itself to be instantiated. The
client code can now determine by calling this method if the active OS is supported and take
appropriate action.
true if the creation of shortcuts is supported, falseif this is not supported.