Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Using File oriented editors and package explorer in e4(Better stick to e3 API ?)
Using File oriented editors and package explorer in e4 [message #1727625] Thu, 24 March 2016 14:13 Go to next message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
Hello,

I was wondering: when reading tutorials on migration e3 -> e4, I never come across the discussion of a quite basic use case: the one were we register an Editor to open/edit/... a file which is opened/double clicked in the package explorer.

With Eclipse 3 API, this is very easily achieved by associating a file extension to a given type of Editor, the platform does the rest.

I suppose the answer to my question is that for the time being there is no (reasonably productive) way to achieve the same behavior with e4 API, but perhaps I somehow overlook something ... ?

Thanks for any input,

Thomas Elskens
Re: Using File oriented editors and package explorer in e4 [message #1727658 is a reply to message #1727625] Thu, 24 March 2016 20:39 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6568
Registered: July 2009
Senior Member
Hi,

e4 lacks the notion of (text)-editor framework. e(fx)clipse has core
infrastructure that can be used even in an SWT context.

I wrote a proof-of-concept for SWT some weeks ago -
https://github.com/BestSolution-at/code-swt

By default the framework will always open the same Text-Editor and
reconfigures it but you can contribute your own OSGi-Service to:
* reconfigure which Editor-Class is used (EditorClassURLProvider)
* reconfigure how the editor is opened from an e4 model point of
view (EditorOpenerTypeProvider)

I think the concepts we have are superior to the ones you see in e3 and
they are not a direct downport from the e3 APIs to work in e4 world -
they use the power of e4 DI and OSGi-Services to give you better code
reuseage, less framework dependency and many many other goodies.

Tom

On 24.03.16 15:13, Thomas Elskens wrote:
> Hello,
>
> I was wondering: when reading tutorials on migration e3 -> e4, I never
> come across the discussion of a quite basic use case: the one were we
> register an Editor to open/edit/... a file which is opened/double
> clicked in the package explorer.
> With Eclipse 3 API, this is very easily achieved by associating a file
> extension to a given type of Editor, the platform does the rest.
> I suppose the answer to my question is that for the time being there is
> no (reasonably productive) way to achieve the same behavior with e4 API,
> but perhaps I somehow overlook something ... ?
>
> Thanks for any input,
>
> Thomas Elskens
Re: Using File oriented editors and package explorer in e4 [message #1727696 is a reply to message #1727658] Fri, 25 March 2016 11:44 Go to previous message
Thomas Elskens is currently offline Thomas ElskensFriend
Messages: 159
Registered: September 2014
Location: Brussels - Belgium
Senior Member
Thanks a lot for the link, the code is very instructive.

Just to clarify : I did not mean I thought e3 API was better, but merely that in the current circonstances (where the default e3-behavior is satisfactory), it is very difficult for me to "sell" a migration from e3 API to e4 API, that was all.

Thomas
Previous Topic:E4LifeCycle.java created by Wizard has errors
Next Topic:E4 Preferences Dialog
Goto Forum:
  


Current Time: Tue Sep 29 21:05:18 GMT 2020

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

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

Back to the top