01: package com.salmonllc.ideTools.eclipse;
02:
03: import org.eclipse.jface.wizard.WizardPage;
04: import org.eclipse.swt.SWT;
05: import org.eclipse.swt.events.SelectionEvent;
06: import org.eclipse.swt.events.SelectionListener;
07: import org.eclipse.swt.layout.GridData;
08: import org.eclipse.swt.layout.GridLayout;
09: import org.eclipse.swt.widgets.Button;
10: import org.eclipse.swt.widgets.Composite;
11: import org.eclipse.swt.widgets.Label;
12:
13: /**
14: * @author Administrator
15: *
16: * To change this generated comment edit the template variable "typecomment":
17: * Window>Preferences>Java>Templates.
18: * To enable and disable the creation of type comments go to
19: * Window>Preferences>Java>Code Generation.
20: */
21: public class SalmonFrameworkUpgradeWizardPage extends WizardPage
22: implements SelectionListener {
23:
24: Button _doUpgrade;
25:
26: public SalmonFrameworkUpgradeWizardPage(String pageName,
27: String descriptionMessage) {
28: super (pageName);
29: setDescription(descriptionMessage);
30: setPageComplete(false);
31: }
32:
33: public void createControl(Composite parent) {
34: Composite composite = new Composite(parent, SWT.NULL);
35:
36: GridLayout l = new GridLayout();
37: composite.setLayout(l);
38: composite.setLayoutData(new GridData(GridData.FILL_BOTH));
39: l.numColumns = 2;
40:
41: _doUpgrade = createCheckBox(
42: composite,
43: "Reload the code for the existing project? This will replace all the code in the existing project!");
44:
45: setControl(composite);
46: }
47:
48: public Button createCheckBox(Composite parent, String labelText) {
49:
50: Label label = new Label(parent, SWT.NONE);
51: label.setText(labelText);
52: label.setEnabled(true);
53:
54: Button b = new Button(parent, SWT.CHECK | SWT.LEFT);
55: b.setSelection(false);
56: b.setEnabled(true);
57: b.addSelectionListener(this );
58: return b;
59: }
60:
61: public boolean getDoUpgrade() {
62: return _doUpgrade.getSelection();
63: }
64:
65: /* (non-Javadoc)
66: * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
67: */
68: public void widgetSelected(SelectionEvent arg0) {
69: setPageComplete(getDoUpgrade());
70:
71: }
72:
73: /* (non-Javadoc)
74: * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
75: */
76: public void widgetDefaultSelected(SelectionEvent arg0) {
77:
78: }
79:
80: }
|