root / import / ext3D / trunk / install-extension3d / IzPack / src / lib / com / izforge / izpack / panels / ShortcutData.java @ 15280
History | View | Annotate | Download (4.44 KB)
1 |
/*
|
---|---|
2 |
* IzPack version 3.1.0 pre2 (build 2002.10.19)
|
3 |
* Copyright (C) 2002 Elmar Grom
|
4 |
*
|
5 |
* File : ShortcutData.java
|
6 |
* Description : This class is used as data structure in ShortcutPanel
|
7 |
* Author's email : elmar@grom.net
|
8 |
* Author's Website : http://www.izforge.com
|
9 |
*
|
10 |
* This program is free software; you can redistribute it and/or
|
11 |
* modify it under the terms of the GNU General Public License
|
12 |
* as published by the Free Software Foundation; either version 2
|
13 |
* of the License, or any later version.
|
14 |
*
|
15 |
* This program is distributed in the hope that it will be useful,
|
16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
* GNU General Public License for more details.
|
19 |
*
|
20 |
* You should have received a copy of the GNU General Public License
|
21 |
* along with this program; if not, write to the Free Software
|
22 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
23 |
*/
|
24 |
|
25 |
package com.izforge.izpack.panels; |
26 |
|
27 |
|
28 |
/*---------------------------------------------------------------------------*/
|
29 |
/**
|
30 |
* This class serves as a data structure in <code>{@link com.izforge.izpack.panels.ShortcutPanel}</code>
|
31 |
*
|
32 |
* @version 0.0.1 / 4/1/02
|
33 |
* @author Elmar Grom
|
34 |
*/
|
35 |
/*---------------------------------------------------------------------------*/
|
36 |
public class ShortcutData implements Cloneable |
37 |
{ |
38 |
public String name; |
39 |
public String description; |
40 |
public String target; |
41 |
public String commandLine; |
42 |
public int type; |
43 |
public boolean addToGroup = false; |
44 |
public String subgroup; |
45 |
public String iconFile; |
46 |
public int iconIndex; |
47 |
public int initialState; |
48 |
public String workingDirectory; |
49 |
|
50 |
public String deskTopEntryLinux_MimeType; |
51 |
public String deskTopEntryLinux_Terminal; |
52 |
public String deskTopEntryLinux_TerminalOptions; |
53 |
public String deskTopEntryLinux_Type; |
54 |
public String deskTopEntryLinux_URL; |
55 |
public String deskTopEntryLinux_Encoding; |
56 |
public String deskTopEntryLinux_X_KDE_SubstituteUID; |
57 |
|
58 |
/*--------------------------------------------------------------------------*/
|
59 |
/**
|
60 |
* Returns a clone (copy) of this object.
|
61 |
*
|
62 |
* @return a copy of this object
|
63 |
* @throws CloneNotSupportedException
|
64 |
*/
|
65 |
/*--------------------------------------------------------------------------*/
|
66 |
public Object clone () throws OutOfMemoryError |
67 |
{ |
68 |
ShortcutData result = new ShortcutData ();
|
69 |
|
70 |
result.type = type; |
71 |
result.iconIndex = iconIndex; |
72 |
result.initialState = initialState; |
73 |
result.addToGroup = addToGroup; |
74 |
|
75 |
result.name = cloneString (name); |
76 |
result.description = cloneString (description); |
77 |
result.target = cloneString (target); |
78 |
result.commandLine = cloneString (commandLine); |
79 |
result.subgroup = cloneString (subgroup); |
80 |
result.iconFile = cloneString (iconFile); |
81 |
result.workingDirectory = cloneString (workingDirectory); |
82 |
result.deskTopEntryLinux_MimeType = cloneString( deskTopEntryLinux_MimeType ); |
83 |
result.deskTopEntryLinux_Terminal = cloneString( deskTopEntryLinux_Terminal ); |
84 |
result.deskTopEntryLinux_TerminalOptions = cloneString( deskTopEntryLinux_TerminalOptions ); |
85 |
result.deskTopEntryLinux_Type = cloneString( deskTopEntryLinux_Type ); |
86 |
result.deskTopEntryLinux_URL = cloneString( deskTopEntryLinux_URL ); |
87 |
result.deskTopEntryLinux_Encoding = cloneString( deskTopEntryLinux_Encoding ); |
88 |
result.deskTopEntryLinux_X_KDE_SubstituteUID = cloneString( deskTopEntryLinux_X_KDE_SubstituteUID ); |
89 |
return (result);
|
90 |
} |
91 |
/*--------------------------------------------------------------------------*/
|
92 |
/**
|
93 |
* Clones a <code>String</code>, that is it makes a copy of the content, not
|
94 |
* of the reference. In addition, if the original is <code>null</code>
|
95 |
* then an empty <code>String</code> is returned rather than <code>null</code>.
|
96 |
*
|
97 |
* @param original the <code>String</code> to clone
|
98 |
*
|
99 |
* @return a clone of the original
|
100 |
*/
|
101 |
/*--------------------------------------------------------------------------*/
|
102 |
private String cloneString (String original) |
103 |
{ |
104 |
if (original == null) |
105 |
{ |
106 |
return (""); |
107 |
} |
108 |
else
|
109 |
{ |
110 |
return (new String (original)); |
111 |
} |
112 |
} |
113 |
} |
114 |
/*---------------------------------------------------------------------------*/
|
115 |
|