1 11 package org.eclipse.ui.internal.intro.impl.parts; 12 13 14 import org.eclipse.swt.SWT; 15 import org.eclipse.swt.layout.GridData; 16 import org.eclipse.swt.layout.GridLayout; 17 import org.eclipse.swt.widgets.Composite; 18 import org.eclipse.swt.widgets.Control; 19 import org.eclipse.swt.widgets.Label; 20 import org.eclipse.swt.widgets.Text; 21 import org.eclipse.ui.IMemento; 22 import org.eclipse.ui.forms.widgets.FormToolkit; 23 import org.eclipse.ui.internal.intro.impl.Messages; 24 import org.eclipse.ui.internal.intro.impl.swt.PageStyleManager; 25 import org.eclipse.ui.intro.IIntroPart; 26 import org.eclipse.ui.intro.config.IStandbyContentPart; 27 28 29 30 public class EmptyStandbyContentPart implements IStandbyContentPart { 31 32 private Composite contentComposite; 33 private Text contentText; 34 35 41 public void createPartControl(Composite parent, FormToolkit toolkit) { 42 contentComposite = toolkit.createComposite(parent); 43 contentComposite.setLayout(new GridLayout()); 44 46 String text = Messages.EmptyStandbyContentPart_text; 47 Label label = toolkit.createLabel(contentComposite, text, SWT.WRAP); 48 label.setFont(PageStyleManager.getBannerFont()); 49 GridData gd = new GridData(GridData.FILL_HORIZONTAL); 50 label.setLayoutData(gd); 51 52 contentText = toolkit.createText(contentComposite, " ", SWT.MULTI | SWT.WRAP); 54 GridData textGd = new GridData(GridData.FILL_BOTH); 55 contentText.setLayoutData(textGd); 56 } 57 58 63 public Control getControl() { 64 return contentComposite; 65 } 66 67 68 public void setMessage(String message) { 69 if (message != null) { 70 contentText.setText(message); 71 contentComposite.layout(); 72 } 73 } 74 75 76 81 public void init(IIntroPart introPart, IMemento memento) { 82 } 84 85 90 public void setInput(Object input) { 91 if (input != null) 92 setMessage((String ) input); 93 else 94 setMessage(""); } 96 97 102 public void setFocus() { 103 } 105 106 111 public void dispose() { 112 } 114 115 public void saveState(IMemento memento) { 116 } 118 119 } 120 | Popular Tags |