View Javadoc

1    /*
2     * This is free software; you can redistribute it and/or modify it
3     * under the terms of the GNU Lesser General Public License as
4     * published by the Free Software Foundation; either version 2.1 of
5     * the License, or (at your option) any later version.
6     *
7     * This software is distributed in the hope that it will be useful,
8     * but WITHOUT ANY WARRANTY; without even the implied warranty of
9     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10    * Lesser General Public License for more details.
11    *
12    * You should have received a copy of the GNU Lesser General Public
13    * License along with this software; if not, write to the Free
14    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
15    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
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 }