home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2003 March / DPPCPRO0303.ISO / Components / Microsoft ASP / _SETUP.1 / ASPWizard.jar / asp / wizard / WizardViewAbstract.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-20  |  2.7 KB  |  78 lines

  1. package asp.wizard;
  2.  
  3. import asp.netobjects.nfx.wizard.WizardPage;
  4. import asp.netobjects.nfx.wizard.WizardPageView;
  5. import com.sun.java.swing.BorderFactory;
  6. import com.sun.java.swing.JComponent;
  7. import com.sun.java.swing.JLabel;
  8. import com.sun.java.swing.JPanel;
  9. import java.awt.BorderLayout;
  10. import java.awt.Container;
  11.  
  12. public class WizardViewAbstract extends WizardPageView {
  13.    public WizardViewAbstract() {
  14.       if (((WizardPageView)this).getContentPanel() != null) {
  15.          JPanel contentPanel = ((WizardPageView)this).getContentPanel();
  16.          ((JComponent)contentPanel).setBorder(BorderFactory.createEmptyBorder());
  17.       }
  18.  
  19.       JPanel p = ((WizardPageView)this).getContentPanel();
  20.       ((Container)p).setLayout(new BorderLayout());
  21.       ((Container)p).add(new JLabel(this.getClass().getName()), "Center");
  22.       this.createMainPanel();
  23.       this.setupMainPanel();
  24.    }
  25.  
  26.    public WizardViewAbstract(WizardPage page) {
  27.       super(page);
  28.       JPanel p = null;
  29.       p = ((WizardPageView)this).getContentPanel();
  30.       ((Container)p).setLayout(new BorderLayout());
  31.       ((Container)p).add(new JLabel(this.getClass().getName()), "Center");
  32.       this.createMainPanel();
  33.       this.setupMainPanel();
  34.    }
  35.  
  36.    protected void createMainPanel() {
  37.    }
  38.  
  39.    protected void setupMainPanel() {
  40.       if (this.getMainPanel() != null) {
  41.          JPanel p = ((WizardPageView)this).getContentPanel();
  42.          ((Container)p).setLayout(new BorderLayout());
  43.          ((Container)p).add(this.getMainPanel(), "Center");
  44.       }
  45.  
  46.    }
  47.  
  48.    public boolean isValid() {
  49.       return true;
  50.    }
  51.  
  52.    public WVPanelBase getMainPanel() {
  53.       return null;
  54.    }
  55.  
  56.    public void updateView(WizardModelAbstract model, Object arg) {
  57.    }
  58.  
  59.    public void setModel(WizardPage model) {
  60.       super.setModel(model);
  61.       ((WizardModelAbstract)((WizardPageView)this).getModel()).loadView();
  62.    }
  63.  
  64.    public void setIntroText(String heading, String body, boolean useDefault) {
  65.       if (this.getMainPanel() != null) {
  66.          if (useDefault) {
  67.             this.getMainPanel().initIntroText();
  68.          } else {
  69.             this.getMainPanel().setIntroText(heading, body);
  70.          }
  71.       }
  72.  
  73.    }
  74.  
  75.    public void commit() {
  76.    }
  77. }
  78.