private void onTabSelect(SelectionEvent e) {
if (e.item instanceof TabItem && e.item.getData() instanceof IEntityPropertyPage) {
TabItem item = (TabItem) e.item;
/* Create Page if not yet done */
IEntityPropertyPage page = (IEntityPropertyPage) e.item.getData();
if (item.getControl() == null) {
item.setControl(page.createContents(fTabFolder));
fCreatedPages.add(page);
/* Check if the Dialog size needs to be updated now */
Shell shell = getShell();
Point requiredSize = getRequiredSize(shell);
Point currentSize = shell.getSize();
if (requiredSize.x > currentSize.x || requiredSize.y > currentSize.y)
shell.setSize(new Point(Math.max(currentSize.x, requiredSize.x), Math.max(currentSize.y, requiredSize.y)));
}
/* Pass Focus to Page */
page.setFocus();
}
}