In Eclipse, how to make Flat Presentation default in the Team Perspective? - eclipse

When using a centralized versioning system like CVS or SVN, I like to review my changes in the Team Synchronizing View before I commit them.
By default Eclipse collapses the source tree, and I always have to click on the little arrow in the icon "Show Java Workspace" and select the checkbox for Flat Presentation:
Is there a way to make this the default for the Synchronizing perspective?

Window > Preferences > Team > Choose the presentation to be used when displaying Workspace projects : Flat

"The same can be done for CVS in Team -> CVS -> Synchronize/Compare settings, though I haven't tested it."
Tested it for CVS. Doesn't work. Scumbag Eclipse :/

I've found a way to do that for SVN, unchecking the option Allow models to participate in synchronizations:
The same can be done for CVS in Team -> CVS -> Synchronize/Compare settings, though I haven't really tested it.
UPDATE: If that does not work on the first time, on the View Menu (activated clicking the little arrow beside the minimize button for the Synchronize panel), select Presentation -> Tree.

Related

Undo "remember my decision" in eclipse for team synchronizing perspective

I clicked with the rigth button of mouse in one project.
Then I clicked in the menu: Compare with --> Head Revision (using git)
Then I clicked in Remember my decision to always open team synchronizing perspective.
But I dont want to alwas open team synchronizing perspective.
How can I undo this action?
I think you are after the following preference:
To access, Window | Preferences | Team and change the Open the associated perspective when a synchronize operation completes setting to the desired value.
With in the Synchronize view, select the menu and select Preferences
In the preferences, set the highlighted setting back to prompt for being prompted before switching perspective
Click ok and you'll get what you want

eclipse navigate showing java source in directory hierachy instead of package

Due to some reason I found, when displaying the source ,my navigator changed from the right side (preferred) to the left side , which need more clicks to access the source file. I remembered that I did accept some chance unconsciously which result in this unpleasant change but can not find a way go back...
Thanks for your help!
Your best friend in eclipse is CTRL+3 (quick access), press that and then search for what you want, try perspectives and views, see below.
Perspectives
Check what perspective you are in (now). In the top right of eclipse there is a list of perspectives. Sometimes when you carry out an action it asks you if you want to change perspectives. This can change your views/layouts. You might want the Java or Java EE perspective.
views
There are multiple views of your files. What is the name of the tab where ComputeBench is showing up? Try opening the "Project Explorer" or the "Package Explorer" views.

Equivalent of Komodo's "show unsaved changes" in Aptana Studio?

I've been using Komodo Edit for the last few years, but am once again thinking of switching to Aptana Studio because of it's built in refactoring tools for Python.
One of the features I use all the time in Komodo Edit is "show unsaved changes". This simple feature pops up a window with a diff of the text in the current editor window vs. the saved file on disk.
There must be a way of doing this in Aptana Studio (or more to the point, there must be a way of doing this in Eclipse, since Aptana is built on top of it.)
How do I get a diff show unsaved changes?
Windows -> Preferences -> General -> Editors -> Quick Diff.
Check the 'Show Differences in overview ruler'. Set the combo on 'Version on disk'. Select nicer colors for the diff ;) and OK the dialog.
Now, every change in your file will be visible on the 'Overview Ruler' and on the 'Annotation Ruler' (the editor left and right bars). The marks will be visible until you save the file.
Not an exact match to the Komodo feature, but this, along with the local history feature of Eclipse, can provide a lot of control.
Hope that helps.

Highlighting modified lines in Eclipse

In netbeans, if I open a file which is under version control the lines which are modified are highlighted in the left. (green for new lines and blue for modified lines)
Is it possible to get a similar effect in Eclipse?
Open the Preferences window
Search for "diff"
Select Quick Diff
Change the "Use this reference source" to a SCM provider (like CVS, SVN or Git)
By default, it compares to the latest version on disk, which, if you've saved the file, is no diff at all. You have to activate the comparison against a SCM repo. I'm not sure what happens if you more than one type of SCM since this is only a single selection.
With Subversive, you can do Team > Show Annotations, and it will annotate the lines with the author and date of the last modification of that line.
Right-click on the file > Team > Show annotation.
A brown tape will appear on the left-side of the code (it represents commited lines), and the modified lines will be shown in white.
In Eclipse by using its Quick Diff feature. This is easy to do:
Go to Window -> Preferences -> General -> Editors -> Text Editors ->
Quick Diff. This is the dialog from where it can be configured.
Turn on Quick Diff, by enabling the option Enable quick diff.
Choose the version control system for which Quick Diff is needed
from the dropdown Use this reference source. Git, SVN and CVS should
be present here. Mercurial appears if the MercurialEclipse plugin is
installed.
The overview ruler is the ruler to the right of the scrollbar in the
editor. If you would like to see the uncommitted lines to be marked
on it, enable the option Show differences in overview ruler.
Choose Apply and OK. Close all editor windows and reopen the source
file that you want in the editor.
You should be able to see the newly added, modified or deleted lines marked in colors in the left bar on which line numbers are usually displayed. The colors used are the ones set in the Quick Diff dialog (see above steps). You can also view these uncommitted locations marked along the overview ruler on the right.
For Eclipse Version: 2019-03 (4.11.0) Go to
Select 'window'
Select 'Preferences'
Go to General -> Editors -> Text Editors -> Quick Diff
Tick 'Enable quick diff'
Tick 'Show differences in overview ruler'
If you want to keep the changes after you save your local copy, then you need to tell the eclipse to compare the local copy with the repository version. To do that change the reference source accordingly.
EGit plugin's Quick Diff does exactly the same as netbans modified lines feature.
http://wiki.eclipse.org/EGit/User_Guide/State
There are at least two things you must do to get revision-based change highlighting (i.e., ones that do not disappear when the file is saved) to show up in Eclipse's "overview ruler" when using Git:
Prior to import, make sure that Preferences > Team > Git > Projects > Automatically Share project that are located inside Git repositories is checked or import the project into your workspace using Import... > Git > Projects from Git (as pointed out by #cornelius in a comment on another answer)
Enable Quick Diff and select "A Git Revision" as the reference source: Preferences > Editors > Text Editors > Quick Diff
In eclipse too you will get the line highlighted which is changed util you save the file.
and highlight is nothing but the change in color at the left panel of the editor before the start of that changed line.

Subclipse - marking code changes like in NetBeans

I moved recently from NetBeans to Eclipse. Since I have to work with the project checked out from SVN I installed Eclipse. My question is: how to make Subclipse indicated the changes that I introduce in the source code (downloaded from SVN) just like NetBeans? Is there any way?
In Window -> Preferences navigate to General -> Editors -> Text Editors -> Quick Diff and tick "Enable quick diff", "Show differences in overview ruler" and set "Use this reference source" to "Pristine SVN Copy".
You might also want to change the colors to match NetBeans (blue for Changes, green for Additions, red for Deletions).
Note that you'll probably need to restart Eclipse for this to take effect.
As you go on changing the code it will show your changes on the side ruler until you commit to SVN.
If you are referring to the Viewing Changes in the Source Editor section of subversion in Netbeans:
alt text http://netbeans.org/images_www/articles/60/ide/vcs/left-ui.png
Then it should be like activating the Quick diff Annotate in Subclipse:
Team -> Show Annotations option on a file
Subclipse automatically keeps track the changes that you do in Eclipse.
If you would like to see the changes, the convention in Eclipse is to go to Team -> Synchronize menu on the project.
If you want to quickly compare changes from a single file, right click on it select 'Compare With' -> 'Latest from Repository'. The resulting diff would look much like the one in Binary Nerd's first screenshot, only it will appear in Editor section and you won't have to switch perspectives.
Doesn't subclipse mark the classes and packages in the Package Explorer as being different to the version checked-in to SVN?
EDIT
You can use the compare function to see the differences. One way to do this is to open the synchronize view, right click on the desired class and choose compare (i can't remember the exact menu option, but it's something like that).
(source: tigris.org)