Skip to main content



      Home
Home » Modeling » Compare » CompareEditorInput(how to compare 2 string)
CompareEditorInput [message #1065658] Thu, 27 June 2013 00:00 Go to next message
Eclipse UserFriend
I am trying to compare two text (read from a file, perform some manipulation on the text without saving it. so I store the text in two String). now I extend the compareeditorinput

-------------------------------------------------------------------
public class MyCompare extends CompareEditorInput {

private DiffNode diffNode;
private String text1;
private String text2;

public MyCompare (CompareConfiguration configuraion, String orig, String current) {
super(configuraion);

text1=orig;
text2=current;

}

@Override
protected Object prepareInput(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
// TODO Auto-generated method stub

CompareItem left = new CompareItem(text1);
CompareItem right = new CompareItem(text2);


diffNode= new DiffNode(left, right);
return diffNode;
}

----------------------------------------

when I call
CompareUI.openCompareDialog(new MyCompare(configuration, ((MyEditor) editorPart).originalText(), ((MyEditor) editorPart).currentConverted()) );

to show the difference, it shows the difference line by line. ie

line1 test_line
line2 line1
line3 line2
line3

it's going to show all lines are different, not treating the lines as a block. Please let me know where I am doing wrong. thx
Re: CompareEditorInput [message #1065801 is a reply to message #1065658] Thu, 27 June 2013 10:18 Go to previous message
Eclipse UserFriend
Hi,

You are not in the right part of the forum. This is the EMF Compare forum part, not the Eclipse Compare part.

Please repost your question here : http://www.eclipse.org/forums/index.php/f/11/

Thanks,

Axel.
Previous Topic:Customized EMF Comare UI
Next Topic:Compare transformed XText models - orderings
Goto Forum:
  


Current Time: Wed Jul 23 13:33:34 EDT 2025

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

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

Back to the top