home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard;
-
- import asp.netobjects.nfx.util.ExceptionHandler;
- import asp.netobjects.nfx.util.ExternalError;
- import asp.netobjects.nfx.util.InternalError;
- import asp.netobjects.nfx.wizard.Wizard;
- import asp.netobjects.nfx.wizard.WizardPage;
- import asp.netobjects.nfx.wizard.WizardPageView;
- import asp.util.ResourceUtil;
- import asp.wizard.def.DefPage;
- import com.sun.java.swing.ImageIcon;
- import java.net.URL;
-
- public class WizardModelIntro extends WizardModelAbstract {
- private int _currentTemplateId = 0;
- // $FF: synthetic field
- static Class class$asp$wizard$WVPanelIntro;
-
- public WizardModelIntro(Wizard wizard, String bullet, String info, ImageIcon icon, ExceptionHandler handler) {
- super(wizard, bullet, info, icon, handler);
- this.initImgLeft();
- }
-
- private void initImgLeft() {
- String imgFile = ResourceUtil.getResourceString("asp.wizard.res", class$asp$wizard$WVPanelIntro != null ? class$asp$wizard$WVPanelIntro : (class$asp$wizard$WVPanelIntro = class$("asp.wizard.WVPanelIntro")), "image.pageimage");
- if (imgFile != null && !imgFile.equals("")) {
- URL url = this.getClass().getResource("image/" + imgFile);
- if (url != null) {
- super.dmIcon = new ImageIcon(url);
- }
- } else {
- super.dmIcon = null;
- }
-
- }
-
- public boolean isValid() {
- return true;
- }
-
- protected WizardPageView getViewSingleInstance() {
- return WizardViewIntro.getInstance();
- }
-
- private int getSeqTemplateId() {
- WizardViewIntro wv = (WizardViewIntro)((WizardPage)this).getView();
- return wv.getSeqTemplateId();
- }
-
- public WizardPage getNext() throws InternalError, ExternalError {
- WizardPage next = super.getNext();
- WizardManager wm = ((WizardModelAbstract)this).getWizardManager();
- int nextSeqTemplateId = this.getSeqTemplateId();
- DefPage firstPage = null;
- if (next != null && ((WizardModelAbstract)next).getTemplateId() != nextSeqTemplateId) {
- wm.removeSequence(next);
- next = null;
- }
-
- if (next == null) {
- firstPage = wm.createDefPage(this, nextSeqTemplateId);
- wm.addSequence(this, this, firstPage, this.getSeqTemplateId(), (DefPage)null);
- wm.setFirstDefPage(firstPage);
- wm.updateNextDefPageId(this, nextSeqTemplateId);
- next = super.getNext();
- }
-
- return next;
- }
-
- public void validate() throws InternalError, ExternalError {
- super.validate();
- if (this.getSeqTemplateId() == -1) {
- throw new ExternalError("Please specify your choice");
- }
- }
-
- public void commit() throws InternalError, ExternalError {
- this._currentTemplateId = this.getSeqTemplateId();
- }
-
- public void loadView() {
- ((WizardViewIntro)((WizardPage)this).getView()).setSeqTemplateId(this._currentTemplateId);
- }
-
- // $FF: synthetic method
- static Class class$(String class$) {
- try {
- return Class.forName(class$);
- } catch (ClassNotFoundException forName) {
- throw new NoClassDefFoundError(((Throwable)forName).getMessage());
- }
- }
- }
-