1 11 package org.eclipse.ui.internal.presentations.defaultpresentation; 12 13 import org.eclipse.swt.SWT; 14 import org.eclipse.swt.graphics.Rectangle; 15 import org.eclipse.swt.widgets.TabItem; 16 import org.eclipse.ui.internal.presentations.util.PartInfo; 17 import org.eclipse.ui.internal.presentations.util.WidgetTabItem; 18 import org.eclipse.ui.internal.util.Util; 19 20 23 public class NativeTabItem extends WidgetTabItem { 24 25 public NativeTabItem(NativeTabFolder parent, int index) { 26 super(new TabItem(parent.getTabFolder(), SWT.NONE, index)); 27 } 28 29 32 public Rectangle getBounds() { 33 return new Rectangle(0,0,0,0); 34 } 35 36 public void setInfo(PartInfo info) { 37 TabItem widget = (TabItem) getWidget(); 38 39 if (!Util.equals(widget.getText(), info.name)) { 40 widget.setText(info.name); 41 } 42 String oldToolTip = Util.safeString(widget.getToolTipText()); 43 44 if (!Util.equals(info.toolTip, oldToolTip)) { 45 String toolTip = info.toolTip; 46 if (toolTip.length() == 0) { 47 toolTip = null; 48 } 49 widget.setToolTipText(toolTip); 50 } 51 } 52 } 53 | Popular Tags |