1 19 20 23 24 package org.netbeans.modules.j2ee.sun.ws7.ui; 25 import org.openide.WizardDescriptor; 26 import org.openide.ErrorManager; 27 import java.util.Set ; 28 import java.util.ArrayList ; 29 import java.util.Enumeration ; 30 import java.util.HashSet ; 31 import java.util.Iterator ; 32 import java.util.List ; 33 import java.util.Properties ; 34 import java.util.Set ; 35 import javax.swing.event.ChangeListener ; 36 import javax.swing.JComponent ; 37 import java.awt.Component ; 38 import java.util.NoSuchElementException ; 39 import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties; 40 41 42 46 public class WS70ServerUIWizardIterator implements WizardDescriptor.InstantiatingIterator { 47 48 private final static String PROP_CONTENT_DATA = "WizardPanel_contentData"; private final static String PROP_CONTENT_SELECTED_INDEX = "WizardPanel_contentSelectedIndex"; public final static String PROP_ERROR_MESSAGE = "WizardPanel_errorMessage"; private final static String PROP_DISPLAY_NAME = "ServInstWizard_displayName"; public final static String PROP_LOCAL_SERVER = "LocalServer"; public final static String PROP_SSL_PORT = "SSLAdminPort"; private WS70AddServerChoicePanel panel; 55 private WizardDescriptor wizard; 56 60 public WS70ServerUIWizardIterator() { 61 } 62 63 public void initialize(WizardDescriptor wizard){ 65 this.wizard = wizard; 66 } 67 public Set instantiate(){ 69 WS70AddServerChoiceVisualPanel visualPanel = (WS70AddServerChoiceVisualPanel)panel.getComponent(); 70 try { 71 String host = visualPanel.getAdminHost(); 72 String port = visualPanel.getAdminPort(); 73 String user = visualPanel.getAdminUserName(); 74 String password = visualPanel.getAdminPassword(); 75 String location = visualPanel.getServerLocation(); 76 String displayName = (String )wizard.getProperty(PROP_DISPLAY_NAME); 77 boolean localserver = visualPanel.isLocalServer(); 78 boolean sslport = visualPanel.isAdminOnSSL(); 79 InstanceProperties ip = WS70URIManager.createInstanceProperties(location, host, port, user, password, displayName); 80 ip.setProperty(PROP_LOCAL_SERVER, Boolean.toString(localserver)); 81 ip.setProperty(PROP_SSL_PORT, Boolean.toString(sslport)); 82 Set result = new HashSet (); 83 result.add(ip); 84 return result; 85 } catch (Exception ex) { 86 ErrorManager.getDefault().log(ErrorManager.EXCEPTION, ex.getMessage()); 87 return null; 88 } 89 } 90 public void uninitialize(WizardDescriptor wizard){ 92 93 } 94 public WizardDescriptor.Panel current(){ 96 if(panel==null){ 97 panel = new WS70AddServerChoicePanel(); 98 } 99 Component c = panel.getComponent(); 100 String [] steps = new String [1]; 101 steps[0]=c.getName(); 102 if (c instanceof JComponent ) { JComponent jc = (JComponent ) c; 104 jc.putClientProperty("WizardPanel_contentData", steps); jc.putClientProperty("WizardPanel_autoWizardStyle", Boolean.TRUE); 109 jc.putClientProperty("WizardPanel_contentDisplayed", Boolean.TRUE); 112 jc.putClientProperty("WizardPanel_contentNumbered", Boolean.TRUE); 115 } 116 return panel; 117 } 118 119 public void previousPanel(){ 121 throw new NoSuchElementException (); 122 123 } 124 public void nextPanel(){ 126 throw new NoSuchElementException (); 127 } 128 public boolean hasPrevious(){ 130 return false; 131 } 132 public boolean hasNext(){ 134 return false; 135 } 136 public void addChangeListener(ChangeListener listener){ 138 139 } 140 public void removeChangeListener(ChangeListener listener){ 142 143 } 144 public String name(){ 146 return ""; 147 } 148 149 } 150 | Popular Tags |