1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package installtoolkit.deb;
19
20 import org.dom4j.Element;
21
22 /**
23 * Helper class to wrap a startmenue link on linux systems.
24 *
25 * @author Christian Elberfeld <elberfeld@web.de>
26 *
27 */
28 public class LinkType {
29
30 protected String name;
31 protected String comment;
32 protected String command;
33 protected String icon;
34 protected boolean terminal;
35 protected String category;
36
37 public LinkType() {}
38
39 /**
40 * Create class from an XML Element
41 *
42 * @param element
43 */
44 public LinkType(Element element) {
45
46 this.name = element.attributeValue("Name");
47 this.comment = element.attributeValue("Comment");
48 this.command = element.attributeValue("Command");
49 this.terminal = Boolean.parseBoolean(element.attributeValue("Terminal"));
50 this.icon = element.attributeValue("Icon",null);
51 this.category = element.attributeValue("Category","Application");
52
53 }
54
55 /**
56 * @see Object#toString()
57 */
58 @Override
59 public String toString() {
60
61 return "linkType [Name: "+name+" / Comment: "+comment+" / Command: "+command+" / Icon: "+icon+" / Terminal: "+terminal+" / Category: "+this.category+"]";
62 }
63
64 public String getCommand() {
65 return command;
66 }
67
68 public void setCommand(String command) {
69 this.command = command;
70 }
71
72 public String getComment() {
73 return comment;
74 }
75
76 public void setComment(String comment) {
77 this.comment = comment;
78 }
79
80 public String getIcon() {
81 return icon;
82 }
83
84 public void setIcon(String icon) {
85 this.icon = icon;
86 }
87
88 public String getName() {
89 return name;
90 }
91
92 public void setName(String name) {
93 this.name = name;
94 }
95
96 public boolean isTerminal() {
97 return terminal;
98 }
99
100 public void setTerminal(boolean terminal) {
101 this.terminal = terminal;
102 }
103
104 public String getCategory() {
105 return category;
106 }
107
108 public void setCategory(String category) {
109 this.category = category;
110 }
111
112
113 }