label.setSize(labelSize); tip.pack();
toolTipLabel.setSize(labelSize); toolTipShell.pack();
boolean updateToolTip (int x, int y, Label label) {	CTabItem item = getItem(new Point (x, y));	if (item == null) return false;	String tooltip = item.getToolTipText();	if (tooltip == null) return false;	if (tooltip.equals(label.getText())) return true;		Shell tip = label.getShell();	label.setText(tooltip);	Point labelSize = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);	labelSize.x += 2; labelSize.y += 2;	label.setSize(labelSize);	tip.pack();	/*	 * On some platforms, there is a minimum size for a shell  	 * which may be greater than the label size.	 * To avoid having the background of the tip shell showing	 * around the label, force the label to fill the entire client area.	 */	Rectangle area = tip.getClientArea();	label.setSize(area.width, area.height);	/*	 * Position the tooltip and ensure that it is not located off	 * the screen.	 */	Point cursorLocation = getDisplay().getCursorLocation();	// Assuming cursor is 21x21 because this is the size of	// the arrow cursor on Windows 	int cursorHeight = 21; 	Point size = tip.getSize();	Rectangle rect = getMonitor().getBounds();	Point pt = new Point(cursorLocation.x, cursorLocation.y + cursorHeight + 2);	pt.x = Math.max(pt.x, rect.x);	if (pt.x + size.x > rect.x + rect.width) pt.x = rect.x + rect.width - size.x;	if (pt.y + size.y > rect.y + rect.height) {		pt.y = cursorLocation.y - 2 - size.y;	}	tip.setLocation(pt);	return true;}