Java Code Examples for java.beans.BeanDescriptor#setShortDescription()

The following examples show how to use java.beans.BeanDescriptor#setShortDescription() . 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: FilterBeanInfo.java    From jivejdon with Apache License 2.0 5 votes vote down vote up
public BeanDescriptor getBeanDescriptor() {
    BeanDescriptor descriptor = new BeanDescriptor(getBeanClass());
    try {
        // Attempt to load the displayName and shortDescription explicitly.
        String displayName = bundle.getString("displayName");
        if (displayName != null) {
            descriptor.setDisplayName(displayName);
        }
        String shortDescription = bundle.getString("shortDescription");
        if (shortDescription != null) {
            descriptor.setShortDescription(shortDescription);
        }
        // Add any other properties that are specified.
        Enumeration em = bundle.getKeys();
        while (em.hasMoreElements()) {
            String key = (String)em.nextElement();
            String value = bundle.getString(key);
            if (value != null) {
                descriptor.setValue(key, value);
            }
        }
    }
    catch (Exception e) {
        // Ignore any exceptions. We may get some if we try to load a
        // a property that doesn't appear in the resource bundle.
    }
    return descriptor;
}
 
Example 2
Source File: MicrosoftEdgeBrowserBeanInfo.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
   public BeanDescriptor getBeanDescriptor() {
       BeanDescriptor descr = new BeanDescriptor(MicrosoftEdgeBrowser.class);
       descr.setDisplayName(NbBundle.getMessage(MicrosoftEdgeBrowserBeanInfo.class, "CTL_MicrosoftEdgeBrowserName")); // NOI18N
       descr.setShortDescription(NbBundle.getMessage(MicrosoftEdgeBrowserBeanInfo.class, "HINT_MicrosoftEdgeBrowserName")); // NOI18N
       descr.setValue ("helpID", "org.netbeans.modules.extbrowser.ExtWebBrowser");  // NOI18N
return descr;
   }
 
Example 3
Source File: TestBeanInfoPriority.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BeanDescriptor getBeanDescriptor() {

    BeanDescriptor bd = new BeanDescriptor(TestClass.class, null);
    bd.setShortDescription("user-defined-description");
    bd.setValue("isContainer", true);
    bd.setValue("containerDelegate", "user-defined-delegate");

    return bd;
}
 
Example 4
Source File: JiveBeanInfo.java    From Openfire with Apache License 2.0 5 votes vote down vote up
@Override
public BeanDescriptor getBeanDescriptor() {
    BeanDescriptor descriptor = new BeanDescriptor(getBeanClass());
    try {
        // Attempt to load the displayName and shortDescription explicitly.
        String displayName = bundle.getString("displayName");
        if (displayName != null) {
            descriptor.setDisplayName(displayName);
        }
        String shortDescription = bundle.getString("shortDescription");
        if (shortDescription != null) {
            descriptor.setShortDescription(shortDescription);
        }
        // Add any other properties that are specified.
        Enumeration enumeration = bundle.getKeys();
        while (enumeration.hasMoreElements()) {
            String key = (String)enumeration.nextElement();
            String value = bundle.getString(key);
            if (value != null) {
                descriptor.setValue(key, value);
            }
        }
    }
    catch (Exception e) {
        // Ignore any exceptions. We may get some if we try to load a
        // a property that doesn't appear in the resource bundle.
    }
    return descriptor;
}
 
Example 5
Source File: OverrideUserDefPropertyInfoTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public BeanDescriptor getBeanDescriptor() {
    BeanDescriptor d = new BeanDescriptor(Base.class, null);
    d.setShortDescription("BASE");
    return d;
}