1 package net.sourceforge.phpeclipse.wizards.actions.metadata;
3 import java.util.Arrays;
5 import org.eclipse.swt.SWT;
6 import org.eclipse.swt.layout.GridData;
7 import org.eclipse.swt.widgets.Composite;
8 import org.eclipse.swt.widgets.Table;
9 import org.eclipse.swt.widgets.TableColumn;
12 * @author Elvin E. Ebora
15 public class CommonWizardUI {
20 public CommonWizardUI() {}
23 * Creates a standard Table UI for wizard implementation
27 protected Table createTablePage(Composite composite) {
28 int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
29 Table table = new Table(composite, style);
30 table.setHeaderVisible(true);
31 table.setLinesVisible(true);
32 table.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING));
37 * Creates a standard TableColumn UI for wizard implementation
44 protected void createTableColumn(Table table, String colName, int style, int pos, int width) {
45 TableColumn column = new TableColumn(table, style, pos);
46 column.setText(colName);
47 column.setWidth(width);
51 * Creates a standard GridData UI for wizard implementation
56 protected GridData createGridData(int horzSpan, int vertSpan, int alignment) {
57 GridData gridData = new GridData();
58 gridData.horizontalSpan = horzSpan;
59 gridData.verticalSpan = vertSpan;
60 gridData.horizontalAlignment = alignment;
61 gridData.verticalAlignment = alignment;
66 * Returns a List implementation of an array of string input
68 * @return java.util.List
70 protected java.util.List getColumnNamesAsList(String[] columnNames) {
71 return Arrays.asList(columnNames);