diff options
Diffstat (limited to 'plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java')
-rw-r--r-- | plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java new file mode 100644 index 0000000..de3e905 --- /dev/null +++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java | |||
@@ -0,0 +1,161 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010 Intel Corporation. | ||
3 | * All rights reserved. This program and the accompanying materials | ||
4 | * are made available under the terms of the Eclipse Public License v1.0 | ||
5 | * which accompanies this distribution, and is available at | ||
6 | * http://www.eclipse.org/legal/epl-v10.html | ||
7 | * | ||
8 | * Contributors: | ||
9 | * Intel - initial API and implementation | ||
10 | *******************************************************************************/ | ||
11 | package org.yocto.sdk.ide; | ||
12 | |||
13 | public class YoctoUIElement { | ||
14 | public enum PokyMode | ||
15 | { | ||
16 | POKY_SDK_MODE, | ||
17 | POKY_TREE_MODE | ||
18 | }; | ||
19 | public enum DeviceMode | ||
20 | { | ||
21 | QEMU_MODE, | ||
22 | DEVICE_MODE | ||
23 | }; | ||
24 | |||
25 | private String strTarget; | ||
26 | private String[] strTargetsArray; | ||
27 | private DeviceMode enumDeviceMode; | ||
28 | private String strQemuKernelLoc; | ||
29 | private String strQemuOption; | ||
30 | private String strSysrootLoc; | ||
31 | private PokyMode enumPokyMode; | ||
32 | private String strToolChainRoot; | ||
33 | private int intTargetIndex; | ||
34 | |||
35 | public YoctoUIElement() | ||
36 | { | ||
37 | this.enumDeviceMode = DeviceMode.QEMU_MODE; | ||
38 | this.enumPokyMode = PokyMode.POKY_SDK_MODE; | ||
39 | this.strToolChainRoot = ""; | ||
40 | this.strQemuKernelLoc = ""; | ||
41 | this.strQemuOption = ""; | ||
42 | this.strSysrootLoc = ""; | ||
43 | this.intTargetIndex = -1; | ||
44 | this.strTarget = ""; | ||
45 | } | ||
46 | |||
47 | public PokyMode getEnumPokyMode() { | ||
48 | return enumPokyMode; | ||
49 | } | ||
50 | public void setEnumPokyMode(PokyMode enumPokyMode) { | ||
51 | this.enumPokyMode = enumPokyMode; | ||
52 | } | ||
53 | public String getStrToolChainRoot() { | ||
54 | return strToolChainRoot; | ||
55 | } | ||
56 | public void setStrToolChainRoot(String strToolChainRoot) { | ||
57 | this.strToolChainRoot = strToolChainRoot; | ||
58 | } | ||
59 | public int getIntTargetIndex() { | ||
60 | if ((this.strTargetsArray != null) && (this.strTargetsArray.length == 1)) | ||
61 | return 0; | ||
62 | return intTargetIndex; | ||
63 | } | ||
64 | public void setIntTargetIndex(int intTargetIndex) { | ||
65 | this.intTargetIndex = intTargetIndex; | ||
66 | } | ||
67 | public String getStrTarget() { | ||
68 | return strTarget; | ||
69 | } | ||
70 | public void setStrTarget(String strTarget) { | ||
71 | this.strTarget = strTarget; | ||
72 | } | ||
73 | public String[] getStrTargetsArray() { | ||
74 | return strTargetsArray; | ||
75 | } | ||
76 | public void setStrTargetsArray(String[] strTargetsArray) { | ||
77 | this.strTargetsArray = strTargetsArray; | ||
78 | } | ||
79 | public DeviceMode getEnumDeviceMode() { | ||
80 | return enumDeviceMode; | ||
81 | } | ||
82 | public void setEnumDeviceMode(DeviceMode enumDeviceMode) { | ||
83 | this.enumDeviceMode = enumDeviceMode; | ||
84 | } | ||
85 | public String getStrQemuKernelLoc() { | ||
86 | return strQemuKernelLoc; | ||
87 | } | ||
88 | public void setStrQemuKernelLoc(String strQemuKernelLoc) { | ||
89 | this.strQemuKernelLoc = strQemuKernelLoc; | ||
90 | } | ||
91 | public String getStrQemuOption() { | ||
92 | return strQemuOption; | ||
93 | } | ||
94 | public void setStrQemuOption(String strQemuOption) { | ||
95 | this.strQemuOption = strQemuOption; | ||
96 | } | ||
97 | public String getStrSysrootLoc() { | ||
98 | return strSysrootLoc; | ||
99 | } | ||
100 | public void setStrSysrootLoc(String strSysrootLoc) { | ||
101 | this.strSysrootLoc = strSysrootLoc; | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public int hashCode() { | ||
106 | final int prime = 31; | ||
107 | int result = 1; | ||
108 | result = prime * result + ((enumDeviceMode == null) ? 0 : enumDeviceMode.hashCode()); | ||
109 | result = prime * result + ((enumPokyMode == null) ? 0 : enumPokyMode.hashCode()); | ||
110 | result = prime * result + intTargetIndex; | ||
111 | result = prime * result + ((strQemuKernelLoc == null) ? 0 : strQemuKernelLoc.hashCode()); | ||
112 | result = prime * result + ((strQemuOption == null) ? 0 : strQemuOption.hashCode()); | ||
113 | result = prime * result + ((strSysrootLoc == null) ? 0 : strSysrootLoc.hashCode()); | ||
114 | result = prime * result + ((strTarget == null) ? 0 : strTarget.hashCode()); | ||
115 | result = prime * result + ((strToolChainRoot == null) ? 0 : strToolChainRoot.hashCode()); | ||
116 | return result; | ||
117 | } | ||
118 | |||
119 | @Override | ||
120 | public boolean equals(Object obj) { | ||
121 | if (this == obj) | ||
122 | return true; | ||
123 | if (obj == null) | ||
124 | return false; | ||
125 | if (getClass() != obj.getClass()) | ||
126 | return false; | ||
127 | YoctoUIElement other = (YoctoUIElement) obj; | ||
128 | if (enumDeviceMode != other.enumDeviceMode) | ||
129 | return false; | ||
130 | if (enumPokyMode != other.enumPokyMode) | ||
131 | return false; | ||
132 | if (intTargetIndex != other.intTargetIndex) | ||
133 | return false; | ||
134 | if (strQemuKernelLoc == null) { | ||
135 | if (other.strQemuKernelLoc != null) | ||
136 | return false; | ||
137 | } else if (!strQemuKernelLoc.equals(other.strQemuKernelLoc)) | ||
138 | return false; | ||
139 | if (strQemuOption == null) { | ||
140 | if (other.strQemuOption != null) | ||
141 | return false; | ||
142 | } else if (!strQemuOption.equals(other.strQemuOption)) | ||
143 | return false; | ||
144 | if (strSysrootLoc == null) { | ||
145 | if (other.strSysrootLoc != null) | ||
146 | return false; | ||
147 | } else if (!strSysrootLoc.equals(other.strSysrootLoc)) | ||
148 | return false; | ||
149 | if (strTarget == null) { | ||
150 | if (other.strTarget != null) | ||
151 | return false; | ||
152 | } else if (!strTarget.equals(other.strTarget)) | ||
153 | return false; | ||
154 | if (strToolChainRoot == null) { | ||
155 | if (other.strToolChainRoot != null) | ||
156 | return false; | ||
157 | } else if (!strToolChainRoot.equals(other.strToolChainRoot)) | ||
158 | return false; | ||
159 | return true; | ||
160 | } | ||
161 | } | ||