|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ovanttasks.ovnative.win32.LnkFile
public class LnkFile
LnkFile reads and writes Windows Shortcut files in the .lnk format. It can be used to create or read .lnk files which are used by Microsoft for Shortcuts (the IShellLink Interface). The destination (path) can be executable (cmd.exe) or normal files (text files and more). They will be opend / executed by the shell.
The HOTKEYF_XXX constants are taken from (MinGW) commctrl.h.
The SW_SHOWXX constants are taken from (MinGW) winuser.h.
Nested Class Summary | |
---|---|
static class |
LnkFile.ShowCmd
The inital state of the window. |
Constructor Summary | |
---|---|
LnkFile(File lnkFile,
boolean load)
Create a new LnkFile instance for a specified location. |
|
LnkFile(String directory,
String name,
boolean load)
Create a new LnkFile instance for a specified location. |
Method Summary | |
---|---|
String |
getArguments()
Returns the arguments of the shortcut. |
String |
getHotkey()
Returns the hotkey. |
int |
getIconIndex()
Returns the icon index for this shortcut. |
String |
getIconLocation()
Returns the icon location for this shortcut. |
LnkFile.ShowCmd |
getShowState()
Returns the initil state in wich the window will be appear on screen. |
File |
getSrcFile()
Returns the source of the Link. |
String |
getTargetFile()
Returns the taget for this shortcut. |
String |
getToolTipText()
Returns the toolTipText for this shortcut. |
String |
getWorkingDirectory()
Returns the working directory for this shortcut. |
void |
load()
Loads the link data from the filesystem. |
void |
resolve()
Resolve the link with UI interaction |
void |
save()
Save the link |
void |
save(String directory,
String name)
Save the link |
void |
setArguments(String arguments)
Set the Arguments |
void |
setHotkey(String hotkey)
Sets the hotkey. |
void |
setIcon(String iconLocation,
int iconIndex)
Set the icon location for this shortcut. |
void |
setShowState(LnkFile.ShowCmd swShow)
Sets the initial state in wich the window will be appear on screen. |
void |
setTargetFile(String targetFile)
Set the target for this shortcut. |
void |
setToolTipText(String toolTipText)
Set the toolTipText for this shortcut. |
void |
setWorkingDirectory(String workingDirectory)
Set the working directory for this shortcut. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LnkFile(String directory, String name, boolean load)
LnkFile
instance for a specified location.
File.File(java.lang.String, java.lang.String)
If load
is true
the instance of
LnkFile
is initialized with the values from the file.
The native library is also loaded.
directory
- The parent pathname stringname
- The child pathnameload
- wether or not load the data from existing file.public LnkFile(File lnkFile, boolean load)
LnkFile
instance for a specified location.
If load
is true
the instance of
LnkFile
is initialized with the values from the lnkFile
.
The native library is also loaded.
lnkFile
- The lnkFile to useload
- wether or not load the data from existing file.Method Detail |
---|
public LnkFile.ShowCmd getShowState()
public void setShowState(LnkFile.ShowCmd swShow)
swShow
- The state to set.public String getArguments()
path
), the arguments
specified here will be passed to the executable.
public String getToolTipText()
public File getSrcFile()
public int getIconIndex()
public String getIconLocation()
iconIndex
indicates the index of the icon within the file.
public String getTargetFile()
public String getWorkingDirectory()
public void load() throws Win32Exception
Win32Exception
public void resolve() throws Win32Exception
Win32Exception
public void save(String directory, String name) throws Win32Exception
directory
- name
-
Win32Exception
public void save() throws Win32Exception
Win32Exception
public void setArguments(String arguments)
arguments
- the arguments to set.public void setToolTipText(String toolTipText)
toolTipText
- The tooltiptext to displaypublic void setIcon(String iconLocation, int iconIndex)
iconindex
is the index in the file.
Both the file and the index into the file must be specified.
iconLocation
- The path to the file.iconIndex
- The index of the icon within the file.public void setTargetFile(String targetFile)
arguments
and a workingDirectory
can be provided.
targetFile
- The target of this linkpublic void setWorkingDirectory(String workingDirectory)
workingDirectory
is the directory in which the executable
given by path
will be executed.
workingDirectory
- The working directorypublic void setHotkey(String hotkey)
path>/code> with keystoken.
The following modifiers will be supported:
-
- Alt the Alt key.
- Ctrl the Ctrl key,
- Shift the Shift key
Each separated by " + ".
Example: Ctrl + Shift + Alt + A.
- Parameters:
hotkey
- The hotkey as String.
public String getHotkey()
setHotKey
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |