org.af.commons.install
Class WindowsDesktopShortcut

java.lang.Object
  extended by org.af.commons.install.DesktopShortcut
      extended by org.af.commons.install.WindowsDesktopShortcut

public class WindowsDesktopShortcut
extends DesktopShortcut

Creates a Windows desktop URL entry.


Constructor Summary
WindowsDesktopShortcut(File shortcutDir, String name, File exec)
          Constructor
WindowsDesktopShortcut(File shortcutDir, String name, String exec)
          Constructor
 
Method Summary
 void create()
          Creates the shortcut.
 void setHotkey(String hotkey)
          Set HotKey like objSC.HotKey = "CTRL+ALT+SHIFT+X";
 void setIconpath(String iconpath, int nr)
          Sets the icon for the desktop entry like "notepad.exe, 0".
 void setWindowsstyle(Integer windowsstyle)
          Set WindowStyle like objSC.WindowStyle = 1
 
Methods inherited from class org.af.commons.install.DesktopShortcut
addParameter, addParameter, getDescription, getExec, getIconpath, getName, getShortcutDir, getWorkingDir, setDescription, setIconpath, setIconpath, setWorkingDir, setWorkingDir
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowsDesktopShortcut

public WindowsDesktopShortcut(File shortcutDir,
                              String name,
                              File exec)
Constructor

Parameters:
shortcutDir - Directory where shortcut is created.
name - Visible name of the shortcut
exec - The targetted executable for this shortcut.

WindowsDesktopShortcut

public WindowsDesktopShortcut(File shortcutDir,
                              String name,
                              String exec)
Constructor

Parameters:
shortcutDir - Directory where shortcut is created.
name - Visible name of the shortcut
exec - The targetted executable for this shortcut. You can set an executable on the path here, but in general you should use the constructor with the File argument.
Method Detail

setHotkey

public void setHotkey(String hotkey)
Set HotKey like objSC.HotKey = "CTRL+ALT+SHIFT+X";


setWindowsstyle

public void setWindowsstyle(Integer windowsstyle)
Set WindowStyle like objSC.WindowStyle = 1

Parameters:
windowsstyle - 1 = normal; 3 = maximize window; 7 = minimize

setIconpath

public void setIconpath(String iconpath,
                        int nr)
Sets the icon for the desktop entry like "notepad.exe, 0".

Parameters:
iconpath - Absolute path which will be used to specify the icon for the desktop entry.

create

public void create()
            throws IOException
Description copied from class: DesktopShortcut
Creates the shortcut. Call this once after you have passed all relevant settings.

Specified by:
create in class DesktopShortcut
Throws:
IOException - If something bad happens while writing the link.