org.af.commons.install
Class FreeDesktopShortcut

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

public class FreeDesktopShortcut
extends DesktopShortcut

Creates desktop entries according to the "Desktop Entry Specification 1.0" of freedesktop.org, which is implemented for example by KDE and GNOME. See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html


Constructor Summary
FreeDesktopShortcut(File shortcutDir, String name, File exec)
          Constructor
FreeDesktopShortcut(File shortcutDir, String name, String exec)
          Constructor
 
Method Summary
 void create()
          Creates the shortcut.
 String getGenericname()
          Returns the generic name for this shortcut.
 boolean isTerminal()
          Should the targeted executable be executed in the terminal?
 void setGenericname(String genericname)
          Sets the generic name for this shortcut.
 void setTerminal(boolean terminal)
          Set whether the targeted executable be executed in the terminal.
 
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

FreeDesktopShortcut

public FreeDesktopShortcut(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.

FreeDesktopShortcut

public FreeDesktopShortcut(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

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.

getGenericname

public String getGenericname()
Returns the generic name for this shortcut.

Returns:
The generic name for this shortcut.

setGenericname

public void setGenericname(String genericname)
Sets the generic name for this shortcut.

Parameters:
genericname - The generic name for this shortcut.

isTerminal

public boolean isTerminal()
Should the targeted executable be executed in the terminal?

Returns:
true iff the targeted executable should be executed in the terminal.

setTerminal

public void setTerminal(boolean terminal)
Set whether the targeted executable be executed in the terminal.

Parameters:
terminal - true iff the targeted executable should be executed in the terminal.