public class Win_Shortcut extends Shortcut
Shortcut.| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
CLASS |
private static java.lang.String |
myClass |
private ShellLink |
shortcut |
private static boolean |
SUPPORTED
SUPPORTED = true
|
ALL_USERS, APPLICATIONS, CURRENT_USER, DESKTOP, HIDE, MAXIMIZED, MINIMIZED, NORMAL, START_MENU, START_UP| Constructor and Description |
|---|
Win_Shortcut() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBasePath()
Returns the base path of the shortcut depending on type.
|
java.lang.String |
getDirectoryCreated()
Returns the path of the directory where the link file is stored, if it was necessary during
the previous save operation to create the directory.
|
java.lang.String |
getFileName()
Returns the fully qualified file name under which the link is saved on disk.
|
int |
getHotkey()
Gets the link hotKey
|
java.lang.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. |
java.util.Vector |
getProgramGroups(int userType)
Returns a list of currently existing program groups, based on the requested type.
|
java.lang.String |
getProgramsFolder(int current_user)
Gets the Folders where to place the program-groups and their shortcuts, for the given
usertype.
|
int |
getShowCommand() |
int |
getUserType()
Gets the user type for the link
|
java.lang.String |
getWorkingDirectory()
Gets the working directory for the link target.
|
void |
initialize(int type,
java.lang.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(java.lang.String arguments)
Sets the command line arguments that will be passed to the target when the link is activated.
|
void |
setDescription(java.lang.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(java.lang.String path,
int index)
Sets the location of the icon that is shown for the shortcut on the desktop.
|
void |
setLinkName(java.lang.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(java.lang.String groupName)
Sets the name of the program group this ShellLinbk should be placed in.
|
void |
setShowCommand(int show)
Sets the show command that is passed to the target application when the link is activated.
|
void |
setTargetPath(java.lang.String path)
Sets the absolute path to the shortcut target.
|
void |
setUserType(int type)
Sets the user type for the link
|
void |
setWorkingDirectory(java.lang.String dir)
Sets the working directory for the link target.
|
boolean |
supported()
Signals that this flavor of
supports the creation of shortcuts. |
getCreateForAll, setCreateForAll, setEncoding, setKdeSubstUID, setMimetype, setTerminal, setTerminalOptions, setType, setURLprivate ShellLink shortcut
private static java.lang.String myClass
private static final java.lang.String CLASS
private static final boolean SUPPORTED
public void initialize(int type,
java.lang.String name)
throws java.lang.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.java.lang.Exceptionpublic java.lang.String getBasePath()
throws java.lang.Exception
getBasePath in class Shortcutjava.lang.ExceptionsetLinkType(int),
translates from ShellLink-UserTypes to Shortcut-UserTypes.public java.util.Vector 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 java.lang.String getFileName()
getFileName in class Shortcutpublic java.lang.String getDirectoryCreated()
null
if no save operation was carried out or there was no need to create a directory during the
previous save operation.getDirectoryCreated in class Shortcutnull if no
save operation was carried out or there was no need to create a directory during the previous
save operation.public 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.public void setArguments(java.lang.String arguments)
setArguments in class Shortcutarguments - the command line argumentspublic void setDescription(java.lang.String description)
setDescription in class Shortcutdescription - the descriptiojn stringpublic void setIconLocation(java.lang.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 java.lang.String getIconLocation()
getIconLocation in class Shortcutpublic void setProgramGroup(java.lang.String groupName)
setProgramGroup in class ShortcutgroupName - the name of the program grouppublic void setShowCommand(int show)
throws java.lang.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: java.lang.IllegalArgumentExceptioninternally maps from Shortcut. to ShellLink.public int getShowCommand()
getShowCommand in class Shortcutpublic void setTargetPath(java.lang.String path)
setTargetPath in class Shortcutpath - the fully qualified file name of the targetpublic void setWorkingDirectory(java.lang.String dir)
setWorkingDirectory in class Shortcutdir - the working directorypublic java.lang.String getWorkingDirectory()
getWorkingDirectory in class Shortcutpublic void setLinkName(java.lang.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 Shortcutpublic void setLinkType(int type)
throws java.lang.IllegalArgumentException,
java.io.UnsupportedEncodingException
setLinkType in class Shortcuttype - The type of link desired. The following values can be set: java.lang.IllegalArgumentException - if an an invalid type is passedjava.io.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 save()
throws java.lang.Exception
public int getHotkey()
public void setHotkey(int hotkey)
public java.lang.String getProgramsFolder(int current_user)
getProgramsFolder in class Shortcutcurrent_user - one of current or alljava.io.UnsupportedEncodingExceptionShortcut.getProgramsFolder(int)