Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b7f3c6e52588d8ad8920f3d3683788e4226e55a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package org.eclipse.papyrus.infra.gmfdiag.css.model.queries;

import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
import org.eclipse.uml2.uml.Element;

public class IsStyleSheetContainer implements IJavaModelQuery<Element, Boolean> {

	public Boolean evaluate(Element context, ParameterValueList args)
			throws ModelQueryExecutionException {
		if (context.eResource() == null){
			return false;
		}

		//Only the first root element is a StyleSheet container
		return context.eResource().getContents().get(0) == context;
	}

}

Back to the top