Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Disable model resolver for certain file type(Avoid unnecessary loading of resources, if model is completely contained in one file)
Disable model resolver for certain file type [message #1779733] Thu, 11 January 2018 21:48 Go to next message
Janik S is currently offline Janik SFriend
Messages: 12
Registered: November 2017
Junior Member
Hey guys,

is there an easy way to disable the model resolver for a certain filetype? My model is self-contained in one file, so it is not necessary to load all sibling files of the same type to build up a dependency tree.

I know that the resolution can be globally disabled via a workspace setting, but it would be nice, if I could tell emf compare as a developer that my model does not have external dependencies.

If I see it correctly, one possible approach would be:

1. Register own model resolver extending ThreadedModelResolver (which is not recommended)
2. Extend DefaultResolutionContext with custom ResourceDependencyLocalResolver
3. Override getResolutionStartingPoint and return the file itself, if I encounter a file with my file extension

Is there an easier way to do that?

Thanks
Janik
Re: Disable model resolver for certain file type [message #1779975 is a reply to message #1779733] Tue, 16 January 2018 09:40 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hello Janik,

If you're using EMF Compare programmatically, you can manually set the resolution scope preference to "SELF" :
final IPreferenceStore store = EMFCompareIDEUIPlugin.getDefault().getPreferenceStore();
store.setValue(EMFCompareUIPreferences.RESOLUTION_SCOPE_PREFERENCE, CrossReferenceResolutionScope.SELF.toString());


Since this will globally affect the preferences, you might want to store the previous value of the preference and reset it after your comparison.

If you're not using EMF Compare programmatically, you will indeed have to override the model resolver since we didn't provide a mean to disable it on a model-per-model basis.

Laurent Goubet
Obeo
Re: Disable model resolver for certain file type [message #1781359 is a reply to message #1779975] Tue, 06 February 2018 12:14 Go to previous message
Janik S is currently offline Janik SFriend
Messages: 12
Registered: November 2017
Junior Member
Hey Laurent,

thanks for the answer and sorry for the late response. I decided to postpone a solution for this problem, as in our case a project typically only contains one model. Just in my manual test setup with many different models in one project it appeared as some performance issue. If it is possible, the resolution of side-band files could be triggered lazier (only if needed) in future.

Thanks
Previous Topic:EMF compare does not work?
Next Topic:Performance of EMF compare
Goto Forum:
  


Current Time: Sat Apr 20 00:25:25 GMT 2024

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

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

Back to the top