Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to replace text in editor
How to replace text in editor [message #329501] Thu, 26 June 2008 09:16 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:java.lang.UnsupportedClassVersionError: Bad version number in .class file
Next Topic:command-line update (update manager)
Goto Forum:
  


Current Time: Tue Jul 16 12:35:56 GMT 2024

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

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

Back to the top