Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 84725cf69f90e46d4dd5f49416780332485665ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package org.eclipse.papyrus.infra.gmfdiag.css.model.queries;

//TODO: EMF-FACET update query
public class GetStyleSheets {/**implements
		IJavaModelQuery<Element, Collection<StyleSheet>> {

	public Collection<StyleSheet> evaluate(Element context,
			ParameterValueList args) throws ModelQueryExecutionException {
		ResourceSet resourceSet = context.eResource().getResourceSet();
		if (resourceSet == null) {
			return findStyleSheets(context.eResource());
		}

		List<StyleSheet> result = new LinkedList<StyleSheet>();
		for (Resource resource : context.eResource().getResourceSet()
				.getResources()) {
			result.addAll(findStyleSheets(resource));
		}

		return result;
	}

	private Collection<StyleSheet> findStyleSheets(Resource eResource) {
		List<StyleSheet> result = new LinkedList<StyleSheet>();
		for (EObject rootElement : eResource.getContents()){
			if (rootElement instanceof StyleSheet){
				result.add((StyleSheet)rootElement);
			}
		}
		return result;
	}**/

}

Back to the top