1 16 17 package org.mc4j.console.connection.create; 18 19 import org.mc4j.ems.connection.EmsConnection; 20 import org.openide.WizardDescriptor; 21 import org.openide.util.NbBundle; 22 23 import java.awt.*; 24 import java.net.MalformedURLException ; 25 import java.net.URL ; 26 27 32 public class CreateWizardDescriptor extends WizardDescriptor { 33 34 private final CreateWizardIterator iterator; 35 36 private CreateMBeanData data; 37 private EmsConnection connection; 38 39 43 public CreateWizardDescriptor(EmsConnection connection) { 44 this(new CreateWizardIterator()); 45 this.connection = connection; 46 this.data = new CreateMBeanData(); 47 48 this.iterator.setDescriptor(this); 49 } 50 51 public CreateWizardIterator getIterator() { 52 return iterator; 53 } 54 55 public EmsConnection getConnection() { 56 return connection; 57 } 58 59 60 private CreateWizardDescriptor(CreateWizardIterator iterator) { 61 super(iterator); 62 this.iterator = iterator; 63 64 setTitle(NbBundle.getMessage(CreateWizardDescriptor.class, "TITLE_wizard")); 66 putProperty("WizardPanel_autoWizardStyle", Boolean.TRUE); putProperty("WizardPanel_contentDisplayed", Boolean.TRUE); putProperty("WizardPanel_contentNumbered", Boolean.TRUE); 73 74 75 80 putProperty("WizardPanel_helpDisplayed", Boolean.TRUE); putProperty("WizardPanel_leftDimension", new Dimension(100, 400)); 85 86 try { 88 putProperty("WizardPanel_image", Toolkit.getDefaultToolkit().getImage 90 (new URL ("nbresloc:/org/mc4j/console/Wizard.gif"))); } catch (MalformedURLException mfue) { 92 throw new IllegalStateException (mfue.toString()); 93 } 94 95 96 } 97 98 protected void updateState() { 100 super.updateState(); 101 putProperty("WizardPanel_contentData", iterator.getSteps()); putProperty("WizardPanel_contentSelectedIndex", new Integer (iterator.getIndex())); } 104 105 106 107 public CreateMBeanData getData() { 108 return this.data; 109 } 110 111 } 112 | Popular Tags |