Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to add an ISaveHandler and IWindowCloseHandler to the Model(How to add an ISaveHandler and IWindowCloseHandler to the Model)
How to add an ISaveHandler and IWindowCloseHandler to the Model [message #1060934] Wed, 29 May 2013 08:32 Go to next message
Uti Devel is currently offline Uti Devel
Messages: 7
Registered: May 2013
Junior Member
Hi,

how to register a custom ISaveHandler and IWindowCloseHandler to an Eclipse RCP4 Application?

I created custom ISaveHandler and a custom IWindowCloseHandler to alter the close behavior of Parts and the Window.

Currently i add this Handlers to the MWindow context by injection the MWindow to every Part that is created and than create and add the Handlers to the context. This is definitely the the wrong attempt but i have no idea how to add the Handers directly to the Model!?

Thanks in advance Smile
Re: How to add an ISaveHandler and IWindowCloseHandler to the Model [message #1060955 is a reply to message #1060934] Wed, 29 May 2013 09:41 Go to previous messageGo to next message
Andrzej Szczepanski is currently offline Andrzej Szczepanski
Messages: 16
Registered: May 2013
Junior Member
Quote:
how to register a custom ISaveHandler and IWindowCloseHandler to an Eclipse RCP4 Application?


The way it was shown just a few topics before yours:
http://www.eclipse.org/forums/index.php/t/485714/

Quote:
Currently i add this Handlers to the MWindow context by injection the MWindow to every Part that is created and than create and add the Handlers to the context

If I understood this correctly:
-it seems you already know how to do this;
-no, I am not aware of any way you can set these handlers through application model;
-you only need to set these handlers in MWindow's context once;
-unless, you want different handlers for different occasions;
-afaik (at least in Juno) it is not possible to register close/save handler to individual part.
Re: How to add an ISaveHandler and IWindowCloseHandler to the Model [message #1060956 is a reply to message #1060955] Wed, 29 May 2013 09:58 Go to previous messageGo to next message
Uti Devel is currently offline Uti Devel
Messages: 7
Registered: May 2013
Junior Member
Hi,

thanks for the quick answer. My problem is that i don't understand how to register the handler only once. I guess i need something that get's notified when my window is created. After this i can add the handler to the context of the window.

The solution provided in http://www.eclipse.org/forums/index.php/mv/msg/369989/966231/#msg_966231 shows how to add the handler but does't show how to get the QuitProcessor started up. As i replyed to that post i have no idea what to do with the QuitProsessor? Sad

-I only want to use one handler.

Thanks
Re: How to add an ISaveHandler and IWindowCloseHandler to the Model [message #1060961 is a reply to message #1060956] Wed, 29 May 2013 10:20 Go to previous messageGo to next message
Andrzej Szczepanski is currently offline Andrzej Szczepanski
Messages: 16
Registered: May 2013
Junior Member
Ok, now I see. I hadn't noticed that you've re-opened another thread, when I replied.

You can read about processors in Lars Vogel's tutorial, google: vogella Eclipse 4 Modularity.
Re: How to add an ISaveHandler and IWindowCloseHandler to the Model [message #1060962 is a reply to message #1060961] Wed, 29 May 2013 10:28 Go to previous messageGo to next message
Uti Devel is currently offline Uti Devel
Messages: 7
Registered: May 2013
Junior Member
Thank you. I'll take a look at that tutorial Smile
Re: How to add an ISaveHandler and IWindowCloseHandler to the Model [message #1061157 is a reply to message #1060962] Thu, 30 May 2013 09:38 Go to previous messageGo to next message
Uti Devel is currently offline Uti Devel
Messages: 7
Registered: May 2013
Junior Member
Hi,

my problem persists. If i try to add the ISaveHandler or IWindowCloseHandler via Processor in an add on, i have the problem that the MWindow does not jet have a context. I get a null on MWindow.getcontext.

Using a Processor to change the context seems to early ?!?

Thanks Smile

Re: How to add an ISaveHandler and IWindowCloseHandler to the Model [message #1061167 is a reply to message #1061157] Thu, 30 May 2013 10:42 Go to previous message
Uti Devel is currently offline Uti Devel
Messages: 7
Registered: May 2013
Junior Member
----solved----


http://www.eclipse.org/forums/index.php/m/1061166/#msg_1061166
Previous Topic:installing e4 tools on Eclipse 4.3RC2a
Next Topic:Updating the application model in a batch
Goto Forum:
  


Current Time: Mon Sep 15 04:21:40 GMT 2014

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

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