1 7 8 package org.jdesktop.swing.form; 9 10 import org.jdesktop.swing.data.DataConstants; 11 import org.jdesktop.swing.data.DataModel; 12 import org.jdesktop.swing.data.MetaData; 13 14 import org.jdesktop.swing.binding.Binding; 15 16 import javax.swing.JComponent ; 17 18 54 55 public abstract class FormFactory { 56 private static FormFactory defaultFormFactory; 57 58 62 public static FormFactory getDefaultFormFactory() { 63 if (defaultFormFactory == null) { 64 defaultFormFactory = new DefaultFormFactory(); 65 } 66 return defaultFormFactory; 67 } 68 69 73 public static void setDefaultFormFactory(FormFactory formFactory) { 74 FormFactory.defaultFormFactory = formFactory; 75 } 76 77 86 public abstract JComponent createComponent(MetaData metaData); 87 88 97 public abstract Binding createBinding(DataModel model, String fieldName, JComponent component); 98 99 113 public abstract void addComponent(JComponent parent, JComponent component, MetaData metaData); 114 115 120 public boolean isNonVisual(MetaData metaData) { 121 return Boolean.TRUE 122 .equals(metaData.getCustomProperty(DataConstants.NON_VISUAL_FIELD)); 123 } 124 125 } | Popular Tags |