|
Lines 243-265
Link Here
|
| 243 |
public void setResourceType(String aResourceType) { |
243 |
public void setResourceType(String aResourceType) { |
| 244 |
resourceType = aResourceType; |
244 |
resourceType = aResourceType; |
| 245 |
WorkbenchComponent aComponent = getReadOnlyComponent(); |
245 |
WorkbenchComponent aComponent = getReadOnlyComponent(); |
| 246 |
ComponentResource[] resources = aComponent.findResourcesByRuntimePath(getRuntimePath()); |
246 |
if (aComponent != null) { |
| 247 |
for (int i = 0; i < resources.length; i++) { |
247 |
ComponentResource[] resources = aComponent.findResourcesByRuntimePath(getRuntimePath()); |
| 248 |
resources[i].setResourceType(aResourceType); |
248 |
for (int i = 0; i < resources.length; i++) { |
|
|
249 |
resources[i].setResourceType(aResourceType); |
| 250 |
} |
| 249 |
} |
251 |
} |
| 250 |
|
|
|
| 251 |
} |
252 |
} |
| 252 |
|
253 |
|
| 253 |
// TODO Fetch the resource type from the model. |
254 |
// TODO Fetch the resource type from the model. |
| 254 |
public String getResourceType() { |
255 |
public String getResourceType() { |
| 255 |
if (null == resourceType) { |
256 |
if (null == resourceType) { |
| 256 |
WorkbenchComponent aComponent = getReadOnlyComponent(); |
257 |
WorkbenchComponent aComponent = getReadOnlyComponent(); |
| 257 |
ComponentResource[] resources = aComponent.findResourcesByRuntimePath(getRuntimePath()); |
258 |
if (aComponent != null) |
| 258 |
for (int i = 0; i < resources.length; i++) { |
259 |
{ |
| 259 |
resourceType = resources[i].getResourceType(); |
260 |
ComponentResource[] resources = aComponent |
| 260 |
return resourceType; |
261 |
.findResourcesByRuntimePath(getRuntimePath()); |
|
|
262 |
if (resources.length > 0) { |
| 263 |
resourceType = resources[0].getResourceType(); |
| 264 |
return resourceType; |
| 265 |
} |
| 261 |
} |
266 |
} |
| 262 |
|
|
|
| 263 |
} |
267 |
} |
| 264 |
resourceType = ""; //$NON-NLS-1$ |
268 |
resourceType = ""; //$NON-NLS-1$ |
| 265 |
return resourceType; |
269 |
return resourceType; |
|
Lines 314-321
Link Here
|
| 314 |
WorkbenchComponent component = null; |
318 |
WorkbenchComponent component = null; |
| 315 |
try { |
319 |
try { |
| 316 |
moduleCore = StructureEdit.getStructureEditForRead(getProject()); |
320 |
moduleCore = StructureEdit.getStructureEditForRead(getProject()); |
| 317 |
component = moduleCore.getComponent(); |
321 |
if (moduleCore != null) { |
| 318 |
mapping.mark(getProject(), component); |
322 |
component = moduleCore.getComponent(); |
|
|
323 |
mapping.mark(getProject(), component); |
| 324 |
} |
| 319 |
} finally { |
325 |
} finally { |
| 320 |
if (moduleCore != null) { |
326 |
if (moduleCore != null) { |
| 321 |
moduleCore.dispose(); |
327 |
moduleCore.dispose(); |