当前位置: 首页>>代码示例>>Java>>正文


Java BeanDescriptor.getValue方法代码示例

本文整理汇总了Java中java.beans.BeanDescriptor.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java BeanDescriptor.getValue方法的具体用法?Java BeanDescriptor.getValue怎么用?Java BeanDescriptor.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.beans.BeanDescriptor的用法示例。


在下文中一共展示了BeanDescriptor.getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findHelp

import java.beans.BeanDescriptor; //导入方法依赖的package包/类
/** Finds help context for a generic object. Right now checks
 * for HelpCtx.Provider and handles java.awt.Component in a
 * special way compatible with JavaHelp.
 * Also {@link BeanDescriptor}'s are checked for a string-valued attribute
 * <code>helpID</code>, as per the JavaHelp specification (but no help sets
 * will be loaded).
 *
 * @param instance to search help for
 * @return the help for the object or <code>HelpCtx.DEFAULT_HELP</code> if HelpCtx cannot be found
 *
 * @since 4.3
 */
public static HelpCtx findHelp(Object instance) {
    if (instance instanceof java.awt.Component) {
        return findHelp((java.awt.Component) instance);
    }

    if (instance instanceof HelpCtx.Provider) {
        return ((HelpCtx.Provider) instance).getHelpCtx();
    }

    try {
        BeanDescriptor d = Introspector.getBeanInfo(instance.getClass()).getBeanDescriptor();
        String v = (String) d.getValue("helpID"); // NOI18N

        if (v != null) {
            return new HelpCtx(v);
        }
    } catch (IntrospectionException e) {
        err.log(Level.FINE, "findHelp on {0}: {1}", new Object[]{instance, e});
    }

    return HelpCtx.DEFAULT_HELP;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:HelpCtx.java

示例2: createProperties

import java.beans.BeanDescriptor; //导入方法依赖的package包/类
/** Prepare node properties based on the bean, storing them into the current property sheet.
* Called when the bean info is ready.
* This implementation always creates a set for standard properties
* and may create a set for expert ones if there are any.
* @see #computeProperties
* @param bean bean to compute properties for
* @param info information about the bean
*/
protected void createProperties(T bean, BeanInfo info) {
    Descriptor d = computeProperties(bean, info);

    Sheet sets = getSheet();
    Sheet.Set pset = Sheet.createPropertiesSet();
    pset.put(d.property);

    BeanDescriptor bd = info.getBeanDescriptor();

    if ((bd != null) && (bd.getValue("propertiesHelpID") != null)) { // NOI18N      
        pset.setValue("helpID", bd.getValue("propertiesHelpID")); // NOI18N
    }

    sets.put(pset);

    if (d.expert.length != 0) {
        Sheet.Set eset = Sheet.createExpertSet();
        eset.put(d.expert);

        if ((bd != null) && (bd.getValue("expertHelpID") != null)) { // NOI18N      
            eset.setValue("helpID", bd.getValue("expertHelpID")); // NOI18N
        }

        sets.put(eset);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:BeanNode.java

示例3: createExpertSet

import java.beans.BeanDescriptor; //导入方法依赖的package包/类
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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:SerialDataNode.java

示例4: createPropertiesSet

import java.beans.BeanDescriptor; //导入方法依赖的package包/类
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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:SerialDataNode.java

示例5: test

import java.beans.BeanDescriptor; //导入方法依赖的package包/类
private static void test(BeanDescriptor bd, String name, Object expected) {
    Object value = bd.getValue(name);
    System.out.println("\t" + name + " = " + value);
    if (!Objects.equals(value, expected)) {
        throw new Error(name + ": expected = " + expected + "; actual = " + value);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:TestSwingContainer.java


注:本文中的java.beans.BeanDescriptor.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。