Examples of BeanInfo


Examples of java.beans.BeanInfo

            }
        }

        for (int i = 0; i < ji.getCount(); i++) {
            String beanName = ji.getName(i);
            BeanInfo bi = ji.getBeanInfo(i);
            Class bc = ji.getBeanClass(i);
            if (bi == null || bc == null) {
                // We couldn't load the bean.
                continue;
            }
View Full Code Here

Examples of java.beans.BeanInfo

     * Utility method to obtain the BeanInfo object associated with a
     * bean class that the BeanBox knows about. Returns a null if none
     * found.
     */
    public BeanInfo getBeanInfoForBean(String beanClassName) {
        BeanInfo beanInfo = (BeanInfo) beanInfoMap.get(beanClassName);
        if (beanInfo == null) {
            beanInfo = BeanPanel.findBeanInfo(beanClassName);
            if (beanInfo != null)
                beanInfoMap.put(beanClassName, beanInfo);
        }
View Full Code Here

Examples of java.beans.BeanInfo

                || !(object.get(2) instanceof Point)) {
            throw new IllegalArgumentException("bad drop object " + object);
        }

        Object bean = object.get(0);
        BeanInfo beanInfo = (BeanInfo) object.get(1);
        Point point = (Point) object.get(2);

        beanInfoMap.put(bean.getClass().getName(), beanInfo);

        prepareForAddition(bean, beanInfo, point);
View Full Code Here

Examples of java.beans.BeanInfo

     * returns the image contained in the BeanInfo for the bean, or
     * the default BeanPanel image if no image is found in the
     * BeanInfo.
     */
    protected Image getDragImage(Object bean) {
        BeanInfo beanInfo = this.getBeanInfoForBean(bean.getClass().getName());

        if (beanInfo == null) {
            if (Debug.debugging("beanbox"))
                Debug.output("No beanInfo found for bean: " + bean);
            return BeanPanel.defaultBeanIcon.getImage();
        }

        Image img = beanInfo.getIcon(BeanInfo.ICON_COLOR_32x32);

        if (img == null) {
            if (Debug.debugging("beanbox"))
                Debug.output("No image found in beanInfo for bean: " + bean);
            return BeanPanel.defaultBeanIcon.getImage();
View Full Code Here

Examples of java.beans.BeanInfo

    throws StoreException
  {
    ClassLoader cl = HTTPRepositoryMetaData.class.getClassLoader();
    Class<?>[] interfaces = new Class<?>[] { RepositoryMetaData.class };
    try {
      BeanInfo info = Introspector.getBeanInfo(RepositoryMetaData.class);
      PropertyDescriptor[] properties = info.getPropertyDescriptors();
      HTTPRepositoryMetaData h = new HTTPRepositoryMetaData(repository, model, properties);
      return (RepositoryMetaData)Proxy.newProxyInstance(cl, interfaces, h);
    }
    catch (IntrospectionException e) {
      throw new StoreException(e);
View Full Code Here

Examples of java.beans.BeanInfo

         installFor(e.getClass());
   }

   public static void installFor(Class<? extends Enum> enumClass) {
     try {
       BeanInfo info = Introspector.getBeanInfo( enumClass );
       info.getBeanDescriptor().setValue( "persistenceDelegate", INSTANCE );
     } catch( IntrospectionException exception ) {
       throw new RuntimeException("Unable to persist enumerated type "+enumClass, exception);
     }
   }
View Full Code Here

Examples of java.beans.BeanInfo

    return (JavaProperty[])result.toArray(new JavaProperty[0]);
  }
 
  public JavaProperty[] getProperties() throws Exception {
    List<JavaProperty> result = new ArrayList<JavaProperty>();
    BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
    PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
    for(PropertyDescriptor pd : pds) {
        if(!"class".equalsIgnoreCase(pd.getName())) {
            result.add(new JavaProperty(pd,this));
        }
    }
View Full Code Here

Examples of java.beans.BeanInfo

    final Vector<Object> columnData = new Vector<Object>();
    if (_bean != null)
    {
      try
      {
        BeanInfo info = Introspector.getBeanInfo(_bean.getClass(), Introspector.USE_ALL_BEANINFO);
        processBeanInfo(info, columnData);
      }
      catch (Exception ex)
      {
        throw new BaseException(ex);
View Full Code Here

Examples of java.beans.BeanInfo

      else
      {
        beanClass = Class.forName(beanClassName, true, _cl);
      }
      Object bean = beanClass.newInstance();
      BeanInfo info =
        Introspector.getBeanInfo(
          bean.getClass(),
          Introspector.USE_ALL_BEANINFO);
      PropertyDescriptor[] propDesc = info.getPropertyDescriptors();
      Map<String, PropertyDescriptor> props =
                new HashMap<String, PropertyDescriptor>();
      for (int i = 0; i < propDesc.length; ++i)
      {
        props.put(propDesc[i].getName(), propDesc[i]);
View Full Code Here

Examples of java.beans.BeanInfo

  private IXMLElement createElement(Object bean, String name)
    throws XMLException
  {
    IXMLElement elem = null;
    BeanInfo info = null;
    try
    {
      if (bean != null)
      {
        info = Introspector.getBeanInfo(bean.getClass(), Object.class);
      }
    }
    catch (IntrospectionException ex)
    {
      throw new XMLException(ex);
    }
    elem = new XMLElement(name != null ? name : XMLConstants.BEAN_ELEMENT_NAME);
    if (info != null)
    {
      if (bean instanceof IXMLAboutToBeWritten)
      {
        ((IXMLAboutToBeWritten) bean).aboutToBeWritten();
      }
      PropertyDescriptor[] propDesc = info.getPropertyDescriptors();
      elem = new XMLElement(name != null ? name : XMLConstants.BEAN_ELEMENT_NAME);
      elem.setAttribute(XMLConstants.CLASS_ATTRIBUTE_NAME,
                      bean.getClass().getName());
      for (int i = 0; i < propDesc.length; ++i)
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.