本文整理汇总了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;
}
示例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;
}