1 11 package org.eclipse.core.expressions; 12 13 import org.osgi.framework.Bundle; 14 15 import org.eclipse.core.runtime.IConfigurationElement; 16 import org.eclipse.core.runtime.Platform; 17 18 import org.eclipse.core.internal.expressions.PropertyTesterDescriptor; 19 20 64 public abstract class PropertyTester implements IPropertyTester { 65 66 private IConfigurationElement fConfigElement; 67 private String fNamespace; 68 private String fProperties; 69 70 78 public final void internalInitialize(PropertyTesterDescriptor descriptor) { 79 fProperties= descriptor.getProperties(); 80 fNamespace= descriptor.getNamespace(); 81 fConfigElement= descriptor.getConfigurationElement(); 82 } 83 84 90 public final PropertyTesterDescriptor internalCreateDescriptor() { 91 return new PropertyTesterDescriptor(fConfigElement, fNamespace, fProperties); 92 } 93 94 97 public final boolean handles(String namespace, String property) { 98 return fNamespace.equals(namespace) && fProperties.indexOf("," + property + ",") != -1; } 100 101 104 public final boolean isInstantiated() { 105 return true; 106 } 107 108 111 public boolean isDeclaringPluginActive() { 112 Bundle bundle= Platform.getBundle(fConfigElement.getContributor().getName()); 113 return bundle.getState() == Bundle.ACTIVE; 114 } 115 116 119 public final IPropertyTester instantiate() { 120 return this; 121 } 122 } 123 | Popular Tags |