1 package org.apache.ojb.tools.mapping.reversedb2.propertyEditors; 2 3 17 18 44 45 abstract public class PropertyEditor extends javax.swing.JPanel 46 { 47 private PropertyEditorTarget propertyTarget = null; 48 private java.beans.PropertyChangeListener aPropertyChangeListener = null; 49 50 51 public PropertyEditor () 52 { 53 initComponents (); 54 } 55 56 public void setEditorTarget(PropertyEditorTarget target) 57 { 58 if (propertyTarget != null && aPropertyChangeListener != null) 59 { 60 propertyTarget.removePropertyChangeListener(aPropertyChangeListener); 61 } 62 propertyTarget = target; 63 if (propertyTarget != null && aPropertyChangeListener != null) 64 { 65 propertyTarget.addPropertyChangeListener(aPropertyChangeListener); 66 } 67 68 java.awt.Component c[] = this.getComponents(); 69 for (int i = 0; i < c.length; i++) 70 { 71 if (c[i] instanceof PropertyEditorComponentInterface) 72 ((PropertyEditorComponentInterface)c[i]).setEditorTarget(target); 73 } 74 } 75 76 public PropertyEditorTarget getEditorTarget() 77 { 78 return propertyTarget; 79 } 80 81 public void setPropertyChangeListener(java.beans.PropertyChangeListener pListener) 82 { 83 if (propertyTarget != null && aPropertyChangeListener != null) 84 { 85 propertyTarget.removePropertyChangeListener(aPropertyChangeListener); 86 } 87 aPropertyChangeListener = pListener; 88 if (propertyTarget != null && aPropertyChangeListener != null) 89 { 90 propertyTarget.addPropertyChangeListener(aPropertyChangeListener); 91 } 92 } 93 94 99 private void initComponents () 100 { 102 setLayout (new java.awt.BorderLayout ()); 103 104 } 106 107 110 } 111 | Popular Tags |