Mylyn opening unwanted files in editors from task context - eclipse

I'm using Mylyn 3.12 for the first time with Eclipse Kepler. I am using subversive to manage SVN connection for team.
I doing web development, so no Java projects here. I'm having the craziest situation where Mylyn is always adding three files to every task I create after I deactivate and then reactivate the task. It's almost as though there is a hidden editor with these files open. I have no idea where they might be coming from. Why on earth it chooses these three files is beyond me. If I delete one of the files, it still tries to add the file to the context, but the editor opens with file does not exist. When I "clear all" from the task context, stop the task, and reactivate, the files still appear! I even clear the invisible section as well.
Does anyone have any idea what might be linking these files to the context?
Also, I'm using the ColdFusion builder plugin, so I don't know if was related to that.

Ok, on a hunch while dissecting this issue, I decided to go through the "Window->Navigation->Switch to Editor" Each of my three files had it's own editor listed here! However, I found no way to actually get to these editors. So, whenever a task was created, it would simply copy open files from these hidden editors. So, I had two copies of each file open. I have no idea what is going on with my "shared area."
Again, the only way I could get to the hidden editors was the Window menu item, so it beats me if this is a bug or a feature. It almost seems like it was split editor view gone terribly wrong.

Related

Eclipse: How to backup and restore session (windows, views)?

Occasionally, my fingers are faster then my brain and accidentally close views or windows of my development environment (which is Eclipse Kepler). I usually have two windows of Eclipse running side by side with individual views configured in both of them. Unfortunately, as soon as I (unintentionally) close a view/window, I have to set it up again. E.g. the build files in my Ant view get lost, I have to reopen files and so on...
Generally speaking, are there any plug-ins or options you can recommend that can help me backup and restore sessions? I'm aware of the "Save perspective" feature, but it barely meets my needs.
To be more precise:
Is there any feature to make Eclipse request my confirmation, before a (top-level Eclipse) window is closed? - I rarely do uncontrolled clicks twice :-)
Is there any plugin to save and restore my current views (incl. build files in Ant view)?
Is there any plugin to save a set of open files I'm currently working on? Would be neat, if I could open several files on a single click and get working right away. I'm thinking of a session management, where I can switch between several sets of open files.
Just in case none of the above is available and I messed up again, are there any files I can copy from one workspace to another to restore my Eclipse setup (windows/views)?
Any hints are welcome.

Is there auto-syncing in netbeans for external changes

I know netbeans syncs the original files once I save, but if there is a file changed externally is there a way for netbeans to recognize this and either tell me to re-sync it or automatically resync it with the new changes?
Here's what makes this behavior possible:
NetBeans 6.9 contains a feature that automatically looks for external changes to keep informations about files up-to-date. We have some reports that it can slow down NetBeans mainly, when an open project has many folders. When NetBeans find out that files were externally changed, it re-scans the files to keep data up-to-date that are used with features like code completion, navigation etc. Unfortunately the notification and following re-scanning can take some time and during this time many mentioned features are waiting for the finishing of scanning. There is option Enable auto-scanning of sources that can switch off this behavior. The option you can find it in Options dialog, Miscellaneous category and Files tab.
The default behavior is that NetBeans also looks for external changes when the main window gets focus. This is can be during developing a web application very often when user switches between browser and IDE. The mentioned option also switch this off.
When you switch off option Enable auto-scanning of sources you can still keep the information up-to-date, just invoke Scan for External Changes action from Sources menu manually.
(Here's the original article by Petr Pisl)
I find it counterproductive to leave this setting on, as sometimes auto-loading external changes to a file opened in the UI without asking for permission first can ruin your day when you're forced to make small local changes that you don't want replicated in your repository. I'm sure other people can think of more reasons to advocate for "warn before loading external changes" behavior to be implemented in NB. That is one of the reasons why I like Eclipse better sometimes.

Is it possible to prevent Eclipse from closing up the project space when you close the app?

I have a Java project in Eclipse that mirrors a directory structure on my hard drive and every time I open Eclipse I have to manually open all of the folders to see the source files inside them. Is there a way to avoid this so that everything stays open between app sessions?
With the CNF alone (the Common Navigation Framework), I don't think so.
But with Mylyn (which is part of certain Eclipse packages), you can because the Mylyn task will keep the relevant files/classes/methods visible from one session ot the next.

How to search all open files in Eclipse?

Simple question: how do I search all the files currently open in Eclipse? Note: I don't wanna search all the files I have in that workspace, just the ones open in tabs. Is there an easy way to do this?
Closest way is selecting several resources in Navigator or Package Explorer view, then press Ctrl+H and choose 'Selected Resources' radio button. It will limit search only to selected files.
CTRL+E on Windows or Linux, and Command+E on OSX.
There's no way to do that at the moment.
The easiest solution would be to select your files manually (holding CTRL + click on file) and to specify "selected resources" as your search scope.
This may come too late for the original poster, but just in case somebody else needs to find out an answer, I had the same problem and found my solution by installing a plug-in named Instasearch. You can get it by going to Help/Eclipse Marketplace and searching for Instasearch.
You can find more about this plug-in in the following address.
http://marketplace.eclipse.org/content/instasearch
Spring produces a stand-alone Eclipse plugin (no dependencies on Spring) called Quick Search
http://marketplace.eclipse.org/content/quick-search-eclipse
For efficiency, it searches your open files first. So while it isn't purely restricting to opened files as you requested, you can still get a similar effect in practice by just clicking the first results that come up.
The currently opened files simply aren't considered special in eclipse - you have far more advanced methods of organizing your files: projects and working sets.
Working sets allow you to define sets of files, which can be used as constraints for many operations. You have to define them explicitly, but then they don't change just because you've closed a file.
There is no find-in-open-files command in Eclipse, no.
I think that the main reason find-in-open-files is not implemented in Eclipse is probably because the set of open files is for many users rather insignificant. (In fact, I don't know (or care) which files I have open. (I even have Eclipse set to automatically close editors/files when they become too many). If I want to navigate to a file, I open it. Limiting a search to the files I currently have open would be completely pointless for me.)

Eclipse: Refreshing known types in Java project

If you press Shift+Ctrl+T or choose "Navigate > Open Type..." you get the "Open Type" dialog for quickly navigating to a known class. When you start typing a name only the classes for which the name matches stay visible. That way you can find a class of which you know the name very quick without having to browse through the package explorer tree.
This has been working great for me up until this morning. All of a sudden for a couple of my projects I am only seeing some of the types that exist. Of course I tried the obvious steps of refreshing the projects, cleaning the projects, re-building the projects, rebuilding the projects externally, but all to no avail. It is a bit odd since the types are known in other places. If I add an import statement Eclipse does not complain that it doesn't know the type and I can Ctrl-Click through the types to get to their file. However, the type navigation knows nothing about them.
In the past when InteliJ used to do this to me I would go find its cache files and delete them forcing it to rebuild. Does Eclipse have something similar I might do (I'm an Eclipse newbie)? I am using Eclipse 3.4.2 and I have it configured to not delete files on a clean (because our actual build process puts files into the output directories that I don't want Eclipse mucking with).
Have you tried closing and reopening the project? Only types from open projects are held in memory, and the refresh occurs when you Shift+Ctrl+T for the first time on a newly opened project.
Edit to add: Ctrl+Shift+R also displays the types (along with everything else) but it also supports the Camel-case thing to find the Java types quickly.
Close eclipse and delete any .index files and the savedIndexNames.txt file in workspace/.metadata/.plugins/org.eclipse.jdt.core once eclipse is restarted it will rebuildl the entire index for Ctrl+T
try starting eclipse with the -clean flag, you can add this to your eclipse.ini which can be found in the same directory as you eclispe.exe, or if you start eclipse using a bat or shell script, add it as a startup argument, e.g. eclipse -clean.
The clean will tidy your workspace, and should force eclipse JDT to recalulate types. Ive had issue with .snap files (with seem to be created on dirty shutdowns) that seem to corrupt my workspace until I clean them up, not long ago eclipse lost the Object class!! made for some interesting errors!
I get problems like this often. I tried your solution, noticed it seemed to rebuild its search index, but I still couldn't find any of my classes. Then I took a look at the little green arrow on top right corner of that dialog, and noticed I had a working set selected which belonged to another project. I find it a little dumb that Eclipse doesn't warn you about this or anything, since this can be a very annoying little detail that one tends to forget (me at least ;-)).
Anyways, clicked on "Deselect Working Set" and bam I can find my classes again. Thought I'd add this here since others may make the same mistake.
This worked for me -
Select your project in Package Explorer
Press F5 or Right click and select Refresh
I used the "-clean" as first line in the eclipse.ini (version Juno) and worked like a charm.
I'v tried all the answers and I still had the issue. I then tried this:
I deleted the project (it's a maven project) and re-imported it. This time I made sure i check the "Add Project(s) to working set" checkbox. After that Eclipse was able to find the classes in that project.
The problem must have started because I didn't check this checkbox when i first imported this project.
By the way, I'm using Neon
(Warning: Shameless marketing ahead)
If you like this feature, you would love nWire. nWire allows, among other things, to quickly search not only for types, but for any possible Java element like method or field. It also uses a navigator view which is non-modal. After searching you can see the class associations in a very quick and easy way. Check out the video on our site.