Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to implement Save As for our Part.(How to implement Save As for our Part.)
How to implement Save As for our Part. [message #1151184] Wed, 23 October 2013 03:19 Go to next message
sumit singh is currently offline sumit singh
Messages: 129
Registered: October 2012
Location: Bangalore
Senior Member

Hi *,

I'm creating E4 RCP application in that I have one part. I want to implement "Save As" functionality for my Part As it is implemented for Editors (Like:Java file Editor).


Requirements:
1. When user click on my part "Save As" option should be enable.
2. When user click on "Save As" option my code should run so that I can do what I want.


So my question is for this what should I do, is I have to implement any extension point or any this else. ?

Thanks & regards,
Sumit Singh
Re: How to implement Save As for our Part. [message #1180197 is a reply to message #1151184] Sun, 10 November 2013 16:13 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 596
Registered: December 2010
Senior Member

You can accomplish both using a simple e4 handler. Implement the @CanExecute and @Execute (you can have your MPart injected there) well and that's all you need.
Re: How to implement Save As for our Part. [message #1180902 is a reply to message #1180197] Mon, 11 November 2013 03:29 Go to previous messageGo to next message
sumit singh is currently offline sumit singh
Messages: 129
Registered: October 2012
Location: Bangalore
Senior Member

@Sopot Cela Hi,

Yes I know this approach, But I want it to be as in Eclipse, Because if i'll implement it then it will not work for other other source file let say for java script,

Because In my RCP i also have JavaScript perspective.
Re: How to implement Save As for our Part. [message #1181230 is a reply to message #1180902] Mon, 11 November 2013 08:15 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 596
Registered: December 2010
Senior Member

What do you mean 'will not work for other source file'? The Save as ... is the same for both cases. Just dump the contents of the editor into a disk file. Also if you have Eclipse editors yours is likely not a pure Eclipse 4 RCP application. If you're doing a mix of 3.x and 4.x things are different.
Re: How to implement Save As for our Part. [message #1182338 is a reply to message #1181230] Tue, 12 November 2013 00:51 Go to previous message
sumit singh is currently offline sumit singh
Messages: 129
Registered: October 2012
Location: Bangalore
Senior Member

Exactly I'm mixing 3.x and 4.x. Because by default there is no support for SaveAs in Eclipse 4.x.

So I'm asking if there is any way so that i can use 3.x SaveAs implementation for My E4 part..?
Previous Topic:bundle javax.annotation not updated
Next Topic:DI Injection for Handlers
Goto Forum:
  


Current Time: Thu Jul 31 09:47:59 EDT 2014

Powered by FUDForum. Page generated in 0.01679 seconds