} finally {
shell.setCursor(cursor);
}
} else if (iview != null) {
try {
SWTSkinObjectContainer soContents = (SWTSkinObjectContainer) skin.createSkinObject(
"MdiIView." + uniqueNumber++, "mdi.content.item",
soParent);
skin.addSkinObject(soContents);
parent.setBackgroundMode(SWT.INHERIT_NONE);
Composite viewComposite = soContents.getComposite();
//viewComposite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
//viewComposite.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
boolean doGridLayout = true;
if (iview instanceof UISWTView) {
UISWTView swtView = (UISWTView) iview;
if (swtView.getControlType() == UISWTViewCore.CONTROLTYPE_SKINOBJECT) {
doGridLayout = false;
}
}
if (doGridLayout) {
GridLayout gridLayout = new GridLayout();
gridLayout.horizontalSpacing = gridLayout.verticalSpacing = gridLayout.marginHeight = gridLayout.marginWidth = 0;
viewComposite.setLayout(gridLayout);
viewComposite.setLayoutData(Utils.getFilledFormData());
}
if (iview instanceof UISWTViewCore) {
UISWTViewCore uiViewCore = (UISWTViewCore) iview;
uiViewCore.setSkinObject(soContents, soContents.getComposite());
}
iview.initialize(viewComposite);
setTitle(iview.getFullTitle());
Composite iviewComposite = iview.getComposite();
control = iviewComposite;
if (doGridLayout) {
Object existingLayoutData = iviewComposite.getLayoutData();
Object existingParentLayoutData = iviewComposite.getParent().getLayoutData();
if (existingLayoutData == null
|| !(existingLayoutData instanceof GridData)
&& (existingParentLayoutData instanceof GridLayout)) {
GridData gridData = new GridData(GridData.FILL_BOTH);
iviewComposite.setLayoutData(gridData);
}
}
//soContents is invisible, so of course iviwComposite is invisible
//We should do the one time layout on the first show..
//if (iviewComposite.isVisible()) {
// parent.layout(true, true);
//}
CTabItem oldSelection = swtItem.getParent().getSelection();
swtItem.getParent().setSelection(swtItem);
swtItem.setControl(soContents.getControl());
if (oldSelection != null) {
swtItem.getParent().setSelection(oldSelection);
}
setSkinObject(soContents, soContents);
} catch (Exception e) {