KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > memoire > vainstall > VAShortcutEntry


1 /**
2  * Created on Dec 28, 2004
3  * @license GPL 2
4  */

5 package com.memoire.vainstall;
6
7 import java.io.File JavaDoc;
8
9
10 public class VAShortcutEntry{
11     private String JavaDoc Comment_;
12     private String JavaDoc type_="Application";
13     private String JavaDoc exePath_;
14     private String JavaDoc iconPath_;
15     String JavaDoc workingDirectory_;
16     private boolean launchInTerminal_;
17     private String JavaDoc name_;
18     boolean createOnDesktop_=true;
19     boolean isUninstall_;
20     /**
21      * The name of the icon is built with the path.
22      * @param _exePath the path to the exe
23      */

24     public VAShortcutEntry(String JavaDoc _exePath){
25     name_=new File JavaDoc(_exePath).getName();
26     //if present, we remove the file extension
27
int idx=name_.indexOf('.');
28     if(idx>0) name_=name_.substring(0,idx);
29     exePath_=_exePath;
30     if(exePath_==null) throw new IllegalArgumentException JavaDoc("Exe path must not be null");
31     }
32     public VAShortcutEntry(String JavaDoc _name,String JavaDoc _exePath){
33         name_=_name;
34         exePath_=_exePath;
35         if(exePath_==null) throw new IllegalArgumentException JavaDoc("Exe path must not be null");
36         if(name_==null) throw new IllegalArgumentException JavaDoc("Name must not be null");
37     }
38     /**
39      * @return Returns the comment.
40      */

41     public String JavaDoc getComment() {
42         return Comment_;
43     }
44     /**
45      * @return Returns the exePath.
46      */

47     public String JavaDoc getExePath() {
48         return exePath_;
49     }
50     /**
51      * @return Returns the iconPath.
52      */

53     public String JavaDoc getIconPath() {
54         return iconPath_;
55     }
56     /**
57      * @return Returns the name.
58      */

59     public String JavaDoc getName() {
60         return name_;
61     }
62     /**
63      * @return Returns the launchInTerminal.
64      */

65     public boolean isLaunchInTerminal() {
66         return launchInTerminal_;
67     }
68     /**
69      * @param _comment The comment to set.
70      */

71     public void setComment(String JavaDoc _comment) {
72         Comment_ = _comment;
73     }
74     /**
75      * @param _exePath The exePath to set.
76      */

77     public void setExePath(String JavaDoc _exePath) {
78         if(_exePath==null) throw new IllegalArgumentException JavaDoc("exe path must not be null");
79         exePath_ = _exePath;
80     }
81     /**
82      * @param _iconPath The iconPath to set.
83      */

84     public void setIconPath(String JavaDoc _iconPath) {
85         iconPath_ = _iconPath;
86     }
87     /**
88      * @param _launchInTerminal The launchInTerminal to set.
89      */

90     public void setLaunchInTerminal(boolean _launchInTerminal) {
91         launchInTerminal_ = _launchInTerminal;
92     }
93     /**
94      * @param _name The name to set.
95      */

96     public void setName(String JavaDoc _name) {
97         if(_name==null) throw new IllegalArgumentException JavaDoc("Icon's name must not be null");
98         name_ = _name;
99     }
100     
101     /**
102      * @return Returns the type.
103      */

104     public String JavaDoc getType() {
105         return type_;
106     }
107     /**
108      * @param _type The type to set.
109      */

110     public void setType(String JavaDoc _type) {
111         type_ = _type;
112     }
113     /**
114      * @return Returns the workingDirectory.
115      */

116     public String JavaDoc getWorkingDirectory() {
117         return workingDirectory_;
118     }
119     /**
120      * @param _workingDirectory The workingDirectory to set.
121      */

122     public void setWorkingDirectory(String JavaDoc _workingDirectory) {
123         workingDirectory_ = _workingDirectory;
124     }
125     /**
126      * @return Returns the createOnDesktop.
127      */

128     public final boolean isCreateOnDesktop() {
129         return createOnDesktop_;
130     }
131     /**
132      * @param _createOnDesktop The createOnDesktop to set.
133      */

134     public final void setCreateOnDesktop(boolean _createOnDesktop) {
135         createOnDesktop_ = _createOnDesktop;
136     }
137     /**
138      * @return Returns the isUninstall.
139      */

140     public final boolean isUninstall() {
141         return isUninstall_;
142     }
143     /**
144      * @param _isUninstall The isUninstall to set.
145      */

146     public final void setUninstall(boolean _isUninstall) {
147         isUninstall_ = _isUninstall;
148     }
149 }
Popular Tags