/** @return bean node */ public Node createNode(Object bean) throws IntrospectionException { return new BeanNode(bean); } }
setIconBaseWithExtension(ICON_BASE); setSynchronizeName(true); while (!Modifier.isPublic(clazz.getModifiers()) && !hasExplicitBeanInfo(clazz)) { clazz = clazz.getSuperclass(); registerName(); setNameSilently(getNameForBean()); setShortDescription(sd); createProperties(bean, beanInfo); setValue(aname, beanInfo.getBeanDescriptor().getValue(aname)); getCookieSet().add(instanceCookie);
public void propertyChange(PropertyChangeEvent e) { firePropertyChange(e.getPropertyName(), e.getOldValue(), e.getNewValue()); } }
super((children == null) ? getChildren(bean) : children, lkp); initialization(lkp != null); } catch (IntrospectionException ie) { throw ie; } catch (RuntimeException re) { throw mkie(re); } catch (LinkageError le) { throw mkie(le);
setIconBase (ICON_BASE); setDefaultAction (arr[0]); setSynchronizeName (true); while (! Modifier.isPublic (clazz.getModifiers ()) && !hasExplicitBeanInfo (clazz)) { clazz = clazz.getSuperclass (); if (clazz == null) clazz = Object.class; // in case it was an interface registerName (); setNameSilently (getNameForBean ()); BeanDescriptor descriptor = beanInfo.getBeanDescriptor (); String sd = descriptor.getShortDescription (); if (! Utilities.compareObjects (sd, descriptor.getDisplayName ())) setShortDescription (sd); createProperties (bean, beanInfo); setValue(aname, beanInfo.getBeanDescriptor().getValue(aname)); getCookieSet ().add (instanceCookie);
/** Prepare node properties based on the bean, storing them into the current property sheet. * Called when the bean info is ready. * This implementation always creates a set for standard properties * and may create a set for expert ones if there are any. * @see #computeProperties * @param bean bean to compute properties for * @param info information about the bean */ protected void createProperties(T bean, BeanInfo info) { Descriptor d = computeProperties(bean, info); Sheet sets = getSheet(); Sheet.Set pset = Sheet.createPropertiesSet(); pset.put(d.property); BeanDescriptor bd = info.getBeanDescriptor(); if ((bd != null) && (bd.getValue("propertiesHelpID") != null)) { // NOI18N pset.setValue("helpID", bd.getValue("propertiesHelpID")); // NOI18N } sets.put(pset); if (d.expert.length != 0) { Sheet.Set eset = Sheet.createExpertSet(); eset.put(d.expert); if ((bd != null) && (bd.getValue("expertHelpID") != null)) { // NOI18N eset.setValue("helpID", bd.getValue("expertHelpID")); // NOI18N } sets.put(eset); } }
protected void createProperties(Object bean, java.beans.BeanInfo info) { BeanNode.Descriptor d = BeanNode.computeProperties(bean, info); Node.Property p = new PropertySupport.ReadWrite( "extraParams", JavaMailSessionBeanDataNode.class, //NOI18N NbBundle.getMessage(JavaMailSessionBeanDataNode.class,"LBL_ExtParams"), //NOI18N NbBundle.getMessage(JavaMailSessionBeanDataNode.class,"DSC_ExtParams") //NOI18N ) { public Object getValue() { return resource.getExtraParams(); } public void setValue(Object val){ if (val instanceof Object[]) resource.setExtraParams((Object[])val); } public PropertyEditor getPropertyEditor(){ return new NameValuePairsPropertyEditor(resource.getExtraParams()); } }; Sheet sets = getSheet(); Sheet.Set pset = Sheet.createPropertiesSet(); pset.put(d.property); pset.put(p); // pset.setValue("helpID", "AS_Res_Mail_Props"); //NOI18N sets.put(pset); }
public void propertyChange(PropertyChangeEvent e) { String name = e.getPropertyName (); if (name == null) { firePropertyChange (null, e.getOldValue (), e.getNewValue ()); } else { PropertyDescriptor[] arr = beanInfo.getPropertyDescriptors (); for (int i = 0; i < arr.length; i++) { if (arr[i].isHidden ()) continue; if (name.equals (arr[i].getName ())) { firePropertyChange (e.getPropertyName (), e.getOldValue (), e.getNewValue ()); break; } } } if (synchronizeName) { if (name == null || name.equals ("name") || name.equals ("displayName")) { // NOI18N String newName = getNameForBean (); if (!newName.equals (getName ())) { setNameSilently (newName); } } } } }
/** Get an icon for this node in the open state. * * @param type type constants * @return icon to use. The default implementation just uses {@link #getIcon}. */ @Override public Image getOpenedIcon(int type) { return getIcon(type); }
/** * Constructs a node for a JavaBean. If the bean is a {@link BeanContext}, * creates a child list as well. * * @param bean the bean this node will be based on * @throws IntrospectionException if the bean cannot be analyzed */ public BeanNode (Object bean) throws IntrospectionException { this ( bean, getChildren (bean) ); }
setIconBase (ICON_BASE); setDefaultAction (arr[0]); setSynchronizeName (true); while (! Modifier.isPublic (clazz.getModifiers ()) && !hasExplicitBeanInfo (clazz)) { clazz = clazz.getSuperclass (); if (clazz == null) clazz = Object.class; // in case it was an interface registerName (); setNameSilently (getNameForBean ()); BeanDescriptor descriptor = beanInfo.getBeanDescriptor (); String sd = descriptor.getShortDescription (); if (! Utilities.compareObjects (sd, descriptor.getDisplayName ())) setShortDescription (sd); createProperties (bean, beanInfo); setValue(aname, beanInfo.getBeanDescriptor().getValue(aname)); getCookieSet ().add (instanceCookie);
/** Constructs a node for a JavaBean with a defined child list. * Intended for use by subclasses with different strategies for computing the children. * @param bean the bean this node will be based on * @param children children for the node (default if null) * @throws IntrospectionException if the bean cannot be analyzed */ protected BeanNode (Object bean, Children children) throws IntrospectionException { super (children == null ? getChildren(bean) : children); if (bean == null) throw new NullPointerException("cannot make a node for a null bean"); // NOI18N this.bean = bean; try { initialization (); } catch (IntrospectionException ie) { throw ie; } catch (RuntimeException re) { throw mkie(re); } catch (LinkageError le) { throw mkie(le); } } private static IntrospectionException mkie(Throwable t) {
/** Prepare node properties based on the bean, storing them into the current property sheet. * Called when the bean info is ready. * This implementation always creates a set for standard properties * and may create a set for expert ones if there are any. * @see #computeProperties * @param bean bean to compute properties for * @param info information about the bean */ protected void createProperties (Object bean, BeanInfo info) { Descriptor d = computeProperties (bean, beanInfo); Sheet sets = getSheet (); Sheet.Set pset = Sheet.createPropertiesSet (); pset.put (d.property); BeanDescriptor bd = info.getBeanDescriptor(); if ( bd != null && bd.getValue( "propertiesHelpID" ) != null ) { // NOI18N pset.setValue( "helpID", bd.getValue( "propertiesHelpID" ) ); // NOI18N } sets.put (pset); if (d.expert.length != 0) { Sheet.Set eset = Sheet.createExpertSet (); eset.put (d.expert); if ( bd != null && bd.getValue( "expertHelpID" ) != null ) { // NOI18N eset.setValue( "helpID", bd.getValue( "expertHelpID" ) ); // NOI18N } sets.put (eset); } }
protected void createProperties(Object bean, java.beans.BeanInfo info) { BeanNode.Descriptor d = BeanNode.computeProperties(bean, info); Node.Property p = new PropertySupport.ReadWrite( "extraParams", JMSBeanDataNode.class, //NOI18N NbBundle.getMessage(JMSBeanDataNode.class,"LBL_ExtParams"), //NOI18N NbBundle.getMessage(JMSBeanDataNode.class,"DSC_ExtParams") //NOI18N ) { public Object getValue() { return resource.getExtraParams(); } public void setValue(Object val){ if (val instanceof Object[]) resource.setExtraParams((Object[])val); } public PropertyEditor getPropertyEditor(){ return new NameValuePairsPropertyEditor(resource.getExtraParams()); } }; Sheet sets = getSheet(); Sheet.Set pset = Sheet.createPropertiesSet(); pset.put(d.property); pset.put(p); // pset.setValue("helpID", "AS_Res_JMS_Props"); //NOI18N sets.put(pset); }
public void propertyChange(PropertyChangeEvent e) { String name = e.getPropertyName (); if (name == null) { firePropertyChange (null, e.getOldValue (), e.getNewValue ()); } else { PropertyDescriptor[] arr = beanInfo.getPropertyDescriptors (); for (int i = 0; i < arr.length; i++) { if (arr[i].isHidden ()) continue; if (name.equals (arr[i].getName ())) { firePropertyChange (e.getPropertyName (), e.getOldValue (), e.getNewValue ()); break; } } } if (synchronizeName) { if (name == null || name.equals ("name") || name.equals ("displayName")) { // NOI18N String newName = getNameForBean (); if (!newName.equals (getName ())) { setNameSilently (newName); } } } } }
/** Get an icon for this node in the open state. * * @param type type constants * @return icon to use. The default implementation just uses {@link #getIcon}. */ public Image getOpenedIcon (int type) { return getIcon(type); }
/** * Constructs a node for a JavaBean. If the bean is a {@link BeanContext}, * creates a child list as well. * * @param bean the bean this node will be based on * @throws IntrospectionException if the bean cannot be analyzed */ public BeanNode (Object bean) throws IntrospectionException { this ( bean, getChildren (bean) ); }
/** Constructs a node for a JavaBean with a defined child list. * Intended for use by subclasses with different strategies for computing the children. * @param bean the bean this node will be based on * @param children children for the node (default if null) * @throws IntrospectionException if the bean cannot be analyzed */ protected BeanNode (Object bean, Children children) throws IntrospectionException { super (children == null ? getChildren(bean) : children); if (bean == null) throw new NullPointerException("cannot make a node for a null bean"); // NOI18N this.bean = bean; try { initialization (); } catch (IntrospectionException ie) { throw ie; } catch (RuntimeException re) { throw mkie(re); } catch (LinkageError le) { throw mkie(le); } } private static IntrospectionException mkie(Throwable t) {
/** Prepare node properties based on the bean, storing them into the current property sheet. * Called when the bean info is ready. * This implementation always creates a set for standard properties * and may create a set for expert ones if there are any. * @see #computeProperties * @param bean bean to compute properties for * @param info information about the bean */ protected void createProperties (Object bean, BeanInfo info) { Descriptor d = computeProperties (bean, beanInfo); Sheet sets = getSheet (); Sheet.Set pset = Sheet.createPropertiesSet (); pset.put (d.property); BeanDescriptor bd = info.getBeanDescriptor(); if ( bd != null && bd.getValue( "propertiesHelpID" ) != null ) { // NOI18N pset.setValue( "helpID", bd.getValue( "propertiesHelpID" ) ); // NOI18N } sets.put (pset); if (d.expert.length != 0) { Sheet.Set eset = Sheet.createExpertSet (); eset.put (d.expert); if ( bd != null && bd.getValue( "expertHelpID" ) != null ) { // NOI18N eset.setValue( "helpID", bd.getValue( "expertHelpID" ) ); // NOI18N } sets.put (eset); } }
protected void createProperties(Object bean, java.beans.BeanInfo info) { BeanNode.Descriptor d = BeanNode.computeProperties(bean, info); Node.Property p = new PropertySupport.ReadWrite( "extraParams", DataSourceBeanDataNode.class, //NOI18N NbBundle.getMessage(DataSourceBeanDataNode.class,"LBL_ExtParams"), //NOI18N NbBundle.getMessage(DataSourceBeanDataNode.class,"DSC_ExtParams") //NOI18N ) { public Object getValue() { return resource.getExtraParams(); } public void setValue(Object val){ if (val instanceof Object[]) resource.setExtraParams((Object[])val); } public PropertyEditor getPropertyEditor(){ return new NameValuePairsPropertyEditor(resource.getExtraParams()); } }; Sheet sets = getSheet(); Sheet.Set pset = Sheet.createPropertiesSet(); pset.put(d.property); pset.put(p); //pset.setValue("propertiesHelpID", "AS_Res_DataSource_Props"); //NOI18N sets.put(pset); }