Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Ctrl + S for a view
Ctrl + S for a view [message #318466] Mon, 30 July 2007 11:30 Go to next message
Eclipse UserFriend
Originally posted by: nugaee.SPAMtlen.pl

I need to set custom action on save. I had two idea but my current
attempts gave me nothing.
First is to override global handler for Ctrl+S key binding when our
custom package controller has focus.
But this can only be done from editor (correct me if I'm wrong).

Second attempt was to implement savable provider (our navigator bases on
Common Navigator Framework). I manage to activate save button for dirty
elements from navigator but unfortunately it seems that save action
doesn't work.


Any hints ?
Re: Ctrl + S for a view [message #318481 is a reply to message #318466] Mon, 30 July 2007 14:16 Go to previous messageGo to next message
Eclipse UserFriend
Have your view implement ISaveablePart ... if it conforms to that API
the save action will enable/disable for free.

PW
Re: Ctrl + S for a view [message #318485 is a reply to message #318481] Mon, 30 July 2007 18:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nugaee.SPAMtlen.pl

Paul Webster wrote:
> Have your view implement ISaveablePart

I use CommonNavigator as my base view so to my knowledge
ISaveablesSource api is used to finalize save. so it requires proper
Saveables implementation which I apparently don't have ;).
I've declared my navigator content as saveable in plugin.xml

I think my problem is not using appropriate fire...Change when
to change saveables table and in last step saveables array is empty.
i use fireDirty... when my model needs to inform about change.

which fire method should I use to recalculate saveable ? what is the
different between saveables and active saveables ?


thanks in advance

bartek michalik
Re: Ctrl + S for a view [message #318487 is a reply to message #318485] Mon, 30 July 2007 18:59 Go to previous messageGo to next message
Eclipse UserFriend
Oh, do you mean that you are using your common navigator based view to
display your model ... so you'd like to be able to save model changes
when that view shuts down as well as when editors are closed?

I'm not as familiar with Common Navigator ... it seems to provide the
ISaveablesSource interface. There must be a mechanism to plug your
model into that. It already implements ISaveablePart (so it is hooked
with the standard workbench save action).

Later,
PW
Re: Ctrl + S for a view [message #318489 is a reply to message #318487] Tue, 31 July 2007 01:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nugaee.SPAMtlen.pl

Paul Webster wrote:
> Oh, do you mean that you are using your common navigator based view to
> display your model ... so you'd like to be able to save model changes
> when that view shuts down as well as when editors are closed?
we got rid of editor saves. we have one model and some fragments are
edited in different editors but save must be fired on whole model.

>
> I'm not as familiar with Common Navigator ... it seems to provide the
> ISaveablesSource interface. There must be a mechanism to plug your
> model into that. It already implements ISaveablePart (so it is hooked
> with the standard workbench save action).
>
> Later,
> PW
Re: Ctrl + S for a view [message #318666 is a reply to message #318485] Thu, 02 August 2007 14:29 Go to previous message
Eclipse UserFriend
> What is the different between saveables and active saveables ?

The "active saveables" are used to determine which saveables should be saved
by the Save action. The common navigator will return saveables based on the
current selection. If I remember correctly, it tries to map the current
selection to a saveable, and will try the parent chain of the current
selection afterwards.

As for the notification about changes in the set of saveables, did you read
the documentation in the schema definition, and the Javadoc of the
participating classes/interfaces? If this does not explain what you need to
do, could you please file a bug against Platform/UI?

Thanks
Boris
Previous Topic:test
Next Topic:Perspective
Goto Forum:
  


Current Time: Sun May 11 07:05:49 EDT 2025

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

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

Back to the top