To compare not IFile objects. How to? [message #96364] |
Tue, 16 September 2003 14:21  |
Eclipse User |
|
|
|
Originally posted by: mewmar.ukr.net
I need to open the compare editor on not IFile objects. This Means I want
to write some static method, which will take 2 MY OBJECTS as parameter.
Then using my objects this method will create 2 files in local filesystem
(located anywhere inside file system) and then compare these files.
I've written such method, but I have taken SRC of "compare to each other"
menu. But this SRC was located in internzl package. I know I must not do
this. But using this SRC I was able to write method, which compares 2
IFiles. But IFiles can be getted only when I create IProject on folder
that contains every IFile.
So, troubles are:
-using internal package;
-can be troubles with creating IProjects on folders.
Are there any right way to write such static method?
|
|
|
Re: To compare not IFile objects. How to? [message #99803 is a reply to message #96364] |
Mon, 29 September 2003 17:08  |
Eclipse User |
|
|
|
Originally posted by: Andre_Weinand.oti.com
On 16.9.2003 20:21 Uhr, in article bk7kae$3k9$1@eclipse.org, "mew"
<mewmar@ukr.net> wrote:
> I need to open the compare editor on not IFile objects. This Means I want
> to write some static method, which will take 2 MY OBJECTS as parameter.
> Then using my objects this method will create 2 files in local filesystem
> (located anywhere inside file system) and then compare these files.
> I've written such method, but I have taken SRC of "compare to each other"
> menu. But this SRC was located in internzl package. I know I must not do
> this. But using this SRC I was able to write method, which compares 2
> IFiles. But IFiles can be getted only when I create IProject on folder
> that contains every IFile.
>
> So, troubles are:
> -using internal package;
> -can be troubles with creating IProjects on folders.
>
> Are there any right way to write such static method?
>
Just implement a subclass of org.eclipse.compare.CompareEditorInput similar
to the internal class org.eclipse.compare.internal.ResourceCompareInput.
Then start the comparison and open a CompareEditor on the result by passing
your subclass of CompareEditorInput to CompareUI.openCompareEditor(...)
--andre
|
|
|
Powered by
FUDForum. Page generated in 0.04066 seconds