當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。