Extend or configure Eclipse compare files functionality - eclipse

Eclipse has built in functionality for comparing files, but how can I configure that functionality? Say I create a new file type and want an external program do perform the diff. How do I set that up?
Can I create an Eclipse plugin to add my own plugin for handling file comparisons? Or perhaps that is the answer to the first question...

You may want to look at the EMF Compare Project which helps build compare editors for EMF models. If you don't have an EMF model for your file type, you can either create one or look through the source code of EMF Compare to see how it works.
The developer guide explains how to use the code to write your custom viewers.

There is a plugin integrating Beyond Compare into Eclipse. As it is open source, you might get a clue by looking at its sources.

Related

how to find file (Open Type) by project in eclipse

In eclipse (neon) I have several projects with similar files
I want to able to pick project when open type maybe using Path or Project name
Is there any plugin or similar way to get it?
I think you are asking for open resource(Ctrl+Shift+R) not open type(Ctrl+Shift+T).
IMHO there is no way to filter out types by their paths, as because same type(ex Enum/Inner class) may exist in different Java classes.
Yes. You can filter out resources by project/folder path. Refer this answer https://stackoverflow.com/a/39568618/1391924
Open Resource and Open Type both let You use Working Sets.
So You can define a WS per project or whatever makes sense for You and use the one You need at the given moment.
You can choose the WS directly in the modal dialog.

Files filter plugin in eclipse (in Package Explorer - Navigator)

I want to create a some custom filters for my eclipse project. I think this can be done extending a plugin.
For example .asm file should go to the ASM filter, .c files to the C filter, and so on.
All my input files are stored in the Source folder (on my computer).
But I need this filters only for a better file management, in the Package Explorer.
Please, if anybody have a starting point for this issue ... I will appreciate.
The sooner, the better :)
You might want to have a look at this:
Eclipse Common Navigator Framework
And read this tutorial to create a custom navigation:
Custom Navigator
(It's part 7, but in the beginning there is a lot of theory. just find your personal starting point)
I hope this is what you were looking for or that you can at least get something useful out of it...

To modify a core eclipse plugin

In order to modify an eclipse plugin, what are the steps to find its editable code ?
I read and debug source provided with eclipse distribution but to try a fix in org.eclipse.jdt.internal.corext.codemanipulation behavior I need to make it editable.
Well, the source repository is available at eclipse.org, the plugin compiled with the source should be available from the standard eclipse update site.
I'm guessing you are considering changing the source, recompiling and using your plugin instead of the standard one? There is a different way to change functionality, its with fragments. For example, look at a question I asked earlier, follow the links in my text and Andrews answer for more information.

How to programmatically get information in Eclipse

I'm developing an Eclipse Plug-in.
I need to programmatically get both filepath and filename of the selected/active file in the eclipse editor.
Also need to programmatically add an existing file (located outside the project) to the project and then open it on the editor.
I'm a totally beginner with Eclipse, so complete solution would be appreciated.
You question is quite general, but this should clear things up a bit:
Eclipse Plugin Development Tutorial
About adding a file to the project, you have to read the documentation and find where eclipse handles projects. I think that if you have a reference to the project it should be easy.
Hope it helps =)
Your editor is most likely inheriting from IEditorPart, so you should be able to call getEditorInput(), which then may or may not turn out to be a FileEditorInput, for example. From there, you can get at the underlying details of the file.
For your second problem, you can use IProject.create() and then e.g. do an IFile.createLink() and use a local filesystem path, or copy the file using IFile.appendContents().
Have you tried the solution proposed in http://www.eclipse.org/forums/index.php/mv/msg/97927/300308/#msg_300308?

Grouping Files in Project Explorer in Eclipse

I am newbie to Eclipse, I am planning to use it for AVR development with WinAVR and gcc.
The feature I am looking for is the grouping of different files in the project, like all headers together, all source files together and all files excluded from the build together etc.
I tried AVR Studio from Atmel, it has this grouping feature but it lacks several other features which Eclipse supports. Any help to configure Eclipse Project explorer to display the project files in this way would be appreciated and helpful for me to decide the IDE to use.
Note: I know that I can manually add different folders for each of these groups and move the files, but that moves the physical files, and breaks the relative path in the code, and other comilers/IDE's. I am looking for logical grouping of files.
Unfortunately there is no general way for a user to configure the grouping in the Project Explorer, the grouping is setup based on the code that controls the content (i.e. CDT, JDT, etc). I think it would be interesting to have this feature, but it's not clear the UI that can be used to specify it. You are welcome to submit an enhancement request to add this to the Eclipse Platform UI project. And giving an example of how it's done in another product would be helpful.
Thanks Francis, looking at your profile I think I found the right person to solve my issue :)
I have opened it as a bug (as I could not find a feature request in bugzila) Bug 296514 - Logical Grouping Files in Project Explorer in Eclipse
I have attcahed screenshots of both AVR Studio and Eclipse project explorer. That should give you an idea of what kind of UI features I am requesting. I can difinetely provide more information if you want.
I think what you are looking for can be done with Working Sets.