}
}
private <S> ApplicationData<S> load(UIWindow src)
{
Attributes attrs = src.getAttributes();
//
Customization<?> customization = src.getCustomization();
//
ContentType<?> contentType = customization.getType();
//
String customizationid = customization.getId();
// julien: should type check that
ApplicationType<S> type = (ApplicationType<S>)ApplicationType.getType(contentType);
//
PersistentApplicationState<S> instanceState = new PersistentApplicationState<S>(customizationid);
//
HashMap<String, String> properties = new HashMap<String, String>();
load(attrs, properties, windowPropertiesBlackList);
//
List<String> accessPermissions = Collections.emptyList();
if (src.isAdapted(ProtectedResource.class))
{
ProtectedResource pr = src.adapt(ProtectedResource.class);
accessPermissions = pr.getAccessPermissions();
}
//
Described described = src.adapt(Described.class);
//
boolean showInfoBar = attrs.getValue(MappedAttributes.SHOW_INFO_BAR, false);
boolean showWindowState = attrs.getValue(MappedAttributes.SHOW_WINDOW_STATE, false);
boolean showMode = attrs.getValue(MappedAttributes.SHOW_MODE, false);
String theme = attrs.getValue(MappedAttributes.THEME, null);
//
return new ApplicationData<S>(
src.getObjectId(),
src.getName(),
type,
instanceState,
null,
described.getName(),
attrs.getValue(MappedAttributes.ICON),
described.getDescription(),
showInfoBar,
showWindowState,
showMode,
theme,
attrs.getValue(MappedAttributes.WIDTH),
attrs.getValue(MappedAttributes.HEIGHT),
Utils.safeImmutableMap(properties),
Utils.safeImmutableList(accessPermissions)
);
}