Point result = super.computeSize(hHint, wHint, changed);
if (widestLabelIndex == -1) {
String properties_not_available = "Properties are not available.";
result.x = getTextDimension(properties_not_available).x + INDENT;
} else {
ITabItem widestTab = elements[widestLabelIndex].getTabItem();
int width = getTextDimension(widestTab.getText()).x + INDENT;
/*
* To anticipate for the icon placement we should always keep the
* space available after the label. So when the active tab includes
* an icon the width of the tab doesn't change.
*/
if (widestTab.getImage() != null) {
width = width + 16 + 4;
}
if (widestTab.isIndented()) {
width = width + 10;
}
/*
* Add 10 pixels to the right of the longest string as a margin.
*/