blob: 99594024b0e6e52f914a59b3b352fea0e087a19b [file] [log] [blame]
cbridgha68a74152007-06-07 19:31:19 +00001/*******************************************************************************
2 * Copyright (c) 2005, 2006 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
jlanutib1d8fe22006-03-02 19:43:27 +000011package org.eclipse.wst.common.internal.emfworkbench;
12
13import org.eclipse.core.expressions.PropertyTester;
14import org.eclipse.emf.ecore.EObject;
15
16public class EmfPackagePropertyTester extends PropertyTester {
17
18 public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
19 if (receiver == null || !(receiver instanceof EObject) || expectedValue == null || !(expectedValue instanceof String))
20 return false;
21
22 EObject eObject = (EObject) receiver;
23 String emfPackage = (String)expectedValue;
24 return emfPackage.equals(eObject.eClass().getEPackage().getNsURI());
25 }
26
27}