KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > panels > ShortcutData


1 /*
2  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
3  *
4  * http://www.izforge.com/izpack/
5  * http://developer.berlios.de/projects/izpack/
6  *
7  * Copyright 2002 Elmar Grom
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */

21
22 package com.izforge.izpack.panels;
23
24 /*---------------------------------------------------------------------------*/
25 /**
26  * This class serves as a data structure in
27  * <code>{@link com.izforge.izpack.panels.ShortcutPanel}</code>
28  *
29  * @version 0.0.1 / 4/1/02
30  * @author Elmar Grom
31  */

32 /*---------------------------------------------------------------------------*/
33 public class ShortcutData implements Cloneable JavaDoc
34 {
35
36     public String JavaDoc name;
37
38     public String JavaDoc description;
39
40     public String JavaDoc target;
41
42     public String JavaDoc commandLine;
43
44     public int type;
45
46     public int userType;
47
48     public boolean addToGroup = false;
49
50     public String JavaDoc subgroup;
51
52     public String JavaDoc iconFile;
53
54     public int iconIndex;
55
56     public int initialState;
57
58     public String JavaDoc workingDirectory;
59
60     public String JavaDoc deskTopEntryLinux_MimeType;
61
62     public String JavaDoc deskTopEntryLinux_Terminal;
63
64     public String JavaDoc deskTopEntryLinux_TerminalOptions;
65
66     public String JavaDoc deskTopEntryLinux_Type;
67
68     public String JavaDoc deskTopEntryLinux_URL;
69
70     public String JavaDoc deskTopEntryLinux_Encoding;
71
72     public String JavaDoc deskTopEntryLinux_X_KDE_SubstituteUID;
73     
74     public String JavaDoc deskTopEntryLinux_X_KDE_UserName;
75     
76     /** Linux Common Menu Categories */
77     public String JavaDoc Categories ;
78     
79     /** Linux Common Menu TryExec */
80     public String JavaDoc TryExec;
81
82     public Boolean JavaDoc createForAll;
83     
84      
85
86     /*--------------------------------------------------------------------------*/
87     /**
88      * Returns a clone (copy) of this object.
89      *
90      * @return a copy of this object
91      * @throws OutOfMemoryError
92      */

93     /*--------------------------------------------------------------------------*/
94     public Object JavaDoc clone() throws OutOfMemoryError JavaDoc
95     {
96         ShortcutData result = new ShortcutData();
97
98         result.type = type;
99         result.userType = userType;
100         result.iconIndex = iconIndex;
101         result.initialState = initialState;
102         result.addToGroup = addToGroup;
103
104         result.name = cloneString(name);
105         result.description = cloneString(description);
106         result.target = cloneString(target);
107         result.commandLine = cloneString(commandLine);
108         result.subgroup = cloneString(subgroup);
109         result.iconFile = cloneString(iconFile);
110         result.workingDirectory = cloneString(workingDirectory);
111         result.deskTopEntryLinux_MimeType = cloneString(deskTopEntryLinux_MimeType);
112         result.deskTopEntryLinux_Terminal = cloneString(deskTopEntryLinux_Terminal);
113         result.deskTopEntryLinux_TerminalOptions = cloneString(deskTopEntryLinux_TerminalOptions);
114         result.deskTopEntryLinux_Type = cloneString(deskTopEntryLinux_Type);
115         result.deskTopEntryLinux_URL = cloneString(deskTopEntryLinux_URL);
116         result.deskTopEntryLinux_Encoding = cloneString(deskTopEntryLinux_Encoding);
117         result.deskTopEntryLinux_X_KDE_SubstituteUID = cloneString(deskTopEntryLinux_X_KDE_SubstituteUID);
118         result.deskTopEntryLinux_X_KDE_UserName = cloneString(deskTopEntryLinux_X_KDE_UserName);
119         
120         result.Categories = cloneString(Categories);
121         result.TryExec = cloneString(TryExec);
122         
123         result.createForAll = Boolean.valueOf(createForAll.booleanValue());
124         return (result);
125     }
126
127     /*--------------------------------------------------------------------------*/
128     /**
129      * Clones a <code>String</code>, that is it makes a copy of the content, not of the
130      * reference. In addition, if the original is <code>null</code> then an empty
131      * <code>String</code> is returned rather than <code>null</code>.
132      *
133      * @param original the <code>String</code> to clone
134      *
135      * @return a clone of the original
136      */

137     /*--------------------------------------------------------------------------*/
138     private String JavaDoc cloneString(String JavaDoc original)
139     {
140         if (original == null)
141         {
142             return ("");
143         }
144         else
145         {
146             return (original);
147         }
148     }
149 }
150 /*---------------------------------------------------------------------------*/
151
152
Popular Tags