15
15
import org.eclipse.jface.wizard.WizardPage;
16
16
import org.eclipse.linuxtools.internal.systemtap.ui.graphingapi.ui.Localization;
17
17
import org.eclipse.swt.SWT;
18
import org.eclipse.swt.events.SelectionAdapter;
18
19
import org.eclipse.swt.events.SelectionEvent;
19
20
import org.eclipse.swt.events.SelectionListener;
20
import org.eclipse.swt.layout.FormAttachment;
21
import org.eclipse.swt.layout.FormData;
22
import org.eclipse.swt.layout.FormLayout;
21
import org.eclipse.swt.layout.GridData;
22
import org.eclipse.swt.layout.GridLayout;
23
23
import org.eclipse.swt.widgets.Button;
24
24
import org.eclipse.swt.widgets.Composite;
25
25
import org.eclipse.swt.widgets.Label;
26
import org.eclipse.ui.forms.widgets.ColumnLayout;
30
29
public class SelectDataSetWizardPage extends WizardPage {
31
30
public SelectDataSetWizardPage() {
32
super("selectDataSetType");
33
setTitle(Localization.getString("SelectDataSetWizardPage.SelectDataSetType"));
31
super("selectDataSetType"); //$NON-NLS-1$
32
setTitle(Localization.getString("SelectDataSetWizardPage.SelectDataSetType")); //$NON-NLS-1$
33
dataSetID = ""; //$NON-NLS-1$
35
34
btnDataSets = null;
39
38
wizard = (DataSetWizard)super.getWizard();
41
40
Composite comp = new Composite(parent, SWT.NULL);
42
comp.setLayout(new FormLayout());
43
FormData data1 = new FormData();
44
data1.left = new FormAttachment(0, 0);
45
data1.top = new FormAttachment(0, 0);
46
data1.right = new FormAttachment(40, 0);
47
data1.bottom = new FormAttachment(100, 0);
41
GridData layoutData = new GridData(GridData.FILL_BOTH);
42
layoutData.grabExcessHorizontalSpace = true;
43
layoutData.horizontalAlignment = SWT.FILL;
44
GridLayout gridLayout = new GridLayout(2, false);
45
comp.setLayout(gridLayout);
49
Composite cmpFilterOpts = new Composite(comp, SWT.NONE);
50
cmpFilterOpts.setLayoutData(data1);
51
ColumnLayout colLayout = new ColumnLayout();
52
colLayout.maxNumColumns = 1;
53
cmpFilterOpts.setLayout(colLayout);
55
47
String[] ids = DataSetFactory.getIDs();
56
48
btnDataSets = new Button[ids.length];
57
50
for(int i=0; i<btnDataSets.length; i++) {
58
btnDataSets[i] = new Button(cmpFilterOpts, SWT.NONE);
51
btnDataSets[i] = new Button(comp, SWT.RADIO);
59
52
btnDataSets[i].setText(DataSetFactory.getName(ids[i]));
60
53
btnDataSets[i].addSelectionListener(buttonListener);
61
54
btnDataSets[i].setData(ids[i]);
55
lblDesc = new Label(comp, SWT.WRAP);
56
lblDesc.setText(DataSetFactory.getDescription(btnDataSets[i].getData().toString()));
57
Label separator = new Label(comp, SWT.HORIZONTAL | SWT.SEPARATOR);
58
GridData separatorData = new GridData(GridData.FILL_HORIZONTAL);
59
separatorData.horizontalSpan=2;
60
separator.setLayoutData(separatorData);
64
FormData data2 = new FormData();
65
data2.left = new FormAttachment(cmpFilterOpts);
66
data2.top = new FormAttachment(0, 0);
67
data2.right = new FormAttachment(100, 0);
68
data2.bottom = new FormAttachment(100, 0);
70
lblDesc = new Label(comp, SWT.WRAP);
71
lblDesc.setLayoutData(data2);
76
67
public boolean canFlipToNextPage() {
77
return (dataSetID.length() > 0);
68
return !dataSetID.isEmpty();
80
72
public IWizardPage getNextPage() {
81
73
return DataSetFactory.getParsingWizardPage(dataSetID);
84
77
public void dispose() {
86
79
if(null != btnDataSets)