blob: 27a8b2b9dac8bf1dd7ab08f34ba0b544b81d197d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2007, 2010 BMW Car IT, Technische Universitaet Muenchen, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* BMW Car IT - Initial API and implementation
* Technische Universitaet Muenchen - Major refactoring and extension
*******************************************************************************/
package org.eclipse.emf.edapt.history.presentation.action;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edapt.spi.history.Change;
import org.eclipse.emf.edapt.spi.history.Release;
/**
* Property tester to check whether the container of a change is a release.
*
* @author herrmama
* @author $Author$
* @version $Rev$
* @levd.rating RED Rev:
*/
public class ContainerIsReleasePropertyTester extends PropertyTester {
/** {@inheritDoc} */
@Override
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
final Change change = (Change) receiver;
final EObject container = change.eContainer();
return container != null && container instanceof Release;
}
}