List<ScalaPlatform> platforms = new ArrayList<ScalaPlatform>();
if (storage != null) {
try {
for (FileObject platformDefinition : storage.getChildren()) {
DataObject dobj = DataObject.find(platformDefinition);
InstanceCookie ic = dobj.getCookie(InstanceCookie.class);
if (ic == null) {
ErrorManager.getDefault().log(ErrorManager.WARNING,"DefaultPlatformStorage: The file: "+ //NOI18N
platformDefinition.getNameExt() + " has no InstanceCookie"); //NOI18N
continue;
}
else if (ic instanceof InstanceCookie.Of) {
if (((InstanceCookie.Of)ic).instanceOf(ScalaPlatform.class)) {
platforms.add((ScalaPlatform) ic.instanceCreate());
}
else {
ErrorManager.getDefault().log(ErrorManager.WARNING,"DefaultPlatformStorage: The file: "+ //NOI18N
platformDefinition.getNameExt() + " is not an instance of JavaPlatform"); //NOI18N
}
}
else {
Object instance = ic.instanceCreate();
if (instance instanceof ScalaPlatform) {
platforms.add((ScalaPlatform) instance);
}
else {
ErrorManager.getDefault().log(ErrorManager.WARNING,"DefaultPlatformStorage: The file: "+ //NOI18N