my own EditorInput [message #74269] |
Fri, 13 June 2003 22:39 |
Eclipse User |
|
|
|
Originally posted by: joseph.cse.iitk.ac.in
I've made an editor that extends TextEditor and its associated with the
file extension "aci". Files of this type do not contain the text that i
need to display but instead I have to do some computations on this text
and i have to display the computed text. And when i save a document, the
displayed text has to be converted back and saved to the file.
Should I make my own kind of EditorInput? If so, how do I make one or is
there some other simpler way?
|
|
|
Re: my own EditorInput [message #74395 is a reply to message #74269] |
Sat, 14 June 2003 09:45 |
Eclipse User |
|
|
|
Originally posted by: bob.objfac.com
Eclipse has some design limitations (flaws, actually) that you have to work
around, but fortunately Ed Burnette has already been there and done that.
The thing to do is download his fileopen plugin and look at the source. It's
very compact and easy to read.
Now where is that plugin? Oh yeah. http://www.eclipsepowered.org/.
Bob
"joppu" <joseph@cse.iitk.ac.in> wrote in message
news:bcdjqj$5g1$1@rogue.oti.com...
> I've made an editor that extends TextEditor and its associated with the
> file extension "aci". Files of this type do not contain the text that i
> need to display but instead I have to do some computations on this text
> and i have to display the computed text. And when i save a document, the
> displayed text has to be converted back and saved to the file.
> Should I make my own kind of EditorInput? If so, how do I make one or is
> there some other simpler way?
>
|
|
|
Re: my own EditorInput [message #74447 is a reply to message #74395] |
Sat, 14 June 2003 11:39 |
Eclipse User |
|
|
|
Originally posted by: joseph.cse.iitk.ac.in
I dont think that's what i wanted...the files I need to open are in the
workspace. I dont display the text in the file but instead i convert the
text to some other text and then display it. When the file is saved in the
editor i have to convert the displayed text back to the original format.
Here's an example of what im talking about:
Suppose the file TEST.ACI in the workspace contains the string "abcdef".
When the user opens this file, my editor starts...and the string "abcdef"
is convertered to "bambhole" and then displayed on the editor's
StyledText. This conversion is done by the convertTo(String text) method
of my editor. The user then makes changes to the displayed text (suppose
he changes it to "bamshankar") and when he saves it the displayed text is
converted back using the convertBack(String text) method which returns
"abcfxvwd" and this text is written to the file.
So how do i handle this kind of behaviour?
Bob Foster wrote:
> Eclipse has some design limitations (flaws, actually) that you have to work
> around, but fortunately Ed Burnette has already been there and done that.
> The thing to do is download his fileopen plugin and look at the source. It's
> very compact and easy to read.
> Now where is that plugin? Oh yeah. http://www.eclipsepowered.org/.
> Bob
|
|
|
Re: my own EditorInput [message #74483 is a reply to message #74447] |
Sat, 14 June 2003 15:14 |
Eclipse User |
|
|
|
Originally posted by: pdrolet.mac.com
Hi,
It looks like you will have to create 2 new classes:
1. one that implements IEditorInput - that will be used to create an
input (the one that will be called first by your viewPart).
2. one that extends EditorPart - that will be used by the input to
see/modify the input.
You can place your methods in the EditorPart or the EditorInput.
See the related doc for the details. I succeeded to create quite
sophisticated EditorPart by looking at examples (quantum, jfacedbc).
Patrice Drolet
> From: joseph@cse.iitk.ac.in (joppu)
Newsgroups:
> eclipse.platform
Subject: Re: my own EditorInput
Date: Saturday June
> 14, 2003 (07:39 AM)
I dont think that's what i wanted...the files I
> need to open are in the workspace. I dont display the text in the
> file but instead i convert the text to some other text and then
> display it. When the file is saved in the editor i have to convert
> the displayed text back to the original format. Here's an example of
> what im talking about:
>
> Suppose the file TEST.ACI in the workspace contains the string
> "abcdef". When the user opens this file, my editor starts...and the
> string "abcdef" is convertered to "bambhole" and then displayed on
> the editor's StyledText. This conversion is done by the
> convertTo(String text) method of my editor. The user then makes
> changes to the displayed text (suppose he changes it to "bamshankar")
> and when he saves it the displayed text is converted back using the
> convertBack(String text) method which returns "abcfxvwd" and this
> text is written to the file. So how do i handle this kind of
> behaviour?
>
> Bob Foster wrote:
>
>> Eclipse has some design limitations (flaws, actually) that you have
>> to work around, but fortunately Ed Burnette has already been there
>> and done that. The thing to do is download his fileopen plugin and
>> look at the source. It's very compact and easy to read.
>
>> Now where is that plugin? Oh yeah. http://www.eclipsepowered.org/.
>
>> Bob
>
>
>
|
|
|
Re: my own EditorInput [message #74555 is a reply to message #74269] |
Sat, 14 June 2003 19:05 |
Eclipse User |
|
|
|
Originally posted by: joseph.cse.iitk.ac.in
I think i found the solution to my problem. Im using my own document
provider that extends FileDocumentProvider and i've overridden the
createDocument and doSaveDocument methods in which i handle my
conversions. And then, i set my editor's document provider to my own
document provider. Thanks for all the help!
joppu wrote:
> I've made an editor that extends TextEditor and its associated with the
> file extension "aci". Files of this type do not contain the text that i
> need to display but instead I have to do some computations on this text
> and i have to display the computed text. And when i save a document, the
> displayed text has to be converted back and saved to the file.
> Should I make my own kind of EditorInput? If so, how do I make one or is
> there some other simpler way?
|
|
|
Powered by
FUDForum. Page generated in 1.17820 seconds