Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to "create document" in 3.2?
How to "create document" in 3.2? [message #243610] Thu, 10 May 2007 08:53 Go to next message
Eclipse UserFriend
Can anyone in the JDT development land shed some light on this issue?

JDT is a user of the platform text classes so surely you guys know.

In
http://www.eclipse.org/newsportal/article.php?id=64533&g roup=eclipse.platform#64533

I describe that 3.2 by deprecating the document creation extension has
made it impossible to create your own implementation of IDocument for your
editor.

We are creating a full development tooling environment about the size of
JDT and have run into a snag.

Our editor gives the url of the file to another component (actually
another process that communicates using sockets), and it is that component
that must provide the content of the file to the editor. So, (I think) we
want our own IDocument implementation that in its get/set/replace methods
talks to the other component to manipulate the content of the file. But,
as I explain in the cited note above, it seems that 3.2 has made this
impossible. Perhaps this was never possible!

As expert users of the platform text classes, can you guys comment on this
please?

farokh
Re: How to "create document" in 3.2? [message #243662 is a reply to message #243610] Fri, 11 May 2007 04:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jacek.pospychala.pl.ibm.com

Farokh,
what about setting your own custom document provider that delivers your
desired IDocuments:

YourTextEditor.init() {
setDocumentProvider(new MyDocumentProvider());
...
}

MyDocumentProvider() {
IDocument getDocument(Object o) {
return new IDocument() {
// chat with your external process
}
}
}

However please consider if you really want to forward every
IDocument.replace() to external mechanisms. It's called every time user
presses any key and may seriously slow down editor. Think also what will
happen with save? It will be no longer useful as your document is stored
directly, without any buffers.

Maybe it would be better to fetch whole document once when it's opened
and save every time user wants it (Ctrl+S). This can be done by
implementing only IDocumentProvider and attaching it to editor.

You could even try EFS (http://wiki.eclipse.org/index.php/EFS) and make
your resources available not only to your editor but whole IDE, by
making them look like normal workspace resources.


Farokh Morshed wrote:
> Can anyone in the JDT development land shed some light on this issue?
>
> JDT is a user of the platform text classes so surely you guys know.
>
> In
> http://www.eclipse.org/newsportal/article.php?id=64533&g roup=eclipse.platform#64533
>
>
> I describe that 3.2 by deprecating the document creation extension has
> made it impossible to create your own implementation of IDocument for
> your editor.
>
> We are creating a full development tooling environment about the size of
> JDT and have run into a snag.
> Our editor gives the url of the file to another component (actually
> another process that communicates using sockets), and it is that
> component that must provide the content of the file to the editor. So,
> (I think) we want our own IDocument implementation that in its
> get/set/replace methods talks to the other component to manipulate the
> content of the file. But, as I explain in the cited note above, it
> seems that 3.2 has made this impossible. Perhaps this was never possible!
>
> As expert users of the platform text classes, can you guys comment on
> this please?
>
> farokh
>
Re: How to "create document" in 3.2? [message #243671 is a reply to message #243662] Fri, 11 May 2007 11:49 Go to previous message
Eclipse UserFriend
Yes, I considered the solution that you are suggesting: Have my document
provider to directly manage my IDocument object. But I am not sure if
that would be the proper integration into Eclipse. This solution would
not use file buffers and more importantly the TextFileBufferManager. Here
are the problems:

1. What if some plugin used the manager to get all the buffers and put
listeners on them? 2. The original document creation extension, as far as
I can tell, worked by letting the ResourceFileBuffer use a registry to
find appropriate IDocument implementations. Surly putting the Idocument
under the file buffer was for a reason. 3. The comment in Help regarding
deprecation of the document creation extension says to wrap the Idocument
object inside a file buffer.

At this point, I am not sure at all what is the prescribed way of
providing/extending IDocument implementation with full Eclipse
interoperability and blessing.

With regard to your performance comment... To save readers from too much
detail I did not go through the gory detail of how we are going to do
this. At this point I just want to know what mechanism is replacing this
document creation extension that is deprecated.

Any Platform text or users of it out there that can tell us?
Previous Topic:User defined templates with "choice"
Next Topic:Breakpoint Icons not showing on ruler
Goto Forum:
  


Current Time: Wed Jul 16 18:13:32 EDT 2025

Powered by FUDForum. Page generated in 0.42658 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top