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


Java PropertyTester类代码示例

本文整理汇总了Java中org.eclipse.core.expressions.PropertyTester的典型用法代码示例。如果您正苦于以下问题:Java PropertyTester类的具体用法?Java PropertyTester怎么用?Java PropertyTester使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testAttribute

import org.eclipse.core.expressions.PropertyTester; //导入依赖的package包/类
/**
 * Adds a way to check for the app_engine (currently hardcoded) property from this plugin.
 */
@Override
public boolean testAttribute(Object target, String name, String value) {
    //For now let's leave it checking only app_engine, but this could grow if needed.
    if ("app_engine".equals(name)) {
        List<PropertyTester> propertyTesters = getPropertyTestersFromPydevCustomizations(name);
        for (PropertyTester tester : propertyTesters) {
            if (tester.test(target, name, null, value)) {
                return true;
            }
        }
    }

    //If we didn't find what we were looking for, use the platform action filter
    if (this.platformActionFilter != null) {
        return this.platformActionFilter.testAttribute(target, name, value);
    }

    //if the platform didn't provide it, just return false.
    return false;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:24,代码来源:PythonSourceFolderActionFilter.java

示例2: getPropertyTestersFromPydevCustomizations

import org.eclipse.core.expressions.PropertyTester; //导入依赖的package包/类
/**
 * Cache them after the 1st request for a given name.
 * 
 * Gets the property testers in org.python.pydev.customizations that match the passed name.
 */
private static synchronized List<PropertyTester> getPropertyTestersFromPydevCustomizations(String name) {
    List<PropertyTester> propertyTester = propertyTesters.get(name);
    if (propertyTester == null) {
        IExtension[] extensions = ExtensionHelper.getExtensions("org.eclipse.core.expressions.propertyTesters");
        // For each extension ...
        propertyTester = new ArrayList<PropertyTester>();
        propertyTesters.put(name, propertyTester);
        for (int i = 0; i < extensions.length; i++) {
            IExtension extension = extensions[i];
            IConfigurationElement[] elements = extension.getConfigurationElements();
            // For each member of the extension ...
            for (int j = 0; j < elements.length; j++) {
                IConfigurationElement element = elements[j];
                //Any property tester that's declared in "org.python.pydev.customizations"
                //is considered to be an object that provides the objectState for an IActionFilter.
                if ("org.python.pydev.customizations".equals(element.getAttribute("namespace"))) {
                    String attribute = element.getAttribute("properties");
                    if (name.equals(attribute)) {//i.e.: app_engine (and future references)
                        try {
                            PropertyTester executableExtension = (PropertyTester) element
                                    .createExecutableExtension("class");
                            propertyTester.add(executableExtension);
                        } catch (Exception e) {
                            Log.log(e);
                        }
                    }
                }
            }
        }
    }
    return propertyTester;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:38,代码来源:PythonSourceFolderActionFilter.java


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