1 19 20 package org.netbeans.modules.editor.options; 21 22 import java.awt.Image ; 23 import java.beans.SimpleBeanInfo ; 24 import java.beans.BeanInfo ; 25 import java.beans.PropertyDescriptor ; 26 27 32 33 public class ColoringBeanBeanInfo extends SimpleBeanInfo { 34 35 private String iconPrefix = "/org/netbeans/editor/resources/coloring"; 37 38 private Image icon; 39 private Image icon32; 40 41 45 public PropertyDescriptor [] getPropertyDescriptors () { 46 PropertyDescriptor [] descriptors; 47 try { 48 descriptors = new PropertyDescriptor [] { 49 new PropertyDescriptor ("coloring", ColoringBean.class) }; 51 descriptors[0].setPropertyEditorClass(ColoringEditor.class); 52 } catch (Exception e) { 53 descriptors = new PropertyDescriptor [0]; 54 } 55 return descriptors; 56 } 57 58 61 public Image getIcon(final int type) { 62 if ((type == BeanInfo.ICON_COLOR_16x16) || (type == BeanInfo.ICON_MONO_16x16)) { 63 if (icon == null) 64 icon = loadImage(iconPrefix + ".gif"); return icon; 66 } 67 else { 68 if (icon32 == null) 69 icon32 = loadImage(iconPrefix + "32.gif"); return icon32; 71 } 72 } 73 74 } 75 | Popular Tags |