source: java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/resource/FramScriptResourceDescriptionManager.java

Last change on this file was 438, checked in by Mateusz Poszwa, 9 years ago

Ported Framclipse to Xtext 2.8.4

  • Property svn:eol-style set to native
File size: 930 bytes
Line 
1package com.framsticks.framclipse.resource;
2
3import org.eclipse.emf.ecore.resource.Resource;
4import org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy;
5import org.eclipse.xtext.resource.IResourceDescription;
6import org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager;
7import com.google.inject.Inject;
8import com.google.inject.Provider;
9
10public class FramScriptResourceDescriptionManager extends
11                DefaultResourceDescriptionManager {
12
13        @Inject
14        private IDefaultResourceDescriptionStrategy strategy;
15
16        private static final String CACHE_KEY = FramScriptResourceDescriptionManager.class.getName() + "#getResourceDescription";
17       
18        public IResourceDescription getResourceDescription(final Resource resource) {
19                return getCache().get(CACHE_KEY, resource, new Provider<IResourceDescription>(){
20                        public IResourceDescription get() {
21                                return new FramScriptResourceDescription(resource, strategy);
22                        }});
23        }
24
25}
Note: See TracBrowser for help on using the repository browser.