1 19 24 25 package org.netbeans.modules.j2ee.sun.ide.j2ee; 26 27 28 import java.awt.Image ; 29 import java.beans.BeanDescriptor ; 30 import java.beans.BeanInfo ; 31 import java.beans.IntrospectionException ; 32 import java.beans.PropertyDescriptor ; 33 import java.beans.SimpleBeanInfo ; 34 import java.lang.Class ; 35 import org.openide.util.NbBundle; 36 import org.netbeans.modules.j2ee.sun.ide.editors.CharsetDisplayPreferenceEditor; 37 import org.netbeans.modules.j2ee.sun.ide.editors.LoggingLevelEditor; 38 import org.openide.util.Utilities; 39 40 44 public class PluginOptionsBeanInfo extends SimpleBeanInfo { 45 public PropertyDescriptor [] getPropertyDescriptors() { 46 50 PropertyDescriptor [] retValue = new PropertyDescriptor [] { 51 createPropertyDescriptor("charsetDisplayPreference", "LBL_CharsetDispPref", "DSC_CharsetDispPref", CharsetDisplayPreferenceEditor.class), createPropertyDescriptor("logLevel", "LBL_PluginLogLevel", "DSC_PluginLogLevel", LoggingLevelEditor.class), createPropertyDescriptor("incrementalDeploy", "LBL_INCREMENTAL", "DSC_INCREMENTAL") 59 }; 60 return retValue; 61 } 62 63 private PropertyDescriptor createPropertyDescriptor(String name, String displayName, String shortDescription) { 64 return createPropertyDescriptor(name, displayName, shortDescription, null); 65 } 66 67 private PropertyDescriptor createPropertyDescriptor(String name, String displayName, String shortDescription, Class editor) { 68 try { 69 PropertyDescriptor result = new PropertyDescriptor (name, PluginOptions.class); 70 result.setDisplayName(NbBundle.getMessage(PluginOptionsBeanInfo.class, displayName)); 71 result.setShortDescription(NbBundle.getMessage(PluginOptionsBeanInfo.class, shortDescription)); 72 if (editor != null) 73 result.setPropertyEditorClass(editor); 74 return result; 75 } 76 catch (IntrospectionException e) { 77 return null; 78 } 79 } 80 81 public BeanDescriptor getBeanDescriptor() { 82 BeanDescriptor retval = new BeanDescriptor (PluginOptions.class , null ); 83 retval.setDisplayName(NbBundle.getMessage(PluginOptionsBeanInfo.class, "OpenIDE-Module-Name")); return retval; 85 } 86 87 public Image getIcon(int type) { 88 return Utilities.loadImage("org/netbeans/modules/j2ee/sun/ide/resources/sun-cluster_16_pad.gif"); } 90 } 91 | Popular Tags |