0
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
package com.nokia.s60tools.imaker;
|
|
20 |
|
|
21 |
/**
|
|
22 |
* This class is a container for variable information from iMaker.
|
|
23 |
*
|
|
24 |
* @version 0.2
|
|
25 |
*/
|
|
26 |
public class UIVariable {
|
|
27 |
/** Private instance variables */
|
|
28 |
private String defaultValue = null;
|
|
29 |
|
|
30 |
private boolean modified;
|
|
31 |
|
|
32 |
private String name = null;
|
|
33 |
private String value = null;
|
|
34 |
private String type = null;
|
|
35 |
private String description = null;
|
|
36 |
private String valueFormat = null;
|
|
37 |
private boolean include = false;
|
|
38 |
/**
|
|
39 |
* Default constructor
|
|
40 |
*
|
|
41 |
* @param name Name of the variable
|
|
42 |
* @param value Value of the variable
|
|
43 |
* @param type Type of the variable
|
|
44 |
* @param description Description of the variable
|
|
45 |
* @param valueFormat Value format (values) of the variable
|
|
46 |
*/
|
|
47 |
public UIVariable(String name, String value, String type,
|
|
48 |
String description, String valueFormat) {
|
|
49 |
this.name = name;
|
|
50 |
this.value = defaultValue = value;
|
|
51 |
this.type = type;
|
|
52 |
this.description = description;
|
|
53 |
this.valueFormat = valueFormat;
|
|
54 |
}
|
|
55 |
|
|
56 |
public void performDefaults() {
|
|
57 |
this.value = defaultValue;
|
|
58 |
this.modified = false;
|
|
59 |
}
|
|
60 |
|
|
61 |
public boolean isModified() {
|
|
62 |
return modified;
|
|
63 |
}
|
|
64 |
|
|
65 |
public void setModified(boolean modified) {
|
|
66 |
this.modified = modified;
|
|
67 |
}
|
|
68 |
|
|
69 |
|
|
70 |
public String getName() {
|
|
71 |
return name;
|
|
72 |
}
|
|
73 |
|
|
74 |
public String getValue() {
|
|
75 |
return value;
|
|
76 |
}
|
|
77 |
|
|
78 |
public void setValue(String value) {
|
|
79 |
this.value = value;
|
|
80 |
}
|
|
81 |
|
|
82 |
public String getType() {
|
|
83 |
return type;
|
|
84 |
}
|
|
85 |
|
|
86 |
public String getDescription() {
|
|
87 |
return description;
|
|
88 |
}
|
|
89 |
|
|
90 |
public String getValueFormat() {
|
|
91 |
return valueFormat;
|
|
92 |
}
|
|
93 |
|
|
94 |
@Override
|
|
95 |
public String toString() {
|
|
96 |
StringBuilder sb = new StringBuilder();
|
|
97 |
sb.append(getName()+ "\t\t");
|
|
98 |
sb.append(getValue()+ "\t\t");
|
|
99 |
sb.append(getValueFormat() + "\t\t");
|
|
100 |
sb.append(getDescription());
|
|
101 |
return sb.toString();
|
|
102 |
}
|
|
103 |
|
|
104 |
public boolean getInclude() {
|
|
105 |
return include;
|
|
106 |
}
|
|
107 |
|
|
108 |
public void setInclude(boolean inc) {
|
|
109 |
include=inc;
|
|
110 |
}
|
|
111 |
|
|
112 |
@Override
|
|
113 |
public boolean equals(Object that) {
|
|
114 |
if(that==null||!(that instanceof UIVariable)) {
|
|
115 |
return false;
|
|
116 |
}
|
|
117 |
UIVariable v = (UIVariable) that;
|
|
118 |
return this.getName().equals(v.getName()) && this.getValue().equals(v.getValue());
|
|
119 |
}
|
|
120 |
|
|
121 |
}
|