Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Model Explorer view reload
Model Explorer view reload [message #1778644] Tue, 19 December 2017 10:02 Go to next message
Kyrill Zotkin is currently offline Kyrill ZotkinFriend
Messages: 21
Registered: July 2009
Junior Member
Hello!
I asked this question after video and were asked to put it from the email to public forum. Here it is.
Is this OK to reload the Model Explorer view like this: ProjectImpl notifies ResourceChangeListeners with
ResourceChangeAdapter and updates the UI in ECPProvider?
The use-case is to create the new project with EnterpriseDomainProvider ECPProvider, checking "Software Contribution", waiting making of "Contribution", opening a model element EPackage or children, editing and saving it.
Besides it doesn't reveal the already opened model element after reload. It looks like select and reveal code doesn't work after the structural update of TreeViewer.

[Updated on: Tue, 19 December 2017 16:52]

Report message to a moderator

Re: Model Explorer view reload [message #1778657 is a reply to message #1778644] Tue, 19 December 2017 12:00 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 144
Registered: May 2015
Senior Member
Hi Kyrill,

as far as I can see the code seems to be ok.
About the reveal not working I can't say anything conclusive, it would be helpful to have a minimal demo for this.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Model Explorer view reload [message #1778662 is a reply to message #1778657] Tue, 19 December 2017 15:11 Go to previous messageGo to next message
Kyrill Zotkin is currently offline Kyrill ZotkinFriend
Messages: 21
Registered: July 2009
Junior Member
Hi Eugen,

Thanks a lot, good.
In what form do you prefer me to provide a demo? Please, excuse if it is a newbie question.

Best regards,
Kirill

[Updated on: Tue, 19 December 2017 15:23]

Report message to a moderator

Re: Model Explorer view reload [message #1778697 is a reply to message #1778662] Wed, 20 December 2017 09:30 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 144
Registered: May 2015
Senior Member
Hi Kiril,

The best thing would be to have a plugin, similar to the autogenerated product example. So a plugin which contains:
- a target definition
- a product file
- the sample application
You can take a look at the MakeItHappen Example for 3x.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Model Explorer view reload [message #1781756 is a reply to message #1778697] Tue, 13 February 2018 04:20 Go to previous messageGo to next message
Kyrill Zotkin is currently offline Kyrill ZotkinFriend
Messages: 21
Registered: July 2009
Junior Member
I've created some demo with similar code. Here it is for selectReveal. Also I don't know how to set the correct condition in EContentAdapter for the first question so there are some bug here. Please, help me if its possible.

[Updated on: Tue, 13 February 2018 04:21]

Report message to a moderator

Re: Model Explorer view reload [message #1781994 is a reply to message #1781756] Thu, 15 February 2018 14:43 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 144
Registered: May 2015
Senior Member
Hi Kyrill,

so I checked you code.
The Main Issue is, that the getModelContext Method if your Demoprovider is not correctly implemented.
The case for en EObject must not get the eContainer but should retrieve the eResource directly, and instead of calling getModelContextFromAdapter you should call getModelContext .

So the Method should look like this:
@Override
public ECPContainer getModelContext(Object element) {
if (element instanceof Resource) {
final URI uri = ((Resource) element).getURI();
final String projectName = uri.segment(uri.segmentCount() - 2);
for (final InternalProject project : getOpenProjects()) {
if (project.getName().equals(projectName)) {
return project;
}
}
} else if (element instanceof EObject) {
return getModelContext(((EObject) element).eResource());
}
return super.getModelContext(element);
}


Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Model Explorer view reload [message #1782030 is a reply to message #1781994] Fri, 16 February 2018 09:40 Go to previous message
Kyrill Zotkin is currently offline Kyrill ZotkinFriend
Messages: 21
Registered: July 2009
Junior Member
Thanks, Eugen.
Now its working.
I've experienced several issues more, but... maybe next time.

Best regards,
Kirill
Previous Topic:[Edapt] Can't get values in Custom Migration
Next Topic:Generated *FactoryImpl is not an instance of Resource.Factory
Goto Forum:
  


Current Time: Sat Jul 21 23:13:31 GMT 2018

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

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

Back to the top