1 11 package org.eclipse.pde.internal.ui.wizards; 12 13 import org.eclipse.jface.viewers.ISelectionChangedListener; 14 import org.eclipse.jface.wizard.IWizardNode; 15 import org.eclipse.jface.wizard.WizardSelectionPage; 16 import org.eclipse.pde.internal.ui.PDEUIMessages; 17 import org.eclipse.pde.internal.ui.parts.FormBrowser; 18 import org.eclipse.swt.SWT; 19 import org.eclipse.swt.layout.GridData; 20 import org.eclipse.swt.widgets.Composite; 21 import org.eclipse.swt.widgets.Control; 22 23 public abstract class BaseWizardSelectionPage extends WizardSelectionPage 24 implements 25 ISelectionChangedListener { 26 private String label; 27 private FormBrowser descriptionBrowser; 28 29 public BaseWizardSelectionPage(String name, String label) { 30 super(name); 31 this.label = label; 32 descriptionBrowser = new FormBrowser(SWT.BORDER | SWT.V_SCROLL); 33 descriptionBrowser.setText(""); } 35 public void createDescriptionIn(Composite composite) { 36 descriptionBrowser.createControl(composite); 37 Control c = descriptionBrowser.getControl(); 38 GridData gd = new GridData(GridData.FILL_BOTH); 39 gd.widthHint = 200; 40 c.setLayoutData(gd); 41 } 42 43 protected abstract IWizardNode createWizardNode(WizardElement element); 44 public String getLabel() { 45 return label; 46 } 47 public void setDescriptionText(String text) { 48 if (text == null) 49 text = PDEUIMessages.BaseWizardSelectionPage_noDesc; 50 descriptionBrowser.setText(text); 51 } 52 public void setDescriptionEnabled(boolean enabled) { 53 Control dcontrol = descriptionBrowser.getControl(); 54 if (dcontrol!=null) 55 dcontrol.setEnabled(enabled); 56 } 57 } 58 | Popular Tags |