Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Compare] Set the OPTION_IGNORE_ID upon startup?
[Compare] Set the OPTION_IGNORE_ID upon startup? [message #128757] Tue, 19 August 2008 09:07 Go to next message
Henrik  önsson is currently offline Henrik önssonFriend
Messages: 53
Registered: July 2009
Member
Hi,

Is it possible to set the OPTION_IGNORE_ID via an extension point or
something else?
I like to embed EMF Compare in my RCP application and use the compare UI.

Regards

Henrik
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #128771 is a reply to message #128757] Tue, 19 August 2008 10:07 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1881
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020104090201020404070601
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Henrik,

I have never tried something like this, and know I haven't implemented
anything of the sort :).

You can try something like :
EMFCompareUIPlugin.getDefault().getPluginPreferences().setVa lue(EMFComparePreferenceKeys.PREFERENCE_KEY_IGNORE_ID,
true);

But I do not know if this can work since the "default" value for this
preference is set to false by EMF Compare.

Regards,
Laurent Goubet
obeo

Henrik J
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #128784 is a reply to message #128771] Tue, 19 August 2008 11:05 Go to previous messageGo to next message
Henrik  önsson is currently offline Henrik önssonFriend
Messages: 53
Registered: July 2009
Member
laurent Goubet wrote:

> You can try something like :
EMFCompareUIPlugin.getDefault().getPluginPreferences().setVa lue(EMFComparePreferenceKeys.PREFERENCE_KEY_IGNORE_ID,
true);

Yes, I tried that. But it does not seem to work as you said. Is it
possible to create a extension point to set these default values?

Regards

Henrik
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #128792 is a reply to message #128784] Tue, 19 August 2008 12:22 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1881
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090908070206090906020200
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

No, providing an extension point to set _default_ values seems overkill.
What exactly is the need behind this? I could change the
GenericMatchEngine to allow preferences overriding if this could solve
the issue.

Laurent Goubet
Obeo

Henrik J
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #128805 is a reply to message #128792] Tue, 19 August 2008 13:09 Go to previous messageGo to next message
Henrik  önsson is currently offline Henrik önssonFriend
Messages: 53
Registered: July 2009
Member
laurent Goubet wrote:

> No, providing an extension point to set _default_ values seems overkill.
> What exactly is the need behind this?

My users are signalling engineers, not programmers. When my RCP product
starts I want to set the OPTION_IGNORE_ID to true so that they can compare
our models files directly in the UI. I don't want them to first go into
Window->Preferences->EMF Compare and change a setting they don't
understand. They want to compare model files fast and easily.

> I could change the GenericMatchEngine to allow preferences overriding if
> this could solve the issue.

Yes, that might be an good option.

Regards

Henrik
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #128818 is a reply to message #128805] Tue, 19 August 2008 13:25 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1881
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050602010303070807060906
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

henrik,

Could you raise a bugzilla entry for this preference issue? It will
require an API change and won't find its way into the 0.8 version. ATM,
a workaround would be to define your own match engine (extension point
org.eclipse.emf.compare.match.engine) for the file extensions you need
(or * with priority set higher than "lowest" if you need this for all
comparisons) and override the option map :

public class SpecificMatchEngine extends GenericMatchEngine {
public MatchModel resourceMatch(Resource leftResource, Resource
rightResource, Map<String, Object> optionMap) throws InterruptedException {
optionMap.put(EMFComparePreferenceKeys.PREFERENCE_KEY_IGNORE _ID, true);
super.resourceMatch(leftResource, rightResource, optionMap);
}

public MatchModel resourceMatch(Resource leftResource, Resource
rightResource, Resource ancestorResource, Map<String, Object> optionMap)
throws InterruptedException {
optionMap.put(EMFComparePreferenceKeys.PREFERENCE_KEY_IGNORE _ID, true);
super.resourceMatch(leftResource, rightResource, ancestorResource,
optionMap);
}
}

Regards,

Laurent Goubet
Obeo

Henrik J
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #620239 is a reply to message #128757] Tue, 19 August 2008 10:07 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1881
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020104090201020404070601
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Henrik,

I have never tried something like this, and know I haven't implemented
anything of the sort :).

You can try something like :
EMFCompareUIPlugin.getDefault().getPluginPreferences().setVa lue(EMFComparePreferenceKeys.PREFERENCE_KEY_IGNORE_ID,
true);

But I do not know if this can work since the "default" value for this
preference is set to false by EMF Compare.

Regards,
Laurent Goubet
obeo

Henrik J
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #620240 is a reply to message #128771] Tue, 19 August 2008 11:05 Go to previous message
Henrik  önsson is currently offline Henrik önssonFriend
Messages: 53
Registered: July 2009
Member
laurent Goubet wrote:

> You can try something like :
EMFCompareUIPlugin.getDefault().getPluginPreferences().setVa lue(EMFComparePreferenceKeys.PREFERENCE_KEY_IGNORE_ID,
true);

Yes, I tried that. But it does not seem to work as you said. Is it
possible to create a extension point to set these default values?

Regards

Henrik
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #620241 is a reply to message #128784] Tue, 19 August 2008 12:22 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1881
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090908070206090906020200
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

No, providing an extension point to set _default_ values seems overkill.
What exactly is the need behind this? I could change the
GenericMatchEngine to allow preferences overriding if this could solve
the issue.

Laurent Goubet
Obeo

Henrik J
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #620242 is a reply to message #128792] Tue, 19 August 2008 13:09 Go to previous message
Henrik  önsson is currently offline Henrik önssonFriend
Messages: 53
Registered: July 2009
Member
laurent Goubet wrote:

> No, providing an extension point to set _default_ values seems overkill.
> What exactly is the need behind this?

My users are signalling engineers, not programmers. When my RCP product
starts I want to set the OPTION_IGNORE_ID to true so that they can compare
our models files directly in the UI. I don't want them to first go into
Window->Preferences->EMF Compare and change a setting they don't
understand. They want to compare model files fast and easily.

> I could change the GenericMatchEngine to allow preferences overriding if
> this could solve the issue.

Yes, that might be an good option.

Regards

Henrik
Re: [Compare] Set the OPTION_IGNORE_ID upon startup? [message #620243 is a reply to message #128805] Tue, 19 August 2008 13:25 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1881
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050602010303070807060906
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

henrik,

Could you raise a bugzilla entry for this preference issue? It will
require an API change and won't find its way into the 0.8 version. ATM,
a workaround would be to define your own match engine (extension point
org.eclipse.emf.compare.match.engine) for the file extensions you need
(or * with priority set higher than "lowest" if you need this for all
comparisons) and override the option map :

public class SpecificMatchEngine extends GenericMatchEngine {
public MatchModel resourceMatch(Resource leftResource, Resource
rightResource, Map<String, Object> optionMap) throws InterruptedException {
optionMap.put(EMFComparePreferenceKeys.PREFERENCE_KEY_IGNORE _ID, true);
super.resourceMatch(leftResource, rightResource, optionMap);
}

public MatchModel resourceMatch(Resource leftResource, Resource
rightResource, Resource ancestorResource, Map<String, Object> optionMap)
throws InterruptedException {
optionMap.put(EMFComparePreferenceKeys.PREFERENCE_KEY_IGNORE _ID, true);
super.resourceMatch(leftResource, rightResource, ancestorResource,
optionMap);
}
}

Regards,

Laurent Goubet
Obeo

Henrik J
Previous Topic:[Compare] Set the OPTION_IGNORE_ID upon startup?
Next Topic:EMF search returns duplicate results
Goto Forum:
  


Current Time: Thu Apr 09 21:19:34 GMT 2020

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

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

Back to the top