/** * Enables/disables the buttons according to the current step. A good idea would be to ask the * panels to return the status... */ private void enableButtons() { this.previousButton.setEnabled(this.step > 0); this.nextButton.setEnabled(canDoNextPanel()); this.finishButton.setEnabled(canFinish()); this.helpButton.setEnabled(false); }
/** * Standard constructor - builds a new WizardDialog owned by the specified JFrame. * * @param owner the owner. * @param modal modal? * @param title the title. * @param firstPanel the first panel. */ public WizardDialog(final JFrame owner, final boolean modal, final String title, final WizardPanel firstPanel) { super(owner, title + " : step 1", modal); this.result = null; this.currentPanel = firstPanel; this.step = 0; this.panels = new ArrayList(); this.panels.add(firstPanel); setContentPane(createContent()); }
/** * Handles a click on the "previous" button, by displaying the previous panel in the sequence. */ public void previous() { if (this.step > 0) { final WizardPanel previousPanel = getWizardPanel(this.step - 1); // tell the panel that we are returning previousPanel.returnFromLaterStep(); final Container content = getContentPane(); content.remove(this.currentPanel); content.add(previousPanel); this.step = this.step - 1; this.currentPanel = previousPanel; setTitle("Step " + (this.step + 1)); enableButtons(); pack(); } }
/** * Handles events. * * @param event the event. */ public void actionPerformed(final ActionEvent event) { final String command = event.getActionCommand(); if (command.equals("nextButton")) { next(); } else if (command.equals("previousButton")) { previous(); } else if (command.equals("finishButton")) { finish(); } }
/** * Handles events. * * @param event the event. */ public void actionPerformed(final ActionEvent event) { final String command = event.getActionCommand(); if (command.equals("nextButton")) { next(); } else if (command.equals("previousButton")) { previous(); } else if (command.equals("finishButton")) { finish(); } }
/** * Handles a click on the "previous" button, by displaying the previous panel in the sequence. */ public void previous() { if (this.step > 0) { final WizardPanel previousPanel = getWizardPanel(this.step - 1); // tell the panel that we are returning previousPanel.returnFromLaterStep(); final Container content = getContentPane(); content.remove(this.currentPanel); content.add(previousPanel); this.step = this.step - 1; this.currentPanel = previousPanel; setTitle("Step " + (this.step + 1)); enableButtons(); pack(); } }
/** * Handles events. * * @param event the event. */ public void actionPerformed(final ActionEvent event) { final String command = event.getActionCommand(); if (command.equals("nextButton")) { next(); } else if (command.equals("previousButton")) { previous(); } else if (command.equals("finishButton")) { finish(); } }
/** * Standard constructor - builds a new WizardDialog owned by the specified JFrame. * * @param owner the owner. * @param modal modal? * @param title the title. * @param firstPanel the first panel. */ public WizardDialog(final JFrame owner, final boolean modal, final String title, final WizardPanel firstPanel) { super(owner, title + " : step 1", modal); this.result = null; this.currentPanel = firstPanel; this.step = 0; this.panels = new ArrayList(); this.panels.add(firstPanel); setContentPane(createContent()); }
/** * Enables/disables the buttons according to the current step. A good idea would be to ask the * panels to return the status... */ private void enableButtons() { this.previousButton.setEnabled(this.step > 0); this.nextButton.setEnabled(canDoNextPanel()); this.finishButton.setEnabled(canFinish()); this.helpButton.setEnabled(false); }
/** * Handles a click on the "previous" button, by displaying the previous panel in the sequence. */ public void previous() { if (this.step > 0) { final WizardPanel previousPanel = getWizardPanel(this.step - 1); // tell the panel that we are returning previousPanel.returnFromLaterStep(); final Container content = getContentPane(); content.remove(this.currentPanel); content.add(previousPanel); this.step = this.step - 1; this.currentPanel = previousPanel; setTitle("Step " + (this.step + 1)); enableButtons(); pack(); } }
/** * Standard constructor - builds and returns a new WizardDialog. * * @param owner the owner. * @param modal modal? * @param title the title. * @param firstPanel the first panel. */ public WizardDialog(final JDialog owner, final boolean modal, final String title, final WizardPanel firstPanel) { super(owner, title + " : step 1", modal); this.result = null; this.currentPanel = firstPanel; this.step = 0; this.panels = new ArrayList(); this.panels.add(firstPanel); setContentPane(createContent()); }
/** * Enables/disables the buttons according to the current step. A good idea would be to ask the * panels to return the status... */ private void enableButtons() { this.previousButton.setEnabled(this.step > 0); this.nextButton.setEnabled(canDoNextPanel()); this.finishButton.setEnabled(canFinish()); this.helpButton.setEnabled(false); }
/** * Displays the next step in the wizard sequence. */ public void next() { WizardPanel nextPanel = getWizardPanel(this.step + 1); if (nextPanel != null) { if (!this.currentPanel.canRedisplayNextPanel()) { nextPanel = this.currentPanel.getNextPanel(); } } else { nextPanel = this.currentPanel.getNextPanel(); } this.step = this.step + 1; if (this.step < this.panels.size()) { this.panels.set(this.step, nextPanel); } else { this.panels.add(nextPanel); } final Container content = getContentPane(); content.remove(this.currentPanel); content.add(nextPanel); this.currentPanel = nextPanel; setTitle("Step " + (this.step + 1)); enableButtons(); pack(); }
/** * Standard constructor - builds a new WizardDialog owned by the specified JFrame. * * @param owner the owner. * @param modal modal? * @param title the title. * @param firstPanel the first panel. */ public WizardDialog(final JFrame owner, final boolean modal, final String title, final WizardPanel firstPanel) { super(owner, title + " : step 1", modal); this.result = null; this.currentPanel = firstPanel; this.step = 0; this.panels = new ArrayList(); this.panels.add(firstPanel); setContentPane(createContent()); }
/** * Displays the next step in the wizard sequence. */ public void next() { WizardPanel nextPanel = getWizardPanel(this.step + 1); if (nextPanel != null) { if (!this.currentPanel.canRedisplayNextPanel()) { nextPanel = this.currentPanel.getNextPanel(); } } else { nextPanel = this.currentPanel.getNextPanel(); } this.step = this.step + 1; if (this.step < this.panels.size()) { this.panels.set(this.step, nextPanel); } else { this.panels.add(nextPanel); } final Container content = getContentPane(); content.remove(this.currentPanel); content.add(nextPanel); this.currentPanel = nextPanel; setTitle("Step " + (this.step + 1)); enableButtons(); pack(); }
/** * Standard constructor - builds and returns a new WizardDialog. * * @param owner the owner. * @param modal modal? * @param title the title. * @param firstPanel the first panel. */ public WizardDialog(final JDialog owner, final boolean modal, final String title, final WizardPanel firstPanel) { super(owner, title + " : step 1", modal); this.result = null; this.currentPanel = firstPanel; this.step = 0; this.panels = new ArrayList(); this.panels.add(firstPanel); setContentPane(createContent()); }
/** * Displays the next step in the wizard sequence. */ public void next() { WizardPanel nextPanel = getWizardPanel(this.step + 1); if (nextPanel != null) { if (!this.currentPanel.canRedisplayNextPanel()) { nextPanel = this.currentPanel.getNextPanel(); } } else { nextPanel = this.currentPanel.getNextPanel(); } this.step = this.step + 1; if (this.step < this.panels.size()) { this.panels.set(this.step, nextPanel); } else { this.panels.add(nextPanel); } final Container content = getContentPane(); content.remove(this.currentPanel); content.add(nextPanel); this.currentPanel = nextPanel; setTitle("Step " + (this.step + 1)); enableButtons(); pack(); }
/** * Standard constructor - builds and returns a new WizardDialog. * * @param owner the owner. * @param modal modal? * @param title the title. * @param firstPanel the first panel. */ public WizardDialog(final JDialog owner, final boolean modal, final String title, final WizardPanel firstPanel) { super(owner, title + " : step 1", modal); this.result = null; this.currentPanel = firstPanel; this.step = 0; this.panels = new ArrayList(); this.panels.add(firstPanel); setContentPane(createContent()); }