org.eclipse.xtext.ui.resource
Class Storage2UriMapperImpl

java.lang.Object
  extended by org.eclipse.xtext.ui.resource.Storage2UriMapperImpl
All Implemented Interfaces:
java.util.EventListener, org.eclipse.core.resources.IResourceChangeListener, IStorage2UriMapper
Direct Known Subclasses:
Storage2UriMapperJavaImpl

public class Storage2UriMapperImpl
extends java.lang.Object
implements IStorage2UriMapper, org.eclipse.core.resources.IResourceChangeListener

Author:
Sven Efftinge - Initial contribution and API

Constructor Summary
Storage2UriMapperImpl()
           
 
Method Summary
 java.lang.Iterable<Pair<org.eclipse.core.resources.IStorage,org.eclipse.core.resources.IProject>> getStorages(org.eclipse.emf.common.util.URI uri)
          Find the storages that can be mapped to the given URI.
 org.eclipse.emf.common.util.URI getUri(org.eclipse.core.resources.IStorage storage)
          Returns the URI for the given IStorage or null if not valid URI exists.
protected  org.eclipse.core.resources.IWorkspaceRoot getWorkspaceRoot()
           
protected  org.eclipse.emf.common.util.URI internalGetUri(org.eclipse.core.resources.IStorage storage)
           
protected  boolean isValidStorageFor(org.eclipse.emf.common.util.URI uri, org.eclipse.core.resources.IStorage storage)
           
 boolean isValidUri(org.eclipse.emf.common.util.URI uri, org.eclipse.core.resources.IStorage storage)
           
 void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
          Notifies this listener that some resource changes are happening, or have already happened.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Storage2UriMapperImpl

public Storage2UriMapperImpl()
Method Detail

getStorages

public java.lang.Iterable<Pair<org.eclipse.core.resources.IStorage,org.eclipse.core.resources.IProject>> getStorages(org.eclipse.emf.common.util.URI uri)
Description copied from interface: IStorage2UriMapper
Find the storages that can be mapped to the given URI. It will typically be only one IStorage associated with one IProject but in the case that the same external class folder or jar is referenced in multiple projects multiple IStorages are returned.

Specified by:
getStorages in interface IStorage2UriMapper
Parameters:
uri - the URI. May not be null.
Returns:
IStorages corresponding to the given URI. Never null.

getWorkspaceRoot

protected org.eclipse.core.resources.IWorkspaceRoot getWorkspaceRoot()

getUri

public final org.eclipse.emf.common.util.URI getUri(org.eclipse.core.resources.IStorage storage)
Description copied from interface: IStorage2UriMapper
Returns the URI for the given IStorage or null if not valid URI exists.

Specified by:
getUri in interface IStorage2UriMapper
Returns:
returns the URI for the given IStorage or null.

internalGetUri

protected org.eclipse.emf.common.util.URI internalGetUri(org.eclipse.core.resources.IStorage storage)

isValidUri

public boolean isValidUri(org.eclipse.emf.common.util.URI uri,
                          org.eclipse.core.resources.IStorage storage)

isValidStorageFor

protected boolean isValidStorageFor(org.eclipse.emf.common.util.URI uri,
                                    org.eclipse.core.resources.IStorage storage)

resourceChanged

public void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
Description copied from interface: org.eclipse.core.resources.IResourceChangeListener
Notifies this listener that some resource changes are happening, or have already happened.

The supplied event gives details. This event object (and the resource delta within it) is valid only for the duration of the invocation of this method.

Note: This method is called by the platform; it is not intended to be called directly by clients.

Note that during resource change event notification, further changes to resources may be disallowed.

Specified by:
resourceChanged in interface org.eclipse.core.resources.IResourceChangeListener
Parameters:
event - the resource change event
See Also:
IResourceDelta