Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » 3.2 breaks document creation
3.2 breaks document creation [message #315380] Wed, 09 May 2007 12:49 Go to next message
Farokh Morshed is currently offline Farokh MorshedFriend
Messages: 53
Registered: July 2009
Member
3.2 says:
"clients which need a different org.eclipse.jface.text.IDocument
implementation create the corresponding document in their document
provider. The custom document will wrap the document provided by the file
buffer."

I interpret this to mean, create your own:
xxxDocumentProvider extends TextFileDocumentProvider
xxxFileBuffer extends AbstractFileBuffer,
xxxTextFileBuffer extends xxxFileBuffer implements ITextFileBuffer
xxxDocument implements IDocument

But, I see of no way to fire events from xxxTextFileBuffer as it is done
in ResourceTextFileBuffer (for example
fManager.fireDirtyStateChanged(...)) because the manager is of type
TextFileBufferManager and the fire methods are protected. Perhaps the
fire methods should be brought up to the ITextFileBufferManager interface.
I don't know if this all that is needed to allow extending Eclipse for
creating your own IDocuments, but should be the right step.

I can cite more detailed examples, but I think whoever knows the
platform's text handling stuff should be able to understand what I am
talking about.

Am I missing something here, or is extending Eclipse's document creation
just broken?

farokh
Re: 3.2 breaks document creation [message #315408 is a reply to message #315380] Wed, 09 May 2007 15:46 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Farokh Morshed wrote:

> 3.2 says:
> "clients which need a different org.eclipse.jface.text.IDocument
> implementation create the corresponding document in their document
> provider. The custom document will wrap the document provided by the
> file buffer."
>
> I interpret this to mean, create your own: xxxDocumentProvider
> extends TextFileDocumentProvider
> xxxFileBuffer extends AbstractFileBuffer, xxxTextFileBuffer extends
> xxxFileBuffer implements ITextFileBuffer

To write your own file buffer implementations is not allowed.

Dani

> xxxDocument implements IDocument
> But, I see of no way to fire events from xxxTextFileBuffer as it is
> done in ResourceTextFileBuffer (for example
> fManager.fireDirtyStateChanged(...)) because the manager is of type
> TextFileBufferManager and the fire methods are protected. Perhaps the
> fire methods should be brought up to the ITextFileBufferManager
> interface. I don't know if this all that is needed to allow extending
> Eclipse for creating your own IDocuments, but should be the right step.
> I can cite more detailed examples, but I think whoever knows the
> platform's text handling stuff should be able to understand what I am
> talking about.
> Am I missing something here, or is extending Eclipse's document
> creation just broken?

>
> farokh
>
Re: 3.2 breaks document creation [message #315411 is a reply to message #315408] Wed, 09 May 2007 16:13 Go to previous messageGo to next message
Farokh Morshed is currently offline Farokh MorshedFriend
Messages: 53
Registered: July 2009
Member
Believe me, I do not want to create my own file buffer classes. But, the
comment from the Document Creation Help that I quoted in original note
above made me believe that I need to.

So, how can we have our own IDocument implementation for our editor?

farokh
Re: 3.2 breaks document creation [message #315425 is a reply to message #315408] Wed, 09 May 2007 19:29 Go to previous messageGo to next message
Farokh Morshed is currently offline Farokh MorshedFriend
Messages: 53
Registered: July 2009
Member
Essentially, our Eclipse editor gives the file to another process, then
the editor's document provider must produce an IDocument instance that
accesses the file (using RPC) from the other process.

We want the file to be "managed" by Eclipse, but the file content to be
managed/produced by some other component.

Our editor does not need its own document provider, xxxFileBuffer or
xxxTextFileBuffer. Just a custom IDocument object that when its get
method is called it knows how to access the file from the other process.

Because other code (plugins, etc.) can get our document and its content
(using document provider's getDocument()), or put listeners on the file
buffer, etc., we must play by the rules from the document provider all the
way down to the custom IDocument object.

Can this be done using some Eclipse extensions? I thought custom
IDocuments was the solution. No?
Re: 3.2 breaks document creation [message #315526 is a reply to message #315408] Fri, 11 May 2007 16:26 Go to previous messageGo to next message
Farokh Morshed is currently offline Farokh MorshedFriend
Messages: 53
Registered: July 2009
Member
Still looking for an answer...

Is the answer to create something along the lines of
ClassFileDocumentProvider?

Is the way this class is setup with its super classes and how you can
override certain protected methods that create the document the perscribed
way of implementing your own IDocuments for your editor? So does this
replace (well it has been there for a while) the deprecated document
creation technique?
Re: 3.2 breaks document creation [message #1703467 is a reply to message #315526] Fri, 31 July 2015 19:03 Go to previous message
Andrea Richiardi is currently offline Andrea RichiardiFriend
Messages: 3
Registered: July 2015
Junior Member
I am interested in the answer as well. In particular, without the document factories, how one goes on creating a custom IDocument?
Previous Topic:Premature end of file under linux in CLI / not seen under Windows
Next Topic:How to plug a custom IDocument?
Goto Forum:
  


Current Time: Fri Apr 26 03:26:20 GMT 2024

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

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

Back to the top