public class Unix_Shortcut extends Shortcut implements Unix_ShortcutConstants
Modifier and Type | Field and Description |
---|---|
private static String |
C
C = Comment = H+S = "# "
|
private String |
createdDirectory
internal String createdDirectory
|
private static String |
DESKTOP_EXT
DESKTOP_EXT = ".desktop"
|
private Boolean |
forAll
forAll = new Boolean(false): A flag to indicate that this should created for all users.
|
private static String |
H
H = "#"
|
private String |
itsApplnkFolder
internal String itsApplnkFolder = "applnk"
|
private String |
itsArguments
internal String itsArguments
|
private String |
itsDescription
internal String itsDescription
|
private String |
itsFileName
internal String itsFileName
|
private String |
itsGroupName
internal String itsGroupName
|
private int |
itsIconIndex
internal int itsIconIndex
|
private String |
itsIconPath
internal String itsIconPath
|
private String |
itsName
internal String itsName
|
private int |
itsShow
internal int itsShow
|
private String |
itsTargetPath
internal String itsTargetPath
|
private int |
itsType
internal int itsType
|
private int |
itsUserType
internal int itsUserType
|
private String |
itsWorkingDirectory
internal String itsWorkingDirectory
|
private static String |
N
N = "\n"
|
private Properties |
props
internal Properties Set
|
private static String |
QM
QM = "\"" : QuotationMark
|
private static String |
rev
rev = "$Revision: 1.9 $"
|
private static String |
S
S = " "
|
private static String |
template
template = ""
|
private static String |
version
version = "$Id: Unix_Shortcut.java,v 1.9 2005/07/27 08:57:07 jponge Exp $"
|
ALL_USERS, APPLICATIONS, CURRENT_USER, DESKTOP, HIDE, MAXIMIZED, MINIMIZED, NORMAL, START_MENU, START_UP
$$LANG_Comment, $$LANG_GenericName, $$LANG_Name, $Arguments, $Comment, $E_QUOT, $Encoding, $Exec, $GenericName, $Icon, $MimeType, $Name, $Options_For_Terminal, $P_QUOT, $Path, $ServiceTypes, $SwallowExec, $SwallowTitle, $Terminal, $Type, $URL, $X_KDE_SubstituteUID, $X_KDE_Username
Constructor and Description |
---|
Unix_Shortcut()
Creates a new Unix_Shortcut object.
|
Modifier and Type | Method and Description |
---|---|
static void |
copyTo(File inFile,
File outFile)
Copies the inFile file to outFile using cbuff as buffer.
|
String |
getDirectoryCreated()
Dummy
|
String |
getFileName()
Dummy
|
private String |
getKdeApplinkFolderName()
Gets the name of the applink folder for the currently used distribution.
|
private File |
getKdeBase(int userType)
Gets the KDEBasedir for the given User.
|
private File |
getKdeShareApplnkFolder(int userType)
Gets the kde/share/applink - Folder for the given user and for the currently known and
supported distribution.
|
Vector |
getProgramGroups(int userType)
Overridden compatibility method.
|
String |
getProgramsFolder(int current_user)
Gets the Programsfolder for the given User (non-Javadoc).
|
int |
getUserType()
Gets the Usertype of the Shortcut.
|
void |
initialize(int aType,
String aName)
Overridden Method
|
private void |
initProps()
This initialisizes all Properties Values with null.
|
static void |
main(String[] args)
Test Method
|
boolean |
multipleUsers()
overridden method
|
String |
replace()
Creates the Shortcut String which will be stored as File.
|
void |
save()
Creates and stores the shortcut-files.
|
void |
setArguments(String args)
Set the Commandline Arguments
|
void |
setDescription(String description)
Sets the Description
|
void |
setEncoding(String aEncoding)
Sets The Encoding
|
void |
setIconLocation(String path,
int index)
Sets The Icon Path
|
void |
setKdeSubstUID(String aKDESubstUID)
Sets The KDE Specific subst UID property
|
void |
setLinkName(String aName)
Sets the Name of this Shortcut
|
void |
setLinkType(int aType)
Sets the type of this Shortcut
|
void |
setMimetype(String aMimetype)
Sets the MimeType
|
void |
setProgramGroup(String aGroupName)
Sets the ProgramGroup
|
void |
setShowCommand(int show)
Sets the ShowMode
|
void |
setTargetPath(String aPath)
Sets The TargetPath
|
void |
setTerminal(String trueFalseOrNothing)
Sets the terminal
|
void |
setTerminalOptions(String someTerminalOptions)
Sets the terminal options
|
void |
setType(String aType)
Sets the Shortcut type (one of Application, Link or Device)
|
void |
setURL(String anUrl)
Sets the Url for type Link.
|
void |
setUserType(int aUserType)
Sets the usertype.
|
void |
setWorkingDirectory(String aDirectory)
Sets the working-directory
|
boolean |
supported()
This indicates that Unix will be supported.
|
String |
toString()
Dumps the Name to console.
|
private File |
writeShortCut(String target,
String shortCutDef)
Writes the given Shortcutdefinition to the given Target.
|
getBasePath, getCreateForAll, getHotkey, getIconLocation, getLinkType, getShowCommand, getWorkingDirectory, setCreateForAll, setHotkey
private static String version
private static String DESKTOP_EXT
private static final String N
private static final String H
private static final String S
private static final String C
private static final String QM
private String createdDirectory
private int itsShow
private int itsUserType
private int itsType
private int itsIconIndex
private String itsWorkingDirectory
private String itsGroupName
private String itsTargetPath
private String itsIconPath
private String itsDescription
private String itsArguments
private String itsFileName
private String itsApplnkFolder
private Properties props
public Unix_Shortcut()
private void initProps()
public void initialize(int aType, String aName) throws Exception
initialize
in class Shortcut
aType
- the type or classification of the program group in which the link should exist.aName
- the name of the shortcut.Exception
Shortcut.initialize(int, java.lang.String)
public boolean supported()
supported
in class Shortcut
true
if the creation of shortcuts is supported, false
if this is not supported.Shortcut.supported()
public String getDirectoryCreated()
getDirectoryCreated
in class Shortcut
null
.Shortcut.getDirectoryCreated()
public String getFileName()
getFileName
in class Shortcut
String
Shortcut.getFileName()
public Vector getProgramGroups(int userType)
getProgramGroups
in class Shortcut
userType
- the type of user for the program group set.Vector
of String
objects that represent the names of
the existing program groups. It is theoretically possible that this list is empty.Shortcut.getProgramGroups(int)
public String getProgramsFolder(int current_user)
getProgramsFolder
in class Shortcut
current_user
- one of current or allShortcut.getProgramsFolder(int)
private File getKdeShareApplnkFolder(int userType)
userType
- to get for.private String getKdeApplinkFolderName()
private File getKdeBase(int userType)
userType
- one of root or regular userpublic boolean multipleUsers()
multipleUsers
in class Shortcut
Shortcut.multipleUsers()
public void save() throws Exception
save
in class Shortcut
Exception
- if problems are encounteredShortcut.save()
public static void copyTo(File inFile, File outFile) throws IOException
inFile
- The File to read from.outFile
- The targetFile to write to.IOException
- If an IO Error occursprivate File writeShortCut(String target, String shortCutDef)
target
- shortCutDef
- public void setArguments(String args)
setArguments
in class Shortcut
args
- the command line argumentsShortcut.setArguments(java.lang.String)
public void setDescription(String description)
setDescription
in class Shortcut
description
- the descriptiojn stringShortcut.setDescription(java.lang.String)
public void setIconLocation(String path, int index)
setIconLocation
in class Shortcut
path
- 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.Shortcut.setIconLocation(java.lang.String, int)
public void setLinkName(String aName)
setLinkName
in class Shortcut
aName
- The name that the link should display on a menu or on the desktop. Do not include
a file extension.Shortcut.setLinkName(java.lang.String)
public void setLinkType(int aType) throws IllegalArgumentException
setLinkType
in class Shortcut
aType
- The type of link desired. The following values can be set:IllegalArgumentException
- if an an invalid type is passedShortcut.setLinkType(int)
public void setProgramGroup(String aGroupName)
setProgramGroup
in class Shortcut
aGroupName
- the name of the program groupShortcut.setProgramGroup(java.lang.String)
public void setShowCommand(int show)
setShowCommand
in class Shortcut
show
- the show command. Valid settings are: Shortcut.setShowCommand(int)
public void setTargetPath(String aPath)
setTargetPath
in class Shortcut
aPath
- the fully qualified file name of the targetShortcut.setTargetPath(java.lang.String)
public void setUserType(int aUserType)
setUserType
in class Shortcut
aUserType
- the type of user for the link.Shortcut.setUserType(int)
public void setWorkingDirectory(String aDirectory)
setWorkingDirectory
in class Shortcut
aDirectory
- the working directoryShortcut.setWorkingDirectory(java.lang.String)
public String toString()
toString
in class Object
Object.toString()
public String replace()
public void setEncoding(String aEncoding)
setEncoding
in class Shortcut
Shortcut.setEncoding(java.lang.String)
public void setKdeSubstUID(String aKDESubstUID)
setKdeSubstUID
in class Shortcut
Shortcut.setKdeSubstUID(java.lang.String)
public void setMimetype(String aMimetype)
setMimetype
in class Shortcut
Shortcut.setMimetype(java.lang.String)
public void setTerminal(String trueFalseOrNothing)
setTerminal
in class Shortcut
Shortcut.setTerminal(java.lang.String)
public void setTerminalOptions(String someTerminalOptions)
setTerminalOptions
in class Shortcut
Shortcut.setTerminalOptions(java.lang.String)
public void setType(String aType)
setType
in class Shortcut
Shortcut.setType(java.lang.String)
public void setURL(String anUrl)
setURL
in class Shortcut
Shortcut.setURL(java.lang.String)
public int getUserType()
getUserType
in class Shortcut
Shortcut.getUserType()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses