1 11 package org.eclipse.team.internal.ui.wizards; 12 13 import org.eclipse.jface.dialogs.IDialogConstants; 14 import org.eclipse.jface.resource.ImageDescriptor; 15 import org.eclipse.jface.wizard.WizardPage; 16 import org.eclipse.swt.SWT; 17 import org.eclipse.swt.layout.GridData; 18 import org.eclipse.swt.layout.GridLayout; 19 import org.eclipse.swt.widgets.Combo; 20 import org.eclipse.swt.widgets.Composite; 21 import org.eclipse.swt.widgets.Label; 22 import org.eclipse.swt.widgets.Text; 23 24 public abstract class TeamWizardPage extends WizardPage { 25 31 public TeamWizardPage(String pageName, String title, ImageDescriptor titleImage) { 32 super(pageName, title, titleImage); 33 } 34 41 protected Composite createComposite(Composite parent, int numColumns) { 42 Composite composite = new Composite(parent, SWT.NULL); 43 44 GridLayout layout = new GridLayout(); 46 layout.numColumns = numColumns; 47 composite.setLayout(layout); 48 49 GridData data = new GridData(); 51 data.verticalAlignment = GridData.FILL; 52 data.horizontalAlignment = GridData.FILL; 53 composite.setLayoutData(data); 54 return composite; 55 } 56 64 protected Label createLabel(Composite parent, String text) { 65 return createIndentedLabel(parent, text, 0); 66 } 67 76 protected Label createIndentedLabel(Composite parent, String text, int indent) { 77 Label label = new Label(parent, SWT.LEFT); 78 label.setText(text); 79 GridData data = new GridData(); 80 data.horizontalSpan = 1; 81 data.horizontalAlignment = GridData.FILL; 82 data.horizontalIndent = indent; 83 label.setLayoutData(data); 84 return label; 85 } 86 92 protected Text createTextField(Composite parent) { 93 Text text = new Text(parent, SWT.SINGLE | SWT.BORDER); 94 GridData data = new GridData(GridData.FILL_HORIZONTAL); 95 data.verticalAlignment = GridData.CENTER; 96 data.grabExcessVerticalSpace = false; 97 data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; 98 text.setLayoutData(data); 99 return text; 100 } 101 102 108 protected Combo createDropDownCombo(Composite parent) { 109 Combo combo = new Combo(parent, SWT.DROP_DOWN); 110 GridData comboData = new GridData(GridData.FILL_HORIZONTAL); 111 comboData.verticalAlignment = GridData.CENTER; 112 comboData.grabExcessVerticalSpace = false; 113 comboData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; 114 combo.setLayoutData(comboData); 115 return combo; 116 } 117 } 118 | Popular Tags |