org.openide.util.Utilities.getBeanInfo()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.openide.util.Utilities.getBeanInfo()方法的一些代码示例,展示了Utilities.getBeanInfo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.getBeanInfo()方法的具体详情如下:
包路径:org.openide.util.Utilities
类名称:Utilities
方法名:getBeanInfo

Utilities.getBeanInfo介绍

[英]Central method for obtaining BeanInfo for potential JavaBean classes.
[中]获取潜在JavaBean类的BeanInfo的中心方法。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-nodes

beanInfo = Utilities.getBeanInfo(clazz);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-appsrv

public DataSourceBeanDataNode(SunResourceDataObject obj, DataSourceBean key) {
  super(obj);
  resource = key;
  setIconBaseWithExtension("org/netbeans/modules/j2ee/sun/share/resources/ResNodeNodeIcon.gif"); //NOI18N
  setShortDescription (NbBundle.getMessage (DataSourceBeanDataNode.class, "DSC_DataSourceNode"));//NOI18N
  
  key.addPropertyChangeListener(this);
  
  Class clazz = key.getClass ();
  try{
    createProperties(key, Utilities.getBeanInfo(clazz));
  } catch (Exception e){
    e.printStackTrace();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-appsrv

public ConnPoolBeanDataNode(SunResourceDataObject obj, ConnPoolBean key) {
  super(obj);
  setIconBaseWithExtension("org/netbeans/modules/j2ee/sun/share/resources/ResNodeNodeIcon.gif"); //NOI18N
  setShortDescription (NbBundle.getMessage (ConnPoolBeanDataNode.class, "DSC_ConnPoolNode"));//NOI18N
  
  resource = key;
  key.addPropertyChangeListener(this);
  
  Class clazz = key.getClass();
  try{
    createProperties(key, Utilities.getBeanInfo(clazz));
  } catch (Exception e){
    e.printStackTrace();
  }
  
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-appsrv

public PersistenceManagerBeanDataNode(SunResourceDataObject obj, PersistenceManagerBean key) {
  super(obj);
  setIconBaseWithExtension("org/netbeans/modules/j2ee/sun/share/resources/ResNodeNodeIcon.gif"); //NOI18N
  setShortDescription (NbBundle.getMessage (PersistenceManagerBeanDataNode.class, "DSC_PersistenceManagerNode"));//NOI18N
  resource = key;
  
  key.addPropertyChangeListener(this);
  Class clazz = key.getClass ();
  try{
    createProperties(key, Utilities.getBeanInfo(clazz));
  } catch (Exception e){
    e.printStackTrace();
  }
  
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-appsrv

/** Creates a new instance of JMSBeanDataNode */
public JMSBeanDataNode(SunResourceDataObject obj, JMSBean key) {
  super(obj);
  resource = key;
  setIconBaseWithExtension("org/netbeans/modules/j2ee/sun/share/resources/ResNodeNodeIcon.gif"); //NOI18N
  setShortDescription (NbBundle.getMessage (JMSBeanDataNode.class, "DSC_JmsNode"));//NOI18N
  
  key.addPropertyChangeListener(this);
  Class clazz = key.getClass ();
  try{
    createProperties(key, Utilities.getBeanInfo(clazz));
  } catch (Exception e){
    e.printStackTrace();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-appsrv

/** Creates a new instance of JavaMailSessionBeanDataNode */
public JavaMailSessionBeanDataNode(SunResourceDataObject obj, JavaMailSessionBean key) {
  super(obj);
  resource = key;
  setIconBaseWithExtension("org/netbeans/modules/j2ee/sun/share/resources/ResNodeNodeIcon.gif"); //NOI18N
  setShortDescription (NbBundle.getMessage (JavaMailSessionBeanDataNode.class, "DSC_MailNode"));//NOI18N
  key.addPropertyChangeListener(this);
  
  Class clazz = key.getClass ();
  try{
    createProperties(key, Utilities.getBeanInfo(clazz));
  } catch (Exception e){
    e.printStackTrace();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

try {
  BeanInfo info = org.openide.util.Utilities.getBeanInfo (getClass (), SystemOption.class);
  PropertyDescriptor[] desc = info.getPropertyDescriptors ();

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

try {
  BeanInfo info = org.openide.util.Utilities.getBeanInfo (getClass (), SystemOption.class);
  PropertyDescriptor[] desc = info.getPropertyDescriptors ();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

try {
  BeanInfo info = org.openide.util.Utilities.getBeanInfo (getClass (), SystemOption.class);
  PropertyDescriptor[] desc = info.getPropertyDescriptors ();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

try {
  BeanInfo info = org.openide.util.Utilities.getBeanInfo (getClass (), SystemOption.class);
  PropertyDescriptor[] desc = info.getPropertyDescriptors ();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

/** try to register PropertyChangeListener to instance to fire its changes.*/
private void initPList () {
  try {
    InstanceCookie ic = ic();
    if (ic == null) return;
    BeanInfo info = Utilities.getBeanInfo(ic.instanceClass());
    java.beans.EventSetDescriptor[] descs = info.getEventSetDescriptors();
    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
        Object bean = ic.instanceCreate();
        propertyChangeListener = new PropL();
        setter.invoke(bean, new Object[] {org.openide.util.WeakListeners.propertyChange(propertyChangeListener, bean)});
      }
    }
  } catch (Exception ex) {
  } catch (LinkageError ex) {
    // #30650 - catch also LinkageError.
    // Ignoring exception the same way as the Exception handler above.
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

) {
  Class clazzTmp = Class.forName ("javax.swing.JSeparator"); // NOI18N
  bi = Utilities.getBeanInfo (clazzTmp);
} else {
  bi = Utilities.getBeanInfo (clazz);

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

BeanInfo info = org.openide.util.Utilities.getBeanInfo (getClass (), SystemOption.class);
PropertyDescriptor[] desc = info.getPropertyDescriptors ();

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

BeanInfo info = org.openide.util.Utilities.getBeanInfo (getClass (), SystemOption.class);
PropertyDescriptor[] desc = info.getPropertyDescriptors ();

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

if (clazz == null) clazz = Object.class; // in case it was an interface
beanInfo = Utilities.getBeanInfo (clazz);

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

if (clazz == null) clazz = Object.class; // in case it was an interface
beanInfo = Utilities.getBeanInfo (clazz);

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

/** Gets the short description of this feature. */
public String getShortDescription() {
  if (noBeanInfo) return super.getShortDescription();
  
  try {
    InstanceCookie ic = ic();
    if (ic == null) {
      // it must be unrecognized instance
      return getDataObject().getPrimaryFile().toString();
    }
    
    Class clazz = ic.instanceClass();
    java.beans.BeanDescriptor bd = Utilities.getBeanInfo(clazz).getBeanDescriptor();
    String desc = bd.getShortDescription();
    return (desc.equals(bd.getName()))? getDisplayName(): desc;
  } catch (Exception ex) {
    return super.getShortDescription();
  } catch (LinkageError ex) {
    // #30650 - catch also LinkageError.
    return super.getShortDescription();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

if (ic == null) return;
BeanInfo beanInfo = Utilities.getBeanInfo (ic.instanceClass ());
BeanNode.Descriptor descr = BeanNode.computeProperties (ic.instanceCreate (), beanInfo);
initPList();

相关文章