1 11 package org.eclipse.ui.forms.widgets; 12 13 import org.eclipse.jface.action.IToolBarManager; 14 import org.eclipse.swt.SWT; 15 import org.eclipse.swt.graphics.Color; 16 import org.eclipse.swt.graphics.Image; 17 import org.eclipse.swt.widgets.Composite; 18 import org.eclipse.swt.widgets.Control; 19 import org.eclipse.swt.widgets.Menu; 20 import org.eclipse.ui.forms.IMessage; 21 22 47 public class ScrolledForm extends SharedScrolledComposite { 48 private Form content; 49 50 public ScrolledForm(Composite parent) { 51 this(parent, SWT.V_SCROLL | SWT.H_SCROLL); 52 } 53 54 60 public ScrolledForm(Composite parent, int style) { 61 super(parent, style); 62 super.setMenu(parent.getMenu()); 63 content = new Form(this, SWT.NULL); 64 super.setContent(content); 65 content.setMenu(getMenu()); 66 } 67 68 73 public void setMenu(Menu menu) { 74 super.setMenu(menu); 75 if (content != null) 76 content.setMenu(menu); 77 } 78 79 84 public String getText() { 85 return content.getText(); 86 } 87 88 93 public Image getImage() { 94 return content.getImage(); 95 } 96 97 101 public void setForeground(Color fg) { 102 super.setForeground(fg); 103 content.setForeground(fg); 104 } 105 106 110 public void setBackground(Color bg) { 111 super.setBackground(bg); 112 content.setBackground(bg); 113 } 114 115 119 public final void setContent(Control c) { 120 } 121 122 137 public void setText(String text) { 138 content.setText(text); 139 reflow(true); 140 } 141 142 148 public void setImage(Image image) { 149 content.setImage(image); 150 reflow(true); 151 } 152 153 159 public Image getBackgroundImage() { 160 return content.getBackgroundImage(); 161 } 162 163 170 public void setBackgroundImage(Image backgroundImage) { 171 content.setBackgroundImage(backgroundImage); 172 } 173 174 180 public IToolBarManager getToolBarManager() { 181 return content.getToolBarManager(); 182 } 183 184 188 public void updateToolBar() { 189 content.updateToolBar(); 190 } 191 192 199 public Composite getBody() { 200 return content.getBody(); 201 } 202 203 208 public Form getForm() { 209 return content; 210 } 211 212 221 222 public void setBusy(boolean busy) { 223 content.setBusy(busy); 224 reflow(true); 225 } 226 227 235 public void setHeadClient(Control headClient) { 236 content.setHeadClient(headClient); 237 reflow(true); 238 } 239 240 254 public void setMessage(String newMessage, int newType, IMessage[] messages) { 255 content.setMessage(newMessage, newType, messages); 256 reflow(true); 257 } 258 259 265 public void setMessage(String newMessage, int newType) { 266 this.setMessage(newMessage, newType, null); 267 } 268 269 274 public String getMessage() { 275 return content.getMessage(); 276 } 277 278 283 public int getMessageType() { 284 return content.getMessageType(); 285 } 286 } 287 | Popular Tags |