|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.izforge.izpack.util.os.Shortcut
com.izforge.izpack.util.os.Win_Shortcut
public class Win_Shortcut
This is the Microsoft Windows specific implementation of Shortcut.
| Field Summary |
|---|
| Fields inherited from class com.izforge.izpack.util.os.Shortcut |
|---|
ALL_USERS, APPLICATIONS, CURRENT_USER, DESKTOP, HIDE, MAXIMIZED, MINIMIZED, NORMAL, START_MENU, START_UP, uninstaller |
| Constructor Summary | |
|---|---|
Win_Shortcut(Librarian librarian)
Constructs a Win_Shortcut. |
|
| Method Summary | |
|---|---|
String |
getBasePath()
Returns the base path of the shortcut depending on type. |
String |
getFileName()
Returns the fully qualified file name under which the link is saved on disk. |
int |
getHotkey()
Gets the link hotKey |
String |
getIconLocation()
returns icon Location |
int |
getLinkType()
Gets the type of link types are: Shortcut.DESKTOP
Shortcut.APPLICATIONS
Shortcut.START_MENU
Shortcut.START_UP
maps from ShellLink-types to Shortcut-types. |
List<String> |
getProgramGroups(int userType)
Returns a list of currently existing program groups, based on the requested type. |
String |
getProgramsFolder(int current_user)
Gets the Folders where to place the program-groups and their shortcuts, for the given usertype. |
boolean |
getRunAsAdministrator()
Determines if the shortcut target should be run with administrator privileges. |
int |
getShowCommand()
|
int |
getUserType()
Gets the user type for the link |
String |
getWorkingDirectory()
Gets the working directory for the link target. |
void |
initialize(int type,
String name)
This method initializes the object. |
boolean |
multipleUsers()
Returns true if the target OS supports current user and all users. |
void |
save()
Saves this link. |
void |
setArguments(String arguments)
Sets the command line arguments that will be passed to the target when the link is activated. |
void |
setDescription(String description)
Sets the description string that is used to identify the link in a menu or on the desktop. |
void |
setHotkey(int hotkey)
Sets the link hotKey |
void |
setIconLocation(String path,
int index)
Sets the location of the icon that is shown for the shortcut on the desktop. |
void |
setLinkName(String name)
Sets the name shown in a menu or on the desktop for the link. |
void |
setLinkType(int type)
Sets the type of link |
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. |
void |
setShowCommand(int show)
Sets the show command that is passed to the target application when the link is activated. |
void |
setTargetPath(String path)
Sets the absolute path to the shortcut target. |
void |
setUserType(int type)
Sets the user type for the link |
void |
setWorkingDirectory(String dir)
Sets the working directory for the link target. |
boolean |
supported()
Signals that this flavor of
supports the creation of shortcuts. |
| Methods inherited from class com.izforge.izpack.util.os.Shortcut |
|---|
cleanUp, execPostAction, getCreateForAll, setCategories, setCreateForAll, setEncoding, setKdeSubstUID, setKdeUserName, setMimetype, setTerminal, setTerminalOptions, setTryExec, setType, setUninstaller, setURL |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Win_Shortcut(Librarian librarian)
librarian - the librarian| Method Detail |
|---|
public void initialize(int type,
String name)
throws Exception
TargetFactory.
initialize in class Shortcuttype - the type or classification of the program group in which the link should exist.
The following types are recognized: name - the name of the shortcut.
Exception
public String getBasePath()
throws Exception
getBasePath in class ShortcutExceptionsetLinkType(int),
translates from ShellLink-UserTypes to Shortcut-UserTypes.public List<String> getProgramGroups(int userType)
APPLICATIONS then all the names of the program groups in the
Start Menu\Programs menu would be returned.
getProgramGroups in class ShortcutuserType - the type of user for the program group set. (as Shortcut.utype)
Vector of String objects that represent the names of
the existing program groups. It is theoretically possible that this list is empty.Shortcut.APPLICATIONS,
Shortcut.START_MENUpublic String getFileName()
getFileName in class Shortcutpublic boolean multipleUsers()
true if the target OS supports current user and all users.
multipleUsers in class Shortcuttrue if the target OS supports current and all users.public boolean supported()
Shortcut
supports the creation of shortcuts.
supported in class Shortcuttruepublic void setArguments(String arguments)
setArguments in class Shortcutarguments - the command line argumentspublic void setDescription(String description)
setDescription in class Shortcutdescription - the descriptiojn string
public void setIconLocation(String path,
int index)
setIconLocation in class Shortcutpath - 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 String getIconLocation()
getIconLocation in class Shortcutpublic void setProgramGroup(String groupName)
setProgramGroup in class ShortcutgroupName - the name of the program group
public void setShowCommand(int show)
throws IllegalArgumentException
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.
setShowCommand in class Shortcutshow - the show command. Valid settings are: IllegalArgumentExceptioninternally maps from Shortcut. to ShellLink.public int getShowCommand()
getShowCommand in class Shortcutpublic void setTargetPath(String path)
setTargetPath in class Shortcutpath - the fully qualified file name of the targetpublic void setWorkingDirectory(String dir)
setWorkingDirectory in class Shortcutdir - the working directorypublic String getWorkingDirectory()
getWorkingDirectory in class Shortcutpublic void setLinkName(String name)
setLinkName in class Shortcutname - The name that the link should display on a menu or on the desktop. Do not include
a file extension.public int getLinkType()
getLinkType in class Shortcut
public void setLinkType(int type)
throws IllegalArgumentException,
UnsupportedEncodingException
setLinkType in class Shortcuttype - The type of link desired. The following values can be set: IllegalArgumentException - if an an invalid type is passed
UnsupportedEncodingExceptionpublic int getUserType()
getUserType in class ShortcutShortcut.CURRENT_USER,
Shortcut.ALL_USERSpublic void setUserType(int type)
setUserType in class Shortcuttype - the type of user for the link.Shortcut.CURRENT_USER,
if the linkPath for that type is empty, refuse to set.public void setRunAsAdministrator(boolean runAsAdministrator)
setRunAsAdministrator in class ShortcutrunAsAdministrator - if true, run the target with administrator privileges.public boolean getRunAsAdministrator()
getRunAsAdministrator in class Shortcuttrue, if the target will run with administrator privileges
public void save()
throws Exception
save in class ShortcutException - if problems are encounteredpublic int getHotkey()
getHotkey in class Shortcutpublic void setHotkey(int hotkey)
setHotkey in class Shortcuthotkey - incoming 2 byte hotkey is: high byte modifier: SHIFT = 0x01 CONTROL= 0x02 ALT = 0x04 EXT =
0x08
lower byte contains ascii letter. ie 0x0278 represents CTRL+x 0x068a represents CTRL+ALT+zpublic String getProgramsFolder(int current_user)
getProgramsFolder in class Shortcutcurrent_user - one of current or all
Shortcut.getProgramsFolder(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||