1 11 package org.eclipse.ui.internal.ide.dialogs; 12 13 import org.eclipse.jface.dialogs.IDialogConstants; 14 import org.eclipse.jface.wizard.WizardDialog; 15 import org.eclipse.swt.widgets.Button; 16 import org.eclipse.swt.widgets.Shell; 17 18 37 public class MultiStepWizardDialog extends WizardDialog { 38 private MultiStepWizard multiStepWizard; 39 40 46 public MultiStepWizardDialog(Shell parentShell, MultiStepWizard newWizard) { 47 super(parentShell, newWizard); 48 multiStepWizard = newWizard; 49 multiStepWizard.setWizardDialog(this); 50 } 51 52 55 void forceClose() { 56 super.finishPressed(); 57 } 58 59 62 protected void backPressed() { 63 if (multiStepWizard.isConfigureStepMode()) { 64 multiStepWizard.getStepContainer().backPressed(); 65 } else { 66 super.backPressed(); 67 } 68 } 69 70 73 protected void finishPressed() { 74 if (multiStepWizard.isConfigureStepMode()) { 75 boolean success = multiStepWizard.getStepContainer() 76 .performFinish(); 77 if (success) { 78 multiStepWizard.getStepContainer().processCurrentStep(); 79 } 80 } else { 81 super.finishPressed(); 82 } 83 } 84 85 88 MultiStepWizard getMultiStepWizard() { 89 return multiStepWizard; 90 } 91 92 95 protected void helpPressed() { 96 if (multiStepWizard.isConfigureStepMode()) { 97 multiStepWizard.getStepContainer().helpPressed(); 98 } else { 99 super.helpPressed(); 100 } 101 } 102 103 106 protected void nextPressed() { 107 if (multiStepWizard.isConfigureStepMode()) { 108 multiStepWizard.getStepContainer().nextPressed(); 109 } else { 110 super.nextPressed(); 111 } 112 } 113 114 117 void setFinishLabel(String label) { 118 Button button = getButton(IDialogConstants.FINISH_ID); 119 if (button == null) { 120 return; 121 } 122 123 if (label == null) { 124 if (!button.getText().equals(IDialogConstants.FINISH_LABEL)) { 125 button.setText(IDialogConstants.FINISH_LABEL); 126 button.getParent().layout(true); 127 } 128 } else { 129 button.setText(label); 130 button.getParent().layout(true); 131 } 132 } 133 134 137 void updateAll() { 138 super.update(); 139 } 140 141 144 void updateLayout() { 145 super.updateSize(getCurrentPage()); 146 } 147 } 148 | Popular Tags |