Feature request [message #905220] |
Wed, 29 August 2012 20:16  |
Eclipse User |
|
|
|
E4 contains cool concept - MPartDescriptor. It allow to describe the parts one time and in one place, without runtime-configuring code. But the advantages that give this concept is not realized in full.
Carefully 3 month before Juno relise I begin work on my Eclipse Workbench equivelent (UWorkbench). I didn't know e4, I have know about it only after Juno relise. Now this project utilized, becouse it is not needed when e4 is coming. I have mentioned it becouse want to say how working with content was implemented in UWorkbench.
First, I want to say, that the UWorkbench model is very, very similar to e4 (despite the fact that I did not know about e4 when develop it). It contains shared elements and it contains MPartDescriptor equivalent. It's called ComponentType, which is template for one type components. And there are yet one model element - ContentType. This element contains two things:
1. reference to concrete ComponentType (MPartDescriptor in e4 case)
2. content filter - the custom rule that takes the content descriptor (Input URI in e4 case) and return true if the given content descriptor relates to this ContentType and false otherwise.
So, using the ContentType we bind the concrete content (definging by content descriptor) to concrete ComponentType. In other words, it analog to file assotiation in OS with difference only that the content descriptor is more generic and abstract concept then file. Now, we can do things such:
1. Open the given content in appropriate editor.
2. Implement Open With command
3. Check when opening givent content - is there this content was opened in given editor and if was opened, then simple switch to it without opening the new instance of MPart.
We only do:
partSerice.openContent("some_content_uri")
to open the "some_content_uri" by default editor (that set in ContentType of this content)
Or:
partSerice.openContent("some_content_uri", partDescriptor)
to open the "some_content_uri" with the given partDescriptor.
If the "some_content_uri" is ipened already in partDescriptor, the method simple activate the part, containing "some_content_uri". Else it will create the new instance of part and load to it the "some_content_uri".
This feature can be implement in different way. Not necessary do as in UWorkbench - by defining the ContentType object. It is possible forexample to provide interface that map the input uri to MPartDescriptor:
interface ContentAssociation {
MPartDescriptor getDescriptor(String inputURI);
}
and then
partSerice.setContentAssociation(contentAssociation);
[Updated on: Wed, 29 August 2012 20:18] by Moderator
|
|
|
Re: Feature request [message #905325 is a reply to message #905220] |
Thu, 30 August 2012 03:08   |
Eclipse User |
|
|
|
If I get that right what you describe here is the concept of editors
which I'll be working on in 4.3 (I've not yet started).
Tom
Am 30.08.12 02:16, schrieb Rushan Gilmullin:
> E4 contains cool concept - MPartDescriptor. It allow to describe the
> parts one time and in one place, without runtime-configuring code. But
> the advantage that give this concept is not realized in full.
>
> Carefully 3 month before Juno relise I begin work on my Eclipse
> Workbench equivelent (UWorkbench). I didn't know e4, I have know about
> it only after Juno relise. Now this project utilized, becouse it is not
> needed when e4 is coming. I have mentioned it becouse want to say how
> work with content was implemented in UWorkbench.
>
> First, I want to say, that the UWorkbench model is very, very similar to
> e4 (despite the fact that I did not know about e4 when develop it). It
> contains shared elements and it contains MPartDescriptor equivalent.
> It's called ComponentType, which is template for one type components.
> And there are yet one model element - ContentType. This element contains
> two things:
> 1. reference to concrete ComponentType (MPartDescriptor in e4 case)
> 2. content filter - the custom rule that takes the content descriptor
> (Input URI in e4 case) and return true if the given content descriptor
> relates to this ContentType and false otherwise.
>
> So, using the ContentType we bind the concrete content (definging by
> content descriptor) to concrete ComponentType. In other words, it analog
> to file assotiation in OS with difference only that the content
> descriptor is more generic and abstract concept then file. Now, we can
> do things such:
>
> 1. Open the given content in appropriate editor.
> 2. Implement Open With command
> 3. Check when opening givent content - is there this content was opened
> in given editor and if was opened, then simple switch to it without
> opening the new instance of MPart.
>
> We only do: partSerice.openContent("some_content_uri")
> to open the "some_content_uri" by default editor (that set in
> ContentType of this content)
>
> Or:
> partSerice.openContent("some_content_uri", partDescriptor)
> to open the "some_content_uri" with the given partDescriptor.
>
> If the "some_content_uri" is ipened already in partDescriptor, the
> method simple activate the part, containing "some_content_uri". Else it
> will create the new instance of part and load to it the "some_content_uri".
>
> This feature can be implement in different way. Not necessary do as in
> UWorkbench - by defining the ContentType object. It is possible
> forexample to provide interface that map the input uri to MPartDescriptor:
>
> interface ContentAssociation {
> MPartDescriptor getDescriptor(String inputURI);
> }
>
> and then
>
> partSerice.setContentAssociation(contentAssociation);
>
>
|
|
|
|
|
|
Re: Feature request [message #1786567 is a reply to message #909198] |
Mon, 07 May 2018 08:32  |
Eclipse User |
|
|
|
Hi all,
was there any outcome on the editor proposal.
I ve just started to migrate en 3.x editor to E4 and i'm wondering how to set the contenttype association for the workbench .
thanks,
thomas
|
|
|
Powered by
FUDForum. Page generated in 0.03594 seconds