1 16 17 package org.mc4j.console.connection.wizard; 18 19 import org.mc4j.ems.connection.settings.ConnectionSettings; 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 ConnectionDescriptor extends WizardDescriptor { 33 34 private final ConnectionIterator iterator; 35 36 protected ConnectionSettings settings; 37 38 42 public ConnectionDescriptor() { 43 this(new ConnectionIterator()); 44 this.settings = new ConnectionSettings(); 45 46 this.iterator.setDescriptor(this); 47 } 48 49 private ConnectionDescriptor(ConnectionIterator iterator) { 50 super(iterator); 51 this.iterator = iterator; 52 53 setTitle(NbBundle.getMessage(ConnectionDescriptor.class, "TITLE_wizard")); 55 putProperty("WizardPanel_autoWizardStyle", Boolean.TRUE); putProperty("WizardPanel_contentDisplayed", Boolean.TRUE); putProperty("WizardPanel_contentNumbered", Boolean.TRUE); 62 63 64 69 putProperty("WizardPanel_helpDisplayed", Boolean.TRUE); putProperty("WizardPanel_leftDimension", new Dimension(100, 400)); 74 75 try { 77 putProperty("WizardPanel_image", Toolkit.getDefaultToolkit().getImage 79 (new URL ("nbresloc:/org/mc4j/console/Wizard.gif"))); } catch (MalformedURLException mfue) { 81 throw new IllegalStateException (mfue.toString()); 82 } 83 84 85 } 86 87 protected void updateState() { 89 super.updateState(); 90 putProperty("WizardPanel_contentData", iterator.getSteps()); putProperty("WizardPanel_contentSelectedIndex", new Integer (iterator.getIndex())); } 93 94 95 96 public ConnectionSettings getSettings() { 97 return this.settings; 98 } 99 100 } 101 | Popular Tags |