Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

The "Compare with" dialog

Abstract

The goal of this project is to provide a more flexible and user-friendly way to compare files inside the Eclipse environment. Currently, the Eclipse's "Compare With" feature has a few problems:

  • There is no easy way to compare files located outside the workspace with ones located inside (see bug 73923 for details).
  • To compare two or three files in the current workspace the user has to select them (using a ctrl-click) and choose the "Compare With"->"Each Other" option from a pop-up menu.

Both these issues can be solved by providing an UI element (possibly a dialog or a view) to which user can add two or three files and than invoke a compare editor from it.

This project is part of 2008 Google Summer of Code.

Participants:

  • Student: Aleksandra Woźniak
  • Mentor: Tomasz Zarna

Features (by priority)

Must have

  • adding files for comparison by drag'n'dropping them from the Package Explorer
  • adding files for comparison by "Open Resource"/"Open Type" dialogs
  • adding files for comparison by "Open file" dialog (for choosing files located outside the current workspace): 73923 (ASSIGNED)
  • adding clipboard content for comparison

Should have

  • invoking folder compares from the dialog
  • clipboard content preview
  • basic info about files selected for comparison, eg. filename, modification date, icon
  • moving files/content between left, right and ancestor (either d'n'd or buttons)
  • extension mechanism to support other "Items selection dialogs" like "Open Type"
  • compare two opened files: 39125 (ASSIGNED)

Nice to have

  • invoking a compare editor by drag'n'dropping one file to another in the Package Manager
  • ancestor is an optional part of comparison so this section of the dialog could be expandable (should be hidden when no needed, and expanded/shown when the user would like to use ancestor in the comparison)
  • don't make the dialog too busy, limit number of widgets to minimum

Features (related are grouped together)

"One bug to block them all": 224562 (ASSIGNED)

Invoking the dialog

  • from context menu in Package Manager
  • from context menu in editors
  • by drag&dropping one file to another in Package Manager

Adding content to the dialog

  • drag&dropping from Package Manager
  • by "Items selection dialog"
  • from clipboard (+ clipboard content preview)
  • external files and folders

Tasks:

Layout and navigation within the dialog

  • extendable ancestor section
  • displaying basic info about files chosen for comparison (name, modification date, icon)
  • moving files between left, right and ancestor section

Tasks:

  • resizing of the dialog, when the dialog should and should not be resized? bug 241649

Other tasks

Community proposals

Feel free to add your comments and ideas.

  • Please also have a look at the "AnyEdit tools" plugin: http://andrei.gmxhome.de/anyedit/index.html
    It also adds several enhancement to the selection of to be compared artifacts (like clipboard, opened editor...), so maybe you can benefit from the ideas or work over there.
  • (copied from 73923)
    • I'd really like to drag and drop files from Konqueror or another filesystem-browser.
    • The dialog could be invoked via a rightclick on the editor tab (but as of bug #216710 the normal rightclickmenue will do)
    • I second the request, to paste clipboard contents in a temp-file as another source. It should be possible, to first pass one portion of text, select the next text and create a second temp file before invoking the compare. Therefore the dialog should not be modal (but may or may not hover in front?).
    • It might be worthwhile to rearrange the order of the files. If several files are dragged, it would be nice to sort them for last modification. But a manual reorder without the tedious copying of filenames around should be possible.
    • Last, if there is too much time :-) I envision a feature like the formula-editor in spreadsheet-applications offer. A button to click, that reduces the whole dialog to a single line of textinput, that stays in front, to monitor, where the user clicked / which editor-.tab got the focus last / which entry of the package explorer was clicked.
  • it would be great if it was possible to compare not only whole files, but also separate methods (or internal classes)

Getting the source

Part of the project was recently released to HEAD. For further modifications see patches submitted to the following bugs:

Back to the top