How to replace text in editor [message #329501] |
Thu, 26 June 2008 09:16 |
Eclipse User |
|
|
|
Originally posted by: chingyichan.tw.gmail.com
Hi,
I am learning to write a plugin. My target is replacing the selected text.
The selection I know how to do, but how to replace the selection as any
string ?
I try use the
window.getActivePage().getActiveEditor().getEditorInput()
to get FileEditorInput and get the IFile instance.
it can append contents or set contents in the file,
but I only want to modfiy the editor buffer not the real file.
Any suggestion?
|
|
|
Re: How to replace text in editor [message #329606 is a reply to message #329501] |
Mon, 30 June 2008 01:31 |
Eclipse User |
|
|
|
Originally posted by: chingyichan.tw.gmail.com
Ching Yi, Chan 提到:
> Hi,
>
> I am learning to write a plugin. My target is replacing the selected text.
> The selection I know how to do, but how to replace the selection as any
> string ?
>
> I try use the
> window.getActivePage().getActiveEditor().getEditorInput()
>
> to get FileEditorInput and get the IFile instance. it can append
> contents or set contents in the file, but I only want to modfiy the
> editor buffer not the real file.
>
> Any suggestion?
>
>
I found that I can use IDocument to modify my text buffer.
REF :
http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.platfo rm/msg43276.html
|
|
|
Powered by
FUDForum. Page generated in 0.02977 seconds