1 11 package org.eclipse.core.internal.expressions.propertytester; 12 13 import org.eclipse.core.runtime.IProduct; 14 import org.eclipse.core.runtime.Platform; 15 16 import org.eclipse.core.expressions.PropertyTester; 17 18 27 public class PlatformPropertyTester extends PropertyTester { 28 29 private static final String PROPERTY_PRODUCT = "product"; private static final String PROPERTY_IS_BUNDLE_INSTALLED = "isBundleInstalled"; 32 35 public boolean test(Object receiver, String property, Object [] args, Object expectedValue) { 36 if (Platform.class.equals(receiver)) { 37 if (PROPERTY_PRODUCT.equals(property)) { 38 IProduct product= Platform.getProduct(); 39 if (product != null) { 40 return product.getId().equals(expectedValue); 41 } 42 return false; 43 } else if (PROPERTY_IS_BUNDLE_INSTALLED.equals(property) && args.length >= 1 && args[0] instanceof String ) { 44 return Platform.getBundle((String )args[0]) != null; 45 } 46 } 47 return false; 48 } 49 } 50 | Popular Tags |