1 19 20 package org.netbeans.modules.form.beaninfo.swing; 21 22 import java.beans.*; 23 import javax.swing.border.TitledBorder ; 24 25 public class TitledBorderBeanInfo extends BISupport { 26 27 public TitledBorderBeanInfo() { 28 super("titledBorder", javax.swing.border.TitledBorder .class); } 30 31 protected PropertyDescriptor[] createPropertyDescriptors() throws IntrospectionException { 32 PropertyDescriptor[] pds = new PropertyDescriptor[] { 33 createRW(TitledBorder .class, "border"), createRW(TitledBorder .class, "title"), createRW(TitledBorder .class, "titleJustification"), createRW(TitledBorder .class, "titlePosition"), createRW(TitledBorder .class, "titleColor"), createRW(TitledBorder .class, "titleFont"), }; 40 pds[2].setPropertyEditorClass(JustificationPropertyEditor.class); 41 pds[3].setPropertyEditorClass(PositionPropertyEditor.class); 42 return pds; 43 } 44 45 46 public static class PositionPropertyEditor extends BISupport.TaggedPropertyEditor { 47 public PositionPropertyEditor() { 48 super( 49 new int[] { 50 TitledBorder.DEFAULT_POSITION, 51 TitledBorder.ABOVE_TOP, 52 TitledBorder.TOP, 53 TitledBorder.BELOW_TOP, 54 TitledBorder.ABOVE_BOTTOM, 55 TitledBorder.BOTTOM, 56 TitledBorder.BELOW_BOTTOM 57 }, 58 new String [] { 59 "javax.swing.border.TitledBorder.DEFAULT_POSITION", "javax.swing.border.TitledBorder.ABOVE_TOP", "javax.swing.border.TitledBorder.TOP", "javax.swing.border.TitledBorder.BELOW_TOP", "javax.swing.border.TitledBorder.ABOVE_BOTTOM", "javax.swing.border.TitledBorder.BOTTOM", "javax.swing.border.TitledBorder.BELOW_BOTTOM" }, 67 new String [] { 68 "VALUE_PosDefault", "VALUE_PosAboveTop", "VALUE_PosTop", "VALUE_PosBelowTop", "VALUE_PosAboveBottom", "VALUE_PosBottom", "VALUE_PosBelowBottom", } 76 ); 77 } 78 } 79 80 public static class JustificationPropertyEditor extends BISupport.TaggedPropertyEditor { 81 public JustificationPropertyEditor() { 82 super( 83 new int[] { 84 TitledBorder.DEFAULT_JUSTIFICATION, 85 TitledBorder.LEFT, 86 TitledBorder.CENTER, 87 TitledBorder.RIGHT, 88 TitledBorder.LEADING, 89 TitledBorder.TRAILING, 90 }, 91 new String [] { 92 "javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION", "javax.swing.border.TitledBorder.LEFT", "javax.swing.border.TitledBorder.CENTER", "javax.swing.border.TitledBorder.RIGHT", "javax.swing.border.TitledBorder.LEADING", "javax.swing.border.TitledBorder.TRAILING", }, 99 new String [] { 100 "VALUE_JustDefault", "VALUE_JustLeft", "VALUE_JustCenter", "VALUE_JustRight", "VALUE_JustLeading", "VALUE_JustTrailing", } 107 ); 108 } 109 } 110 111 } 112 | Popular Tags |