001: /*
002: * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
003: *
004: * http://izpack.org/
005: * http://izpack.codehaus.org/
006: *
007: * Copyright 2002 Elmar Grom
008: *
009: * Licensed under the Apache License, Version 2.0 (the "License");
010: * you may not use this file except in compliance with the License.
011: * You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing, software
016: * distributed under the License is distributed on an "AS IS" BASIS,
017: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018: * See the License for the specific language governing permissions and
019: * limitations under the License.
020: */
021:
022: package com.izforge.izpack.panels;
023:
024: /*---------------------------------------------------------------------------*/
025: /**
026: * This class serves as a data structure in
027: * <code>{@link com.izforge.izpack.panels.ShortcutPanel}</code>
028: *
029: * @version 0.0.1 / 4/1/02
030: * @author Elmar Grom
031: */
032: /*---------------------------------------------------------------------------*/
033: public class ShortcutData implements Cloneable {
034:
035: public String name;
036:
037: public String description;
038:
039: public String target;
040:
041: public String commandLine;
042:
043: public int type;
044:
045: public int userType;
046:
047: public boolean addToGroup = false;
048:
049: public String subgroup;
050:
051: public String iconFile;
052:
053: public int iconIndex;
054:
055: public int initialState;
056:
057: public String workingDirectory;
058:
059: public String deskTopEntryLinux_MimeType;
060:
061: public String deskTopEntryLinux_Terminal;
062:
063: public String deskTopEntryLinux_TerminalOptions;
064:
065: public String deskTopEntryLinux_Type;
066:
067: public String deskTopEntryLinux_URL;
068:
069: public String deskTopEntryLinux_Encoding;
070:
071: public String deskTopEntryLinux_X_KDE_SubstituteUID;
072:
073: public String deskTopEntryLinux_X_KDE_UserName;
074:
075: /** Linux Common Menu Categories */
076: public String Categories;
077:
078: /** Linux Common Menu TryExec */
079: public String TryExec;
080:
081: public Boolean createForAll;
082:
083: /*--------------------------------------------------------------------------*/
084: /**
085: * Returns a clone (copy) of this object.
086: *
087: * @return a copy of this object
088: * @throws OutOfMemoryError
089: */
090: /*--------------------------------------------------------------------------*/
091: public Object clone() throws OutOfMemoryError {
092: ShortcutData result = new ShortcutData();
093:
094: result.type = type;
095: result.userType = userType;
096: result.iconIndex = iconIndex;
097: result.initialState = initialState;
098: result.addToGroup = addToGroup;
099:
100: result.name = cloneString(name);
101: result.description = cloneString(description);
102: result.target = cloneString(target);
103: result.commandLine = cloneString(commandLine);
104: result.subgroup = cloneString(subgroup);
105: result.iconFile = cloneString(iconFile);
106: result.workingDirectory = cloneString(workingDirectory);
107: result.deskTopEntryLinux_MimeType = cloneString(deskTopEntryLinux_MimeType);
108: result.deskTopEntryLinux_Terminal = cloneString(deskTopEntryLinux_Terminal);
109: result.deskTopEntryLinux_TerminalOptions = cloneString(deskTopEntryLinux_TerminalOptions);
110: result.deskTopEntryLinux_Type = cloneString(deskTopEntryLinux_Type);
111: result.deskTopEntryLinux_URL = cloneString(deskTopEntryLinux_URL);
112: result.deskTopEntryLinux_Encoding = cloneString(deskTopEntryLinux_Encoding);
113: result.deskTopEntryLinux_X_KDE_SubstituteUID = cloneString(deskTopEntryLinux_X_KDE_SubstituteUID);
114: result.deskTopEntryLinux_X_KDE_UserName = cloneString(deskTopEntryLinux_X_KDE_UserName);
115:
116: result.Categories = cloneString(Categories);
117: result.TryExec = cloneString(TryExec);
118:
119: result.createForAll = createForAll.booleanValue();
120: return (result);
121: }
122:
123: /*--------------------------------------------------------------------------*/
124: /**
125: * Clones a <code>String</code>, that is it makes a copy of the content, not of the
126: * reference. In addition, if the original is <code>null</code> then an empty
127: * <code>String</code> is returned rather than <code>null</code>.
128: *
129: * @param original the <code>String</code> to clone
130: *
131: * @return a clone of the original
132: */
133: /*--------------------------------------------------------------------------*/
134: private String cloneString(String original) {
135: if (original == null) {
136: return ("");
137: } else {
138: return (original);
139: }
140: }
141: }
142: /*---------------------------------------------------------------------------*/
|