Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » ComparisonEditorInput vs. ComparisonScopeEditorInput(ComparisonEditorInput vs. ComparisonScopeEditorInput)
ComparisonEditorInput vs. ComparisonScopeEditorInput [message #1743919] Tue, 20 September 2016 15:40 Go to next message
Conor O'Mahony is currently offline Conor O'MahonyFriend
Messages: 27
Registered: August 2016
Junior Member
Hi,
By following the Developer Guide I can open the Compare UI, using either ComparisonScopeEditorInput or ComparisonEditorInput.

I also have a Configuration, where I set left and right editable properties to false
         EMFCompareConfiguration configuration = new EMFCompareConfiguration(new CompareConfiguration());
         configuration.setLeftEditable(false);
         configuration.setRightEditable(false);


When I use ComparisonEditorInput and a precomputed comparison, this works fine and the view launches with the merge buttons disabled.
      IComparisonScope scope = new DefaultComparisonScope(leftObject, rightObject, null);
      Comparison comparison = EMFCompare.builder().setMatchEngineFactoryRegistry(registry).build().compare(scope);
      AbstractEMFCompareEditorInput input = new ComparisonEditorInput(configuration, comparison, editingDomain, adapterFactory); 
      CompareUI.openCompareEditor(input);


However when I use ComparisonScopeEditorInput, with the same Configuration, and pass the EMF Compare object and scope to it, the merge buttons are not removed and remain visible
      IComparisonScope scope = new DefaultComparisonScope(leftObject, rightObject, null);
      EMFCompare compare = EMFCompare.builder().setMatchEngineFactoryRegistry(registry).build();
      AbstractEMFCompareEditorInput input = new ComparisonScopeEditorInput(configuration, editingDomain, adapterFactory, compare, scope); 
      CompareUI.openCompareEditor(input);


I presume this is not intended behaviour, or is there a problem with my usage of ComparisonScopeEditorInput? EMF Compare version is 3.2
Re: ComparisonEditorInput vs. ComparisonScopeEditorInput [message #1743967 is a reply to message #1743919] Wed, 21 September 2016 07:42 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1858
Registered: July 2009
Senior Member
Hi,

I cannot test this for now, but we seem to be properly using the compare configuration's "editable" state (see SaveComparisonModelAction.isEnabled()). My guess would be that we somehow change the configuration at one point to make it editable, but it indeed doesn't seem like the intended behavior. Please raise a bug on this (possibly with a test project to reproduce if you have a sample you can share).

Laurent Goubet
Obeo
Re: ComparisonEditorInput vs. ComparisonScopeEditorInput [message #1744003 is a reply to message #1743967] Wed, 21 September 2016 11:58 Go to previous messageGo to next message
Conor O'Mahony is currently offline Conor O'MahonyFriend
Messages: 27
Registered: August 2016
Junior Member
Hi Laurent,

You are right, I quickly debugged into this and it looks like the ComparisonScopeEditorInput in turn creates a ComparisonScopeInput object, which has its own isLeftEditable() and isRightEditable() methods that don't seem to use the Configuration object that was passed into ComparisonScopeEditorInput.

Where can I raise a bug?

Many thanks
Conor
Re: ComparisonEditorInput vs. ComparisonScopeEditorInput [message #1744178 is a reply to message #1744003] Fri, 23 September 2016 08:05 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1858
Registered: July 2009
Senior Member
Please raise it on the eclipse bugzilla with your findings.
Re: ComparisonEditorInput vs. ComparisonScopeEditorInput [message #1746686 is a reply to message #1744178] Thu, 03 November 2016 09:14 Go to previous messageGo to next message
Conor O'Mahony is currently offline Conor O'MahonyFriend
Messages: 27
Registered: August 2016
Junior Member
Thanks Laurent, I have raised the issue now https://bugs.eclipse.org/bugs/show_bug.cgi?id=506928
Re: ComparisonEditorInput vs. ComparisonScopeEditorInput [message #1746914 is a reply to message #1746686] Mon, 07 November 2016 16:11 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1858
Registered: July 2009
Senior Member
Thanks Conor, I will try and take a closer look, but doesn't sound like a hard fix. Have you tried tweaking the code to set the left and right editable states of the ComparisonScopeInput after creation to see if it fixed the issue?
Previous Topic:EMF Compare 3.3.0 is now released
Next Topic:Implementing own viewer for EMF Compare
Goto Forum:
  


Current Time: Sat Nov 17 02:54:10 GMT 2018

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

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

Back to the top