I.E., if you have a TextGridObject and need an IFile,
TextGridObject textGridObject; /* ... fill textGridObject ... */ IFile file = (IFile) textGridObject.getAdapter(IFile.class); if (file != null) /* do something with file */
or vice versa
IFile file; /* ... fill file ... */ TextGridObject textGridObject = (TextGridObject) file.getAdaptor(TextGridObject.class);
The IFiles have methods for reading and writing and they can also be passed, e.g., to plain Eclipse editors (by means of a
IFileEditorInput, which is a standard Eclipse interface that can also be adapted to (and from) directly from TextGridObjects).