}
//
if (srcChild instanceof UIWindow)
{
UIWindow srcWindow = (UIWindow)srcChild;
UIWindow dstWindow = (UIWindow)dstChild;
Customization<?> customization = srcWindow.getCustomization();
ContentType contentType = customization.getType();
String contentId = customization.getContentId();
Customization parent = customization.getParent();
Customization dstParent = null;
if (parent != null)
{
WorkspaceCustomizationContext parentCtx = (WorkspaceCustomizationContext)parent.getContext();
String name = parentCtx.nameOf(parent);
if (parentCtx == srcPage)
{
dstParent = dstPage.getCustomizationContext().getCustomization(name);
if (dstParent == null)
{
Object state = parent.getVirtualState();
dstParent = dstPage.getCustomizationContext().customize(name, contentType, contentId, state);
}
}
if (dstParent != null)
{
Object state = customization.getState();
Customization dstCustomization = dstWindow.customize(dstParent);
dstCustomization.setState(state);
}
else
{
Object state = customization.getVirtualState();
dstWindow.customize(contentType, contentId, state);
}
}
else
{
Object state = customization.getVirtualState();
dstWindow.customize(contentType, contentId, state);
}
}
else if (srcChild instanceof UIContainer)
{
UIContainer srcContainer = (UIContainer)srcChild;