1 11 package org.eclipse.ltk.internal.ui.refactoring.util; 12 13 import org.eclipse.swt.SWT; 14 import org.eclipse.swt.custom.CLabel; 15 import org.eclipse.swt.custom.ViewForm; 16 import org.eclipse.swt.graphics.Image; 17 import org.eclipse.swt.widgets.Composite; 18 import org.eclipse.swt.widgets.ToolBar; 19 20 import org.eclipse.jface.action.ToolBarManager; 21 22 27 public final class ViewerPane extends ViewForm { 28 29 private ToolBarManager fToolBarManager; 30 31 public ViewerPane(Composite parent, int style) { 32 super(parent, style); 33 34 marginWidth= 0; 35 marginHeight= 0; 36 37 CLabel label= new CLabel(this, SWT.NONE); 38 setTopLeft(label); 39 40 ToolBar tb= new ToolBar(this, SWT.FLAT); 41 setTopCenter(tb); 42 fToolBarManager= new ToolBarManager(tb); 43 } 44 45 50 public void setText(String label) { 51 CLabel cl= (CLabel) getTopLeft(); 52 cl.setText(label); 53 } 54 55 public String getText() { 56 CLabel cl= (CLabel) getTopLeft(); 57 return cl.getText(); 58 } 59 60 65 public void setImage(Image image) { 66 CLabel cl= (CLabel) getTopLeft(); 67 cl.setImage(image); 68 } 69 70 public Image getImage() { 71 CLabel cl= (CLabel) getTopLeft(); 72 return cl.getImage(); 73 } 74 75 public ToolBarManager getToolBarManager() { 76 return fToolBarManager; 77 } 78 } 79 | Popular Tags |