下面列出了java.beans.BeanDescriptor#setShortDescription ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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;
}
@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;
}
@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;
}
@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;
}
@Override
public BeanDescriptor getBeanDescriptor() {
BeanDescriptor d = new BeanDescriptor(Base.class, null);
d.setShortDescription("BASE");
return d;
}