Java Code Examples for java.beans.PropertyDescriptor#setDisplayName()

The following examples show how to use java.beans.PropertyDescriptor#setDisplayName() . 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: GenSwingBeanInfo.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets properties from the BeanInfo supplement on the
 * introspected PropertyDescriptor
 */
private void setDocInfoProps(DocBeanInfo dbi, PropertyDescriptor pds) {
    int beanflags = dbi.beanflags;

    if ((beanflags & DocBeanInfo.BOUND) != 0)
        pds.setBound(true);
    if ((beanflags & DocBeanInfo.EXPERT) != 0)
        pds.setExpert(true);
    if ((beanflags & DocBeanInfo.CONSTRAINED) != 0)
        pds.setConstrained(true);
    if ((beanflags & DocBeanInfo.HIDDEN) !=0)
        pds.setHidden(true);
    if ((beanflags & DocBeanInfo.PREFERRED) !=0)
        pds.setPreferred(true);

    if (!(dbi.desc.equals("null"))){
        pds.setShortDescription(dbi.desc);
    }
    if (!(dbi.displayname.equals("null"))){
        pds.setDisplayName(dbi.displayname);
    }
}
 
Example 2
Source File: GenSwingBeanInfo.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets properties from the BeanInfo supplement on the
 * introspected PropertyDescriptor
 */
private void setDocInfoProps(DocBeanInfo dbi, PropertyDescriptor pds) {
    int beanflags = dbi.beanflags;

    if ((beanflags & DocBeanInfo.BOUND) != 0)
        pds.setBound(true);
    if ((beanflags & DocBeanInfo.EXPERT) != 0)
        pds.setExpert(true);
    if ((beanflags & DocBeanInfo.CONSTRAINED) != 0)
        pds.setConstrained(true);
    if ((beanflags & DocBeanInfo.HIDDEN) !=0)
        pds.setHidden(true);
    if ((beanflags & DocBeanInfo.PREFERRED) !=0)
        pds.setPreferred(true);

    if (!(dbi.desc.equals("null"))){
        pds.setShortDescription(dbi.desc);
    }
    if (!(dbi.displayname.equals("null"))){
        pds.setDisplayName(dbi.displayname);
    }
}
 
Example 3
Source File: GenSwingBeanInfo.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets properties from the BeanInfo supplement on the
 * introspected PropertyDescriptor
 */
private void setDocInfoProps(DocBeanInfo dbi, PropertyDescriptor pds) {
    int beanflags = dbi.beanflags;

    if ((beanflags & DocBeanInfo.BOUND) != 0)
        pds.setBound(true);
    if ((beanflags & DocBeanInfo.EXPERT) != 0)
        pds.setExpert(true);
    if ((beanflags & DocBeanInfo.CONSTRAINED) != 0)
        pds.setConstrained(true);
    if ((beanflags & DocBeanInfo.HIDDEN) !=0)
        pds.setHidden(true);
    if ((beanflags & DocBeanInfo.PREFERRED) !=0)
        pds.setPreferred(true);

    if (!(dbi.desc.equals("null"))){
        pds.setShortDescription(dbi.desc);
    }
    if (!(dbi.displayname.equals("null"))){
        pds.setDisplayName(dbi.displayname);
    }
}
 
Example 4
Source File: GenSwingBeanInfo.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets properties from the BeanInfo supplement on the
 * introspected PropertyDescriptor
 */
private void setDocInfoProps(DocBeanInfo dbi, PropertyDescriptor pds) {
    int beanflags = dbi.beanflags;

    if ((beanflags & DocBeanInfo.BOUND) != 0)
        pds.setBound(true);
    if ((beanflags & DocBeanInfo.EXPERT) != 0)
        pds.setExpert(true);
    if ((beanflags & DocBeanInfo.CONSTRAINED) != 0)
        pds.setConstrained(true);
    if ((beanflags & DocBeanInfo.HIDDEN) !=0)
        pds.setHidden(true);
    if ((beanflags & DocBeanInfo.PREFERRED) !=0)
        pds.setPreferred(true);

    if (!(dbi.desc.equals("null"))){
        pds.setShortDescription(dbi.desc);
    }
    if (!(dbi.displayname.equals("null"))){
        pds.setDisplayName(dbi.displayname);
    }
}
 
Example 5
Source File: GenSwingBeanInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets properties from the BeanInfo supplement on the
 * introspected PropertyDescriptor
 */
private void setDocInfoProps(DocBeanInfo dbi, PropertyDescriptor pds) {
    int beanflags = dbi.beanflags;

    if ((beanflags & DocBeanInfo.BOUND) != 0)
        pds.setBound(true);
    if ((beanflags & DocBeanInfo.EXPERT) != 0)
        pds.setExpert(true);
    if ((beanflags & DocBeanInfo.CONSTRAINED) != 0)
        pds.setConstrained(true);
    if ((beanflags & DocBeanInfo.HIDDEN) !=0)
        pds.setHidden(true);
    if ((beanflags & DocBeanInfo.PREFERRED) !=0)
        pds.setPreferred(true);

    if (!(dbi.desc.equals("null"))){
        pds.setShortDescription(dbi.desc);
    }
    if (!(dbi.displayname.equals("null"))){
        pds.setDisplayName(dbi.displayname);
    }
}
 
Example 6
Source File: JiveBeanInfo.java    From Openfire with Apache License 2.0 6 votes vote down vote up
@Override
public PropertyDescriptor[] getPropertyDescriptors() {
    Class beanClass = getBeanClass();
    String[] properties = getPropertyNames();

    PropertyDescriptor[] descriptors = new PropertyDescriptor[properties.length];
    try {
        // For each property, create a property descriptor and set the
        // name and description using the localized data.
        for (int i = 0; i < descriptors.length; i++) {
            PropertyDescriptor newDescriptor =
                    new PropertyDescriptor(properties[i], beanClass);
            if (bundle != null) {
                newDescriptor.setDisplayName(bundle.getString(properties[i] + ".displayName"));
                newDescriptor.setShortDescription(bundle.getString(properties[i] + ".shortDescription"));
            }
            descriptors[i] = newDescriptor;
        }
        return descriptors;
    }
    catch (IntrospectionException ie) {
        Log.error(ie.getMessage(), ie);
        throw new Error(ie.toString());
    }
}
 
Example 7
Source File: PropertiesDataLoaderBeanInfo.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * @return Returns an array of PropertyDescriptors
 * describing the editable properties supported by this bean. */
public PropertyDescriptor[] getPropertyDescriptors () {
    try {

        PropertyDescriptor p2 = new PropertyDescriptor(
            "extensions", // NOI18N
            PropertiesDataLoader.class,
            "getExtensions", // NOI18N
            "setExtensions"); // NOI18N

        p2.setDisplayName(NbBundle.getBundle(PropertiesDataLoaderBeanInfo.class).getString("PROP_Ext"));
        p2.setShortDescription(NbBundle.getBundle(PropertiesDataLoaderBeanInfo.class).getString("HINT_Ext"));

        return new PropertyDescriptor[] {p2};
    } catch(IntrospectionException ie) {
        ErrorManager.getDefault().notify(ie);
        
        return null;
    }
}
 
Example 8
Source File: GenSwingBeanInfo.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets properties from the BeanInfo supplement on the
 * introspected PropertyDescriptor
 */
private void setDocInfoProps(DocBeanInfo dbi, PropertyDescriptor pds) {
    int beanflags = dbi.beanflags;

    if ((beanflags & DocBeanInfo.BOUND) != 0)
        pds.setBound(true);
    if ((beanflags & DocBeanInfo.EXPERT) != 0)
        pds.setExpert(true);
    if ((beanflags & DocBeanInfo.CONSTRAINED) != 0)
        pds.setConstrained(true);
    if ((beanflags & DocBeanInfo.HIDDEN) !=0)
        pds.setHidden(true);
    if ((beanflags & DocBeanInfo.PREFERRED) !=0)
        pds.setPreferred(true);

    if (!(dbi.desc.equals("null"))){
        pds.setShortDescription(dbi.desc);
    }
    if (!(dbi.displayname.equals("null"))){
        pds.setDisplayName(dbi.displayname);
    }
}
 
Example 9
Source File: GenSwingBeanInfo.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets properties from the BeanInfo supplement on the
 * introspected PropertyDescriptor
 */
private void setDocInfoProps(DocBeanInfo dbi, PropertyDescriptor pds) {
    int beanflags = dbi.beanflags;

    if ((beanflags & DocBeanInfo.BOUND) != 0)
        pds.setBound(true);
    if ((beanflags & DocBeanInfo.EXPERT) != 0)
        pds.setExpert(true);
    if ((beanflags & DocBeanInfo.CONSTRAINED) != 0)
        pds.setConstrained(true);
    if ((beanflags & DocBeanInfo.HIDDEN) !=0)
        pds.setHidden(true);
    if ((beanflags & DocBeanInfo.PREFERRED) !=0)
        pds.setPreferred(true);

    if (!(dbi.desc.equals("null"))){
        pds.setShortDescription(dbi.desc);
    }
    if (!(dbi.displayname.equals("null"))){
        pds.setDisplayName(dbi.displayname);
    }
}
 
Example 10
Source File: PropertyDescriptorUtils.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * See {@link java.beans.FeatureDescriptor}.
 */
public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target) {
	target.setExpert(source.isExpert());
	target.setHidden(source.isHidden());
	target.setPreferred(source.isPreferred());
	target.setName(source.getName());
	target.setShortDescription(source.getShortDescription());
	target.setDisplayName(source.getDisplayName());

	// Copy all attributes (emulating behavior of private FeatureDescriptor#addTable)
	Enumeration<String> keys = source.attributeNames();
	while (keys.hasMoreElements()) {
		String key = keys.nextElement();
		target.setValue(key, source.getValue(key));
	}

	// See java.beans.PropertyDescriptor#PropertyDescriptor(PropertyDescriptor)
	target.setPropertyEditorClass(source.getPropertyEditorClass());
	target.setBound(source.isBound());
	target.setConstrained(source.isConstrained());
}
 
Example 11
Source File: GenSwingBeanInfo.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Sets properties from the BeanInfo supplement on the
 * introspected PropertyDescriptor
 */
private void setDocInfoProps(DocBeanInfo dbi, PropertyDescriptor pds) {
    int beanflags = dbi.beanflags;

    if ((beanflags & DocBeanInfo.BOUND) != 0)
        pds.setBound(true);
    if ((beanflags & DocBeanInfo.EXPERT) != 0)
        pds.setExpert(true);
    if ((beanflags & DocBeanInfo.CONSTRAINED) != 0)
        pds.setConstrained(true);
    if ((beanflags & DocBeanInfo.HIDDEN) !=0)
        pds.setHidden(true);
    if ((beanflags & DocBeanInfo.PREFERRED) !=0)
        pds.setPreferred(true);

    if (!(dbi.desc.equals("null"))){
        pds.setShortDescription(dbi.desc);
    }
    if (!(dbi.displayname.equals("null"))){
        pds.setDisplayName(dbi.displayname);
    }
}
 
Example 12
Source File: PropertyDescriptorUtils.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * See {@link java.beans.FeatureDescriptor}.
 */
public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target) {
	target.setExpert(source.isExpert());
	target.setHidden(source.isHidden());
	target.setPreferred(source.isPreferred());
	target.setName(source.getName());
	target.setShortDescription(source.getShortDescription());
	target.setDisplayName(source.getDisplayName());

	// Copy all attributes (emulating behavior of private FeatureDescriptor#addTable)
	Enumeration<String> keys = source.attributeNames();
	while (keys.hasMoreElements()) {
		String key = keys.nextElement();
		target.setValue(key, source.getValue(key));
	}

	// See java.beans.PropertyDescriptor#PropertyDescriptor(PropertyDescriptor)
	target.setPropertyEditorClass(source.getPropertyEditorClass());
	target.setBound(source.isBound());
	target.setConstrained(source.isConstrained());
}
 
Example 13
Source File: Test6660539.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    for (PropertyDescriptor pd : getPropertyDescriptors()) {
        pd.setDisplayName(NAME);
    }
    ThreadGroup group = new ThreadGroup(NAME);
    Thread thread = new Thread(group, new Test6660539());
    thread.start();
    thread.join();
}
 
Example 14
Source File: Test6660539.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    for (PropertyDescriptor pd : getPropertyDescriptors()) {
        pd.setDisplayName(NAME);
    }
    ThreadGroup group = new ThreadGroup(NAME);
    Thread thread = new Thread(group, new Test6660539());
    thread.start();
    thread.join();
}
 
Example 15
Source File: FilterBeanInfo.java    From jivejdon with Apache License 2.0 5 votes vote down vote up
public PropertyDescriptor[] getPropertyDescriptors()  {
    Class beanClass = getBeanClass();
    String [] properties = getPropertyNames();

    PropertyDescriptor [] descriptors = new PropertyDescriptor[properties.length];
    try {
        // For each property, create a property descriptor and set the
        // name and description using the localized data.
        for (int i=0; i<descriptors.length; i++) {
            PropertyDescriptor newDescriptor =
                new PropertyDescriptor(properties[i], beanClass);
            if (bundle != null) {
                newDescriptor.setDisplayName(
                    bundle.getString(properties[i] + ".displayName")
                );
                newDescriptor.setShortDescription(
                    bundle.getString(properties[i] + ".shortDescription")
                );
            }
            descriptors[i] = newDescriptor;
        }
        return descriptors;
    }
    catch (IntrospectionException ie) {
        ie.printStackTrace();
        throw new Error(ie.toString());
    }
}
 
Example 16
Source File: Test6660539.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    for (PropertyDescriptor pd : getPropertyDescriptors()) {
        pd.setDisplayName(NAME);
    }
    ThreadGroup group = new ThreadGroup(NAME);
    Thread thread = new Thread(group, new Test6660539());
    thread.start();
    thread.join();
}
 
Example 17
Source File: Test6660539.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    for (PropertyDescriptor pd : getPropertyDescriptors()) {
        pd.setDisplayName(NAME);
    }
    ThreadGroup group = new ThreadGroup(NAME);
    Thread thread = new Thread(group, new Test6660539());
    thread.start();
    thread.join();
}
 
Example 18
Source File: Test6660539.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    for (PropertyDescriptor pd : getPropertyDescriptors()) {
        pd.setDisplayName(NAME);
    }
    ThreadGroup group = new ThreadGroup(NAME);
    Thread thread = new Thread(group, new Test6660539());
    thread.start();
    thread.join();
}
 
Example 19
Source File: Test6660539.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    for (PropertyDescriptor pd : getPropertyDescriptors()) {
        pd.setDisplayName(NAME);
    }
    ThreadGroup group = new ThreadGroup(NAME);
    Thread thread = new Thread(group, new Test6660539());
    thread.start();
    thread.join();
}
 
Example 20
Source File: Test6660539.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    for (PropertyDescriptor pd : getPropertyDescriptors()) {
        pd.setDisplayName(NAME);
    }
    ThreadGroup group = new ThreadGroup(NAME);
    Thread thread = new Thread(group, new Test6660539());
    thread.start();
    thread.join();
}