public class ModelAdaptorFactory extends Object implements IAdapterFactory
Clients do not use this file directly, but call methods like
TextGridObject#getAdapter(Object, Class)
instead.
TextGridObject
,
IAdaptable.getAdapter(Class)
Constructor and Description |
---|
ModelAdaptorFactory() |
Modifier and Type | Method and Description |
---|---|
protected static IFile |
createFileFor(TextGridObject object)
Returns an IFile for the given TextGridObject.
|
Object |
getAdapter(Object adaptableObject,
Class adapterType) |
Class[] |
getAdapterList() |
protected static IFile |
getFileFor(TextGridObject object,
boolean createProject)
Not API, please use getAdapter().
|
protected static IProject |
getOpenProject(TextGridObject object,
boolean createProject)
Determines and opens the
IProject in the current workspace where
the resource for object will be placed in. |
protected static IFile getFileFor(TextGridObject object, boolean createProject)
object
- the TextGridObject to get the file for. May not be null.createProject
- if true
and the project does not exist yet, the project is
created. Beware that this may be prone to scheduling issues.SchedulingException
- if we can't create the project due to scheduling issues. Will never be thrown when createProject is false
protected static IFile createFileFor(TextGridObject object)
Returns an IFile for the given TextGridObject. If the IFile does not
exist in the workspace yet, a link is created, use
getFileFor(TextGridObject, boolean)
if you don't want this.
This method is not intended for end-users: Use TextGridObject.getAdapter(IFile.class) instead.
protected static IProject getOpenProject(TextGridObject object, boolean createProject) throws CoreException
IProject
in the current workspace where
the resource for object will be placed in.object
- The TextGridObject
for which a IProject
should
be returnedcreateProject
- if the project does not exist yet, createProject
determines what to do: If true
, the project will
be created and returned, if false
,
null
will be returned.IProject
where the link for TextGridObject
's
IFile
can be placed into, or null
if the
project doesn't exist and isn't created.CoreException
- if something goes wrong, especially with accessing metadata.SchedulingException
- if we aren't allowed to perform neccessary workspace
operations due to scheduling conflicts.public Object getAdapter(Object adaptableObject, Class adapterType)
getAdapter
in interface IAdapterFactory
public Class[] getAdapterList()
getAdapterList
in interface IAdapterFactory