1 19 20 package org.netbeans.modules.form.wizard; 21 22 import javax.swing.event.*; 23 import java.lang.reflect.Method ; 24 import org.netbeans.modules.form.*; 25 26 32 33 class ConnectionWizardPanel3 implements org.openide.WizardDescriptor.Panel { 34 35 private FormModel formModel; 36 private Method method; 37 38 private EventListenerList listenerList = null; 39 40 private ConnectionPanel3 uiPanel; 41 42 44 ConnectionWizardPanel3(FormModel model) { 45 formModel = model; 46 } 47 48 FormModel getFormModel() { 49 return formModel; 50 } 51 52 void setMethod(Method m) { 53 method = m; 54 if (uiPanel != null) 55 uiPanel.setMethod(m); 56 } 57 58 String getParametersText() { 59 return uiPanel != null ? uiPanel.getParametersText() : null; 60 } 61 62 Object [] getParameters() { 63 return uiPanel != null ? uiPanel.getParameters() : null; 64 } 65 66 69 public java.awt.Component getComponent() { 70 if (uiPanel == null) { 71 uiPanel = new ConnectionPanel3(this); 72 if (method != null) 73 uiPanel.setMethod(method); 74 } 75 return uiPanel; 76 } 77 78 public org.openide.util.HelpCtx getHelp() { 79 return new org.openide.util.HelpCtx("gui.connecting.code"); } 81 82 public boolean isValid() { 83 return uiPanel != null ? uiPanel.isFilled() : false; 84 } 85 86 public void readSettings(java.lang.Object settings) { 87 } 88 89 public void storeSettings(java.lang.Object settings) { 90 } 91 92 public void addChangeListener(ChangeListener listener) { 93 if (listenerList == null) 94 listenerList = new EventListenerList(); 95 listenerList.add(ChangeListener.class, listener); 96 } 97 98 public void removeChangeListener(ChangeListener listener) { 99 if (listenerList != null) 100 listenerList.remove(ChangeListener.class, listener); 101 } 102 103 105 void fireStateChanged() { 106 if (listenerList == null) 107 return; 108 109 ChangeEvent e = null; 110 Object [] listeners = listenerList.getListenerList(); 111 for (int i = listeners.length-2; i>=0; i-=2) { 112 if (listeners[i] == ChangeListener.class) { 113 if (e == null) 114 e = new ChangeEvent(this); 115 ((ChangeListener)listeners[i+1]).stateChanged(e); 116 } 117 } 118 } 119 } 120 | Popular Tags |