Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » storageeditorinput and SAVE ???
storageeditorinput and SAVE ??? [message #332659] Tue, 04 November 2008 10:15 Go to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Hi all,

I have an object model that represents object in a database .
I have got an input stream / output stream to use during the load / save
operation .


The question is:
I did a MyEditorInput which extends a IStorageEditorInput .

Based on the extension file I open the eclipse default editor for that db
object (ie. Structured for xml file . texteditor for txt) .

No problem in opening the editor . but what shall I do to save it?
I don't want to implement the IPersistableElement what I need is press the
save button and be sure that the information will be passed to the output
stream ...

I have done previously this extending the (StructuredTextEditor) ... but
what shall I do to use the normal editors?

Thanks
Kar
Re: storageeditorinput and SAVE ??? [message #332660 is a reply to message #332659] Tue, 04 November 2008 10:32 Go to previous messageGo to next message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
Kar wrote:
> I have done previously this extending the (StructuredTextEditor) ... but
> what shall I do to use the normal editors?

Extend the editor's doSave(IProgressMonitor) and write to your
OutputStream there...?
Re: storageeditorinput and SAVE ??? [message #332665 is a reply to message #332660] Tue, 04 November 2008 11:27 Go to previous messageGo to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Hi Remy,

the problem is that I'm giving the user the possibility to open any possible
eclipse editor ...
or I do remove this option or I have to find a way to stick a listener on
the opened editor when this will get opened ..

any suggestion?


"Remy Chi Jian Suen" <remy.suen@gmail.com> wrote in message
news:gep89h$2p1$1@build.eclipse.org...
> Kar wrote:
> > I have done previously this extending the (StructuredTextEditor) ... but
> > what shall I do to use the normal editors?
>
> Extend the editor's doSave(IProgressMonitor) and write to your
> OutputStream there...?
Re: storageeditorinput and SAVE ??? [message #332666 is a reply to message #332665] Tue, 04 November 2008 12:13 Go to previous messageGo to next message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
Kar, there is no way you can know whether an editor supports saving back
to a given IEditorInput. If you check the API for the ISEI, it doesn't
even mention saving back to the underlying IStorage and suggests that a
new file resource be created for writing the contents.

"File-oriented editors should support this as a valid input type, and
display its content for viewing (but not allow modification). Within the
editor, the "save" and "save as" operations should create a new file
resource within the workspace."

http://help.eclipse.org/stable/nftopic/org.eclipse.platform. doc.isv/reference/api/org/eclipse/ui/IStorageEditorInput.htm l
Re: storageeditorinput and SAVE ??? [message #332673 is a reply to message #332666] Tue, 04 November 2008 15:31 Go to previous message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
what about a file ... I mean I could export the memory information on a file
and create a filestoreeditorinput
would it be of any help ...
guess not I cannot see any link to save operation ... but I could probably
set some resource change listener ... but again this probably will work if
the file is inside eclipse and not only in the filesystem ...


"Remy Chi Jian Suen" <remy.suen@gmail.com> wrote in message
news:gepe73$hgr$1@build.eclipse.org...
> Kar, there is no way you can know whether an editor supports saving back
> to a given IEditorInput. If you check the API for the ISEI, it doesn't
> even mention saving back to the underlying IStorage and suggests that a
> new file resource be created for writing the contents.
>
> "File-oriented editors should support this as a valid input type, and
> display its content for viewing (but not allow modification). Within the
> editor, the "save" and "save as" operations should create a new file
> resource within the workspace."
>
> http://help.eclipse.org/stable/nftopic/org.eclipse.platform. doc.isv/reference/api/org/eclipse/ui/IStorageEditorInput.htm l
Previous Topic:How to get Linked Folders of a Project
Next Topic:Access restriction problem when using Java 6
Goto Forum:
  


Current Time: Wed Jul 03 03:42:14 GMT 2024

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

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

Back to the top