Java Code Examples for org.openide.nodes.BeanNode#Descriptor

The following examples show how to use org.openide.nodes.BeanNode#Descriptor . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SerialDataNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** try to register PropertyChangeListener to instance to fire its changes.
 * @param bean     */
private void initPList (Object bean, BeanInfo bInfo, BeanNode.Descriptor descr) {
    EventSetDescriptor[] descs  = bInfo.getEventSetDescriptors();
    try {
        Method setter = null;
        for (int i = 0; descs != null && i < descs.length; i++) {
            setter = descs[i].getAddListenerMethod();
            if (setter != null && setter.getName().equals("addPropertyChangeListener")) { // NOI18N                    
                propertyChangeListener = new PropL(createSupportedPropertyNames(descr));
                setter.invoke(bean, new Object[] {WeakListeners.propertyChange(propertyChangeListener, bean)});
                setSettingsInstance(bean);
            }
        }
    } catch (Exception ex) {
        // ignore
    }
}
 
Example 2
Source File: SerialDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Sheet.Set createExpertSet(BeanNode.Descriptor descr, BeanDescriptor bd) {
    Sheet.Set p = Sheet.createExpertSet();
    convertProps (p, descr.expert, this);
    if (bd != null) {
        Object helpID = bd.getValue("expertHelpID"); // NOI18N
        if (helpID != null && helpID instanceof String) {
            p.setValue("helpID", helpID); // NOI18N
        }
    }
    return p;
}
 
Example 3
Source File: SerialDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Sheet.Set createPropertiesSet(BeanNode.Descriptor descr, BeanDescriptor bd) {
    Sheet.Set props;
    props = Sheet.createPropertiesSet();
    if (descr.property != null) {
        convertProps (props, descr.property, this);
    }
    if (bd != null) {
        // #29550: help from the beaninfo on property tabs
        Object helpID = bd.getValue("propertiesHelpID"); // NOI18N
        if (helpID != null && helpID instanceof String) {
            props.setValue("helpID", helpID); // NOI18N
        }
    }
    return props;
}
 
Example 4
Source File: PersistenceManagerBeanDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected void createProperties(Object bean, java.beans.BeanInfo info) {
        BeanNode.Descriptor d = BeanNode.computeProperties(bean, info);
        Node.Property p = new PropertySupport.ReadWrite(
        "extraParams", PersistenceManagerBeanDataNode.class,  //NOI18N
        NbBundle.getMessage(PersistenceManagerBeanDataNode.class,"LBL_ExtParams"), //NOI18N
        NbBundle.getMessage(PersistenceManagerBeanDataNode.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_PMF_Props"); //NOI18N
        sets.put(pset);
    }
 
Example 5
Source File: DataSourceBeanDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 6
Source File: JMSBeanDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
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);
    }
 
Example 7
Source File: JavaMailSessionBeanDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
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);
    }
 
Example 8
Source File: ConnPoolBeanDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected void createProperties(Object bean, java.beans.BeanInfo info) {
        BeanNode.Descriptor d = BeanNode.computeProperties(bean, info);
        Node.Property p = new PropertySupport.ReadWrite(
        "extraParams", ConnPoolBeanDataNode.class, //NOI18N
        NbBundle.getMessage(ConnPoolBeanDataNode.class,"LBL_ExtParams"), //NOI18N
        NbBundle.getMessage(ConnPoolBeanDataNode.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_ConnectionPool_Props"); //NOI18N
        sets.put(pset);
     }