implementing MVC on textviewers [message #302666] |
Thu, 27 April 2006 01:26  |
Eclipse User |
|
|
|
i have used MVC with other viewer such as treeViewer, tableViewer.
They support contentProvider, labelProviders.
But i have seen textViewers mostly used inside textEditors and to provide
contents to textViewer, one just need to type there.
BUt is it not possible to have some model which will, through some adapter
inbetween (may be content provider for textViewer),writing on textViewer
after some events.
IS there API support for this?
-- mithun
|
|
|
|
|
|
|
Re: implementing MVC on textviewers [message #302799 is a reply to message #302769] |
Sat, 29 April 2006 06:33  |
Eclipse User |
|
|
|
Tom Eicher wrote:
> mithun wrote:
>> How to modify viewer's document? As i have seen there is only support
>> for writing totally new content to document by set method. replace
>> method is there but i think it only allows to change content set by set().
>>
>> I want to append content already present.
>> So replace is only way to modify document?
> Yes:
> void append(IDocument doc, String s) {
> doc.replace(doc.getLength(), 0, s);
> }
> -tom
Thanks for information, I can use this.
But i think that using replace method in this way doesnt match semantics
of replace. Working with treeviewer, tableviewer i can say that they form
part good MVC pattern with support model and contentproviders.
Then why such a difference with textviewer? As IDocument is supposed to
model for textviewer it should have support to plugin our content provider
which will automatically update viewer with changes in model.
Yes we can code that for our needs, But why this adapter support is not
their in textviewer?
-- mithun
|
|
|
Powered by
FUDForum. Page generated in 0.03234 seconds