1 11 package org.eclipse.ui.part; 12 13 import org.eclipse.swt.SWT; 14 import org.eclipse.swt.layout.FillLayout; 15 import org.eclipse.swt.widgets.Composite; 16 import org.eclipse.swt.widgets.Control; 17 import org.eclipse.swt.widgets.Label; 18 19 27 public class MessagePage extends Page { 28 private Composite pgComp; 29 30 private Label msgLabel; 31 32 private String message = ""; 34 37 public MessagePage() { 38 } 40 41 44 public void createControl(Composite parent) { 45 pgComp = new Composite(parent, SWT.NULL); 47 pgComp.setLayout(new FillLayout()); 48 49 msgLabel = new Label(pgComp, SWT.LEFT | SWT.TOP | SWT.WRAP); 50 msgLabel.setText(message); 51 } 52 53 56 public Control getControl() { 57 return pgComp; 58 } 59 60 63 public void setFocus() { 64 pgComp.setFocus(); 68 } 69 70 75 public void setMessage(String message) { 76 this.message = message; 77 if (msgLabel != null) { 78 msgLabel.setText(message); 79 } 80 } 81 } 82 | Popular Tags |