⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loginbeaninfo.java

📁 webwork source
💻 JAVA
字号:
/* * WebWork, Web Application Framework * * Distributable under Apache license. * See terms of license at opensource.org */package webwork.examples.events;import java.beans.BeanInfo;import java.beans.Introspector;import java.beans.PropertyDescriptor;import java.beans.SimpleBeanInfo;import java.util.ArrayList;/** * This code is an adaptation of the EventHandler example from the Rocks homepage by Christian Cryder * http://xmlc.enhydra.org/EventHandler/ */public class LoginBeanInfo   extends SimpleBeanInfo{   // Public  -------------------------------------------------------      public PropertyDescriptor[] getPropertyDescriptors()   {      try      {         ArrayList list = new ArrayList();                  PropertyDescriptor descriptor;               descriptor = new PropertyDescriptor("name", Login.class);         descriptor.setPropertyEditorClass(NameEditor.class);         list.add(descriptor);               descriptor = new PropertyDescriptor("password", Login.class);         descriptor.setPropertyEditorClass(PasswordEditor.class);         list.add(descriptor);         descriptor = new PropertyDescriptor("autoLogin", Login.class, "getAutoLogin", null);         list.add(descriptor);         return (PropertyDescriptor[])list.toArray(new PropertyDescriptor[list.size()]);      } catch (Exception e)      {         e.printStackTrace();         return super.getPropertyDescriptors();      }   }      public BeanInfo[] getAdditionalBeanInfo()   {      try      {         return new BeanInfo[] { Introspector.getBeanInfo(Login.class.getSuperclass()) };      } catch (Exception e)      {         e.printStackTrace();         return super.getAdditionalBeanInfo();      }   }   }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -