Dynamically changing Document's content [message #212418] |
Mon, 28 May 2007 01:47 |
Eclipse User |
|
|
|
Originally posted by: checknaliniasha.yahoo.com
Hey Daniel,
Iam working on a project in which I need to change the existing document
not by a keyboard but through the content coming from another source
(containg the offset).
our approach to this is:-
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
IEditorPart part = page.getActiveEditor();
ITextEditor editor = (ITextEditor)part;
IDocumentProvider dp=editor.getDocumentProvider();
IDocument doc= dp.getDocument(editor.getEditorInput());
DocumentEvent e= new DocumentEvent(doc, 10, 2, "hi" );
this.fireDocumentAboutToBeChanged(e);
But we want to fire this method on doc. How can we acheive this.
Are we on the right track or not.Please suggest the right approach to do
this.
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.29930 seconds