1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package pl.edu.agh.cast.importer.wizard.page;
19
20 import org.eclipse.jface.wizard.IWizardPage;
21 import org.eclipse.jface.wizard.WizardPage;
22
23 import pl.edu.agh.cast.importer.base.process.ImportProcess;
24 import pl.edu.agh.cast.importer.wizard.ImporterWizard;
25
26
27
28
29
30
31 public abstract class AbstractImportWizardPage extends WizardPage {
32
33 protected AbstractImportWizardPage(String pageName, String description) {
34 super(pageName);
35 setTitle(pageName);
36 setDescription(description);
37 }
38
39 public ImporterWizard getImportWizard() {
40 return (ImporterWizard)getWizard();
41 }
42
43 public ImportProcess getImportProcess() {
44 return getImportWizard().getImportProcess();
45 }
46
47 @Override
48 public IWizardPage getNextPage() {
49 return getImportWizard().getWizardStrategy().getNextPage(this);
50 }
51
52
53
54
55
56 public void widgetModified() {
57 setPageComplete(isComplete());
58 }
59
60
61
62
63 public void initPage() {
64
65 }
66
67
68
69
70
71 public void refreshImportData() {
72
73 }
74
75
76
77
78
79
80 @Override
81 public boolean canFlipToNextPage() {
82 return isComplete();
83 }
84
85
86
87
88
89
90 @Override
91 public void dispose() {
92 if (getControl() != null) {
93 getControl().dispose();
94 }
95 super.dispose();
96 }
97
98 protected abstract boolean isComplete();
99 }