The "One Laptop Per Child" project has a great device ready to ship, but there's no Java on there. Let's think about working together to put Java on OLPC!
The subject of the Eclipse Filing System has come up before, with RJ's
Working with the Eclipse File System
, as well as a look at a
Zip file editor
. Writing your own EFS implementation, as opposing to use the existing ones, is actually pretty easy, and the newly published
Eclipse Filing System
article goes through creating your own EFS implementation in order to navigate through a Zip file inside Eclipse.
Please post any questions or comments about the article here.
Re: New article on Eclipse Filing System available on EclipseZone
What's the relationship between org.eclipse.core.resources and EFS?
If I would like to extend the extention point of org.eclipse.ui.editors to create a editor,which use the resources file system,how could I use EFS to create the editor?
Re: New article on Eclipse Filing System available on EclipseZone
EFS is the hook which allows IResources (usually headed up with a linkedResource to a URI) to be loaded from other filing systems. It's not going to help you write an editor as such, although you could imagine an editor which was only applicable if the IResource's URI started with the EFS scheme e.g. only allowed you to open documents that began with 'sql:', for example.
Re: New article on Eclipse Filing System available on EclipseZone
This isn't an EFS question, it's an editor question.
In any case, I don't see why you need to do this. Just write to a normal IResource, except that IResource is backed by an EFS implementation. You don't actually need to change how it's done at all at the editor level.
Re: New article on Eclipse Filing System available on EclipseZone
Yes.You maybe don't understand me.
Ok,Let me describe the problem from another aspect.
How LocalFile store the contents?And how could I access,read,or write the contents of LocalFile?Is this method analogous to the method of java.io.File?
New article on Eclipse Filing System available on EclipseZone
At 4:56 PM on Dec 11, 2006, Alex Blewitt
wrote:
Please post any questions or comments about the article here.
7 replies so far (
Post your own)
Re: New article on Eclipse Filing System available on EclipseZone
Actually, the Eclipse Zip editor doesn't use EFS at all. It should though...ActiveObjects: an Easier Java ORM; Fuse: Resource Injection for Java
Re: New article on Eclipse Filing System available on EclipseZone
What's the relationship between org.eclipse.core.resources and EFS?If I would like to extend the extention point of org.eclipse.ui.editors to create a editor,which use the resources file system,how could I use EFS to create the editor?
Re: New article on Eclipse Filing System available on EclipseZone
EFS is the hook which allows IResources (usually headed up with a linkedResource to a URI) to be loaded from other filing systems. It's not going to help you write an editor as such, although you could imagine an editor which was only applicable if the IResource's URI started with the EFS scheme e.g. only allowed you to open documents that began with 'sql:', for example.Alex.
Re: New article on Eclipse Filing System available on EclipseZone
public void writeContents(LocalFile newFile, String xfdlNamespace) throws CoreException{
InputStream theInputStream = getFormTemplateManager().getContentStream(xfdlNamespace);
if (theInputStream != null)
{
byte[] data = new byte[1];
try
{
OutputStream theOutputStream2 = newFile.openOutputStream(EFS.NONE, null);
BufferedOutputStream bout = new BufferedOutputStream(theOutputStream2);
while (theInputStream.read(data) != -1)
{
bout.write(data);
}
theOutputStream2.flush();
theInputStream.close();
theOutputStream2.close();
bout.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
Could the code fragment above write some contents(eg. string) to the LocalStore?If not,how could I do?
Re: New article on Eclipse Filing System available on EclipseZone
This isn't an EFS question, it's an editor question.In any case, I don't see why you need to do this. Just write to a normal IResource, except that IResource is backed by an EFS implementation. You don't actually need to change how it's done at all at the editor level.
Alex.
Re: New article on Eclipse Filing System available on EclipseZone
Yes.You maybe don't understand me.Ok,Let me describe the problem from another aspect.
How LocalFile store the contents?And how could I access,read,or write the contents of LocalFile?Is this method analogous to the method of java.io.File?
You can create linked resources
You can use the generic "add file" or "add folder" dialogues to add filesystem links