aboutsummaryrefslogtreecommitdiffstats
path: root/org.openembedded.bc.ui/src/org/openembedded/bc/ui/wizards/FiniteStateWizard.java
blob: 575b3ec105f305fe09d33f8aa5b3a811c01792f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package org.openembedded.bc.ui.wizards;
import java.util.Map;

import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.widgets.Composite;



public abstract class FiniteStateWizard extends Wizard {
    private boolean finishable = false;
    private boolean canFinish;

    public FiniteStateWizard() {                
    }
    
    public abstract boolean performFinish();

    /**
     * @return Returns if the wizard is finishable in its current state.
     */
    public boolean isFinishable() {
        return finishable;
    }
    /**
     * @param finishable Change the finish state of the wizard.
     */
    public void setFinishable(boolean finishable) {
        this.finishable = finishable;
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.jface.wizard.IWizard#createPageControls(org.eclipse.swt.widgets.Composite)
     */
    public void createPageControls(Composite pageContainer) {
        super.createPageControls(pageContainer);        
    }

    /*
     * (non-Javadoc) Method declared on IWizard.
     */
    public boolean canFinish() {
      if (canFinish)
        return true;
      return super.canFinish();
    }
    
    public void setCanFinish(boolean canFinish) {
      this.canFinish = canFinish;
    }
    
    /**
     * Retrive the model object from the wizard.
     * @return
     */
    public abstract Map getModel();
}