Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Neon: perspective from fragment.e4xmi not loaded
Neon: perspective from fragment.e4xmi not loaded [message #1739121] Wed, 27 July 2016 15:33 Go to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi,

I am having an fragment.e4xmi defining a perspective which is fine with
Mars but does not load in Neon.
My product is based on application "org.eclipse.ui.ide.workbench".

I created a simple fragment.e4xmi to reproduce the issue.

fragment.e4xmi
<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0" 
xmlns:xmi="http://www.omg.org/XMI" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/descriptor/basic" 
xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" 
xmi:id="_BxaXACerEeWxCPrV0pAZQQ">
   <fragments xsi:type="fragment:StringModelFragment" 
xmi:id="_EI7oACerEeWxCPrV0pAZQQ" featurename="descriptors" 
parentElementId="xpath:/">
     <elements xsi:type="basic:PartDescriptor" 
xmi:id="_KMklcCerEeWxCPrV0pAZQQ" 
elementId="test.partDescFragment.ASampleE4View" label="Sample View" 
iconURI="platform:/plugin/test/icons/Sample.png" tooltip="" 
category="Sample Category" 
contributionURI="bundleclass://test/cwqc.parts.SampleView">
       <tags>View</tags>
       <tags>categoryTag:Sample Category</tags>
     </elements>
   </fragments>
</fragment:ModelFragments>


The console gives the error message:

!ENTRY org.eclipse.e4.ui.workbench 4 0 2016-07-27 17:29:34.523
!MESSAGE Fragment from "uri.toString()" of "de.bahntechnik.dd.opn.ui"
could not be validated and was not merged
"org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl@65859b44
(featurename: snippets, parentElementId: xpath:/, positionInList: )"


Does any one have an idea where to look for and how to solve the issue?

Martin
Re: Neon: perspective from fragment.e4xmi not loaded [message #1739183 is a reply to message #1739121] Thu, 28 July 2016 07:30 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
ups, I copied the wrong fragment.e4xmi

[code]
<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced"
xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic"
xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment"
xmi:id="_y6D_YLoOEeGpCLi1m273mw">
<fragments xsi:type="fragment:StringModelFragment"
xmi:id="_18RMILoOEeGpCLi1m273mw" featurename="snippets"
parentElementId="org.eclipse.e4.legacy.ide.application">
<elements xsi:type="advanced:Perspective"
xmi:id="_eQFFIFP4EeaszJGFnlBYaQ"
elementId="de.bahntechnik.dd.opn.ui.perspective.testxxx"
selectedElement="_m6WGkFP4EeaszJGFnlBYaQ" label="Test XXX"
iconURI="platform:/plugin/de.bahntechnik.dd.opn.ui/icons/obj16/OPN_16x16.png">
<children xsi:type="basic:PartSashContainer"
xmi:id="_m6WGkFP4EeaszJGFnlBYaQ"
elementId="de.bahntechnik.dd.opn.ui.partsashcontainer.1">
<children xsi:type="basic:PartSashContainer"
xmi:id="_nrLGkFP4EeaszJGFnlBYaQ"
elementId="de.bahntechnik.dd.opn.ui.partsashcontainer.2">
<children xsi:type="advanced:Placeholder"
xmi:id="_uQGzMFP4EeaszJGFnlBYaQ"
elementId="org.eclipse.ui.navigator.ProjectExplorer"/>
</children>
</children>
</elements>
</fragments>
</fragment:ModelFragments>
[code/]

Am 27.07.2016 um 17:33 schrieb Martin Jacob:
> Hi,
>
> I am having an fragment.e4xmi defining a perspective which is fine with
> Mars but does not load in Neon.
> My product is based on application "org.eclipse.ui.ide.workbench".
>
> I created a simple fragment.e4xmi to reproduce the issue.
>
> fragment.e4xmi
>
> <?xml version="1.0" encoding="ASCII"?>
> <fragment:ModelFragments xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/descriptor/basic"
> xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment"
> xmi:id="_BxaXACerEeWxCPrV0pAZQQ">
>   <fragments xsi:type="fragment:StringModelFragment"
> xmi:id="_EI7oACerEeWxCPrV0pAZQQ" featurename="descriptors"
> parentElementId="xpath:/">
>     <elements xsi:type="basic:PartDescriptor"
> xmi:id="_KMklcCerEeWxCPrV0pAZQQ"
> elementId="test.partDescFragment.ASampleE4View" label="Sample View"
> iconURI="platform:/plugin/test/icons/Sample.png" tooltip=""
> category="Sample Category"
> contributionURI="bundleclass://test/cwqc.parts.SampleView">
>       <tags>View</tags>
>       <tags>categoryTag:Sample Category</tags>
>     </elements>
>   </fragments>
> </fragment:ModelFragments>
> 

>
> The console gives the error message:
>
> !ENTRY org.eclipse.e4.ui.workbench 4 0 2016-07-27 17:29:34.523
> !MESSAGE Fragment from "uri.toString()" of "de.bahntechnik.dd.opn.ui"
> could not be validated and was not merged
> "org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl@65859b44
> (featurename: snippets, parentElementId: xpath:/, positionInList: )"
>
>
> Does any one have an idea where to look for and how to solve the issue?
>
> Martin
Re: Neon: perspective from fragment.e4xmi not loaded [message #1739184 is a reply to message #1739183] Thu, 28 July 2016 07:34 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6644
Registered: July 2009
Senior Member
Yeah someone added Diagnostics stuff but the error message is total
senseless. You should put a break point in the ResourceLoader where the
merging happens and take a look at the real diagnostics object generated.

Tom

On 28.07.16 09:30, Martin Jacob wrote:
> ups, I copied the wrong fragment.e4xmi
>
> [code]
> <?xml version="1.0" encoding="ASCII"?>
> <fragment:ModelFragments xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced"
> xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment"
> xmi:id="_y6D_YLoOEeGpCLi1m273mw">
> <fragments xsi:type="fragment:StringModelFragment"
> xmi:id="_18RMILoOEeGpCLi1m273mw" featurename="snippets"
> parentElementId="org.eclipse.e4.legacy.ide.application">
> <elements xsi:type="advanced:Perspective"
> xmi:id="_eQFFIFP4EeaszJGFnlBYaQ"
> elementId="de.bahntechnik.dd.opn.ui.perspective.testxxx"
> selectedElement="_m6WGkFP4EeaszJGFnlBYaQ" label="Test XXX"
> iconURI="platform:/plugin/de.bahntechnik.dd.opn.ui/icons/obj16/OPN_16x16.png">
>
> <children xsi:type="basic:PartSashContainer"
> xmi:id="_m6WGkFP4EeaszJGFnlBYaQ"
> elementId="de.bahntechnik.dd.opn.ui.partsashcontainer.1">
> <children xsi:type="basic:PartSashContainer"
> xmi:id="_nrLGkFP4EeaszJGFnlBYaQ"
> elementId="de.bahntechnik.dd.opn.ui.partsashcontainer.2">
> <children xsi:type="advanced:Placeholder"
> xmi:id="_uQGzMFP4EeaszJGFnlBYaQ"
> elementId="org.eclipse.ui.navigator.ProjectExplorer"/>
> </children>
> </children>
> </elements>
> </fragments>
> </fragment:ModelFragments>
> [code/]
>
> Am 27.07.2016 um 17:33 schrieb Martin Jacob:
>> Hi,
>>
>> I am having an fragment.e4xmi defining a perspective which is fine with
>> Mars but does not load in Neon.
>> My product is based on application "org.eclipse.ui.ide.workbench".
>>
>> I created a simple fragment.e4xmi to reproduce the issue.
>>
>> fragment.e4xmi
>>
>> <?xml version="1.0" encoding="ASCII"?>
>> <fragment:ModelFragments xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/descriptor/basic"
>>
>> xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment"
>> xmi:id="_BxaXACerEeWxCPrV0pAZQQ">
>>   <fragments xsi:type="fragment:StringModelFragment"
>> xmi:id="_EI7oACerEeWxCPrV0pAZQQ" featurename="descriptors"
>> parentElementId="xpath:/">
>>     <elements xsi:type="basic:PartDescriptor"
>> xmi:id="_KMklcCerEeWxCPrV0pAZQQ"
>> elementId="test.partDescFragment.ASampleE4View" label="Sample View"
>> iconURI="platform:/plugin/test/icons/Sample.png" tooltip=""
>> category="Sample Category"
>> contributionURI="bundleclass://test/cwqc.parts.SampleView">
>>       <tags>View</tags>
>>       <tags>categoryTag:Sample Category</tags>
>>     </elements>
>>   </fragments>
>> </fragment:ModelFragments>
>> 

>>
>> The console gives the error message:
>>
>> !ENTRY org.eclipse.e4.ui.workbench 4 0 2016-07-27 17:29:34.523
>> !MESSAGE Fragment from "uri.toString()" of "de.bahntechnik.dd.opn.ui"
>> could not be validated and was not merged
>> "org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl@65859b44
>> (featurename: snippets, parentElementId: xpath:/, positionInList: )"
>>
>>
>> Does any one have an idea where to look for and how to solve the issue?
>>
>> Martin
Re: Neon: perspective from fragment.e4xmi not loaded [message #1739193 is a reply to message #1739184] Thu, 28 July 2016 08:46 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Thanks Tom,
could you point me a bit closer where to find this ResourceLoader?
Martin
Re: Neon: perspective from fragment.e4xmi not loaded [message #1739196 is a reply to message #1739193] Thu, 28 July 2016 08:57 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6644
Registered: July 2009
Senior Member
Meant "org.eclipse.e4.ui.internal.workbench.ModelAssembler"

Tom

On 28.07.16 10:46, Martin Jacob wrote:
> Thanks Tom,
> could you point me a bit closer where to find this ResourceLoader?
> Martin
Re: Neon: perspective from fragment.e4xmi not loaded [message #1739197 is a reply to message #1739193] Thu, 28 July 2016 09:10 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
OK found it.

org.eclipse.e4.ui.internal.workbench.ModelAssembler


the validation there returns

Diagnostic ERROR source=org.eclipse.emf.ecore code=0 Diagnosis of 
org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl@7272ee51{platform:/plugin/de.bahntechnik.dd.opn.ui/fragment.e4xmi#_18RMILoOEeGpCLi1m273mw} 
data=[org.eclipse.e4.ui.model.fragment.impl.StringModelFragmentImpl@7272ee51 
(featurename: snippets, parentElementId: 
org.eclipse.e4.legacy.ide.application, positionInList: null)] 
[Diagnostic ERROR source=org.eclipse.emf.ecore code=1 The required 
feature 'ref' of 
'org.eclipse.e4.ui.model.application.ui.advanced.impl.PlaceholderImpl@795f6681{platform:/plugin/de.bahntechnik.dd.opn.ui/fragment.e4xmi#_uQGzMFP4EeaszJGFnlBYaQ}' 
must be set 
data=[org.eclipse.e4.ui.model.application.ui.advanced.impl.PlaceholderImpl@795f6681 
(elementId: org.eclipse.ui.navigator.ProjectExplorer, tags: null, 
contributorURI: null) (widget: null, renderer: null, toBeRendered: true, 
onTop: false, visible: true, containerData: null, accessibilityPhrase: 
null) (closeable: false), 
org.eclipse.emf.ecore.impl.EReferenceImpl@5b8572df (name: ref) (ordered: 
true, unique: true, lowerBound: 1, upperBound: 1) (changeable: true, 
volatile: false, transient: false, defaultValueLiteral: null, 
unsettable: false, derived: false) (containment: false, resolveProxies: 
true)]]


so its a missing attribute of the Placeholder ....
Re: Neon: perspective from fragment.e4xmi not loaded [message #1739199 is a reply to message #1739197] Thu, 28 July 2016 09:44 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Since I know the reference is missing I am searching how to add define
some thing to be able to reference.
I add an import but this does not work. I read about sharedElements but
this seams only possible for Application.e4xmi. In my case I am using
fragment.e4xmi.
Is there an equivalent of sharedElements in fragment.e4xmi?
Re: Neon: perspective from fragment.e4xmi not loaded [message #1739210 is a reply to message #1739199] Thu, 28 July 2016 10:50 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6644
Registered: July 2009
Senior Member
The problem in this case is the fragment editor because it only searches
in the sharedElement-Section.

What needs to be done is:
a) you create the import (which you've done)
b) you open the XMI-File in a text-Editor and add the ref attribute
there content is the xmi:id of the imported element

This will hopefully provide you the desired result.

Tom

On 28.07.16 11:44, Martin Jacob wrote:
> Since I know the reference is missing I am searching how to add define
> some thing to be able to reference.
> I add an import but this does not work. I read about sharedElements but
> this seams only possible for Application.e4xmi. In my case I am using
> fragment.e4xmi.
> Is there an equivalent of sharedElements in fragment.e4xmi?
Re: Neon: perspective from fragment.e4xmi not loaded [message #1739212 is a reply to message #1739210] Thu, 28 July 2016 11:19 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
I have done so and I could use the e4xmi editor.

<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0" 
xmlns:xmi="http://www.omg.org/XMI" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" 
xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" 
xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" 
xmi:id="_y6D_YLoOEeGpCLi1m273mw">
   <imports xsi:type="basic:Part" xmi:id="_gLue8FSnEeacy4vmBL0tEQ" 
elementId="org.eclipse.ui.navigator.ProjectExplorer"/>
   <fragments xsi:type="fragment:StringModelFragment" 
xmi:id="_18RMILoOEeGpCLi1m273mw" featurename="snippets" 
parentElementId="org.eclipse.e4.legacy.ide.application">
     <elements xsi:type="advanced:Perspective" 
xmi:id="_eQFFIFP4EeaszJGFnlBYaQ" 
elementId="de.bahntechnik.dd.opn.ui.perspective.testxxx" 
selectedElement="_m6WGkFP4EeaszJGFnlBYaQ" label="Test XXX" 
iconURI="platform:/plugin/de.bahntechnik.dd.opn.ui/icons/obj16/OPN_16x16.png">
       <children xsi:type="basic:PartSashContainer" 
xmi:id="_m6WGkFP4EeaszJGFnlBYaQ" 
elementId="de.bahntechnik.dd.opn.ui.partsashcontainer.1">
         <children xsi:type="basic:PartSashContainer" 
xmi:id="_nrLGkFP4EeaszJGFnlBYaQ" 
elementId="de.bahntechnik.dd.opn.ui.partsashcontainer.2">
           <children xsi:type="advanced:Placeholder" 
xmi:id="_uQGzMFP4EeaszJGFnlBYaQ" 
elementId="org.eclipse.ui.navigator.ProjectExplorer" 
ref="_gLue8FSnEeacy4vmBL0tEQ"/>
         </children>
       </children>
     </elements>
   </fragments>
</fragment:ModelFragments>



But unfortunately when I switch to this perspective a StackOverflow
error occurs.
.....
	at 
org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findElementsRecursive(ModelServiceImpl.java:287)
	at 
org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findElementsRecursive(ModelServiceImpl.java:287)
	at 
org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findElementsRecursive(ModelServiceImpl.java:287)
	at 
org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findElementsRecursive(ModelServiceImpl.java:287)
	at 
org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findElementsRecursive(ModelServiceImpl.java:287)
	at 
org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findElementsRecursive(ModelServiceImpl.java:287)
	at 
org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.findElementsRecursive(ModelServiceImpl.java:287)



May be I need to define another import instead of importing "Part"?

Martin
Re: Neon: perspective from fragment.e4xmi not loaded [message #1739216 is a reply to message #1739212] Thu, 28 July 2016 12:07 Go to previous message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Instead of import an second model fragment need to be added. The
fragment parentElementId="IDEWindow" is the TrimmedWindow ID of the
application.
The feature is featurename="sharedElements" with a Part using
elementId="org.eclipse.ui.navigator.ProjectExplorer".

Don't forget to set the Class URI
(contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView")



<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0" 
xmlns:xmi="http://www.omg.org/XMI" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" 
xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" 
xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" 
xmi:id="_y6D_YLoOEeGpCLi1m273mw">
   <fragments xsi:type="fragment:StringModelFragment" 
xmi:id="_18RMILoOEeGpCLi1m273mw" featurename="snippets" 
parentElementId="org.eclipse.e4.legacy.ide.application">
     <elements xsi:type="advanced:Perspective" 
xmi:id="_eQFFIFP4EeaszJGFnlBYaQ" 
elementId="de.bahntechnik.dd.opn.ui.perspective.testxxx" 
selectedElement="_m6WGkFP4EeaszJGFnlBYaQ" label="Test XXX" 
iconURI="platform:/plugin/de.bahntechnik.dd.opn.ui/icons/obj16/OPN_16x16.png">
       <children xsi:type="basic:PartSashContainer" 
xmi:id="_m6WGkFP4EeaszJGFnlBYaQ" 
elementId="de.bahntechnik.dd.opn.ui.partsashcontainer.1">
         <children xsi:type="basic:PartSashContainer" 
xmi:id="_nrLGkFP4EeaszJGFnlBYaQ" 
elementId="de.bahntechnik.dd.opn.ui.partsashcontainer.2">
           <children xsi:type="advanced:Placeholder" 
xmi:id="_uQGzMFP4EeaszJGFnlBYaQ" 
elementId="org.eclipse.ui.navigator.ProjectExplorer" 
ref="_VdntwFS4Eeacy4vmBL0tEQ"/>
         </children>
       </children>
     </elements>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" 
xmi:id="_HSMw4FS4Eeacy4vmBL0tEQ" featurename="sharedElements" 
parentElementId="IDEWindow">
     <elements xsi:type="basic:Part" xmi:id="_VdntwFS4Eeacy4vmBL0tEQ" 
elementId="org.eclipse.ui.navigator.ProjectExplorer" 
contributionURI="bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView"/>
   </fragments>
</fragment:ModelFragments>
Previous Topic:Eclipse Neon - cannot create a PyDev remote project
Next Topic:Add menu to scrolled Form Toolbar
Goto Forum:
  


Current Time: Mon Aug 15 10:00:24 GMT 2022

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

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

Back to the top