Subclipse Lock Automatically - eclipse

I'm currently using subclipse with eclipse to connect my project to SVN. Due to management decisions we must use the lock-modify-unlock model instead of the standard SVN model. We are accomplishing this by adding the auto prop need-lock. Subclipse recognizes this and asks us to lock whenever we edit a file, which works but it rather annoying. Is there any configuration settings we can use to make it automatically take the lock for the file as long as it is not already locked (at that point it can pop up and bother us)?

No, there is no setting to bypass the dialog.

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.

How to Force Eclipse to not Change Readonly File Flag?

I'm using Eclipse with Perforce version control. In P4V I check out the files I want to modify, making them readonly, but when I open a file I didn't check out in Eclipse it prompts me if I'd like to make it writable and defaults the anser to 'Yes.' If I'm not paying attention and just typing I unintentionally make files writable and then have to reconcile with P4V.
Is there any way to force Eclipse to just disallow changing the read-only flag on files?
I do not know the answer to your actual question, but you may be able to work around this issue by using Perforce's Eclipse plugin. That way, if you unintentionally modify a file, it will be in your pending CL where you can review the change and revert if it necessary.
http://www.perforce.com/perforce/products/p4eclipse.html
In Eclipse , click on Window-> preferences->Team->{selct ur source, in your case it should be P4V } . In there you have some default settings done. You can apply them as per your need. I had the same issue with MKS and me going there resolved the issue.
MAKE SURE YOU REFRESH AND RESTART ECLIPSE TO SEE THE CHANGES. SOMETIMES ECLIPSE DOES NOT RECOGNIZE THE CHANGES MADE IN PREFERENCES.
I hope this helps you too.
Setting perforce_auto_checkout property to false in Eclipse will give you the desired behaviour.

Avoiding "resource is out of sync with the filesystem"

I develop Java code with Eclipse and regularly get this message:
resource is out of sync with the filesystem.
Right-click > Refresh will always clear this.
But why can't Eclipse refresh automatically when it finds this condition? Are there cases where you want the resource to be out of sync?.
If there are such conditions and they don't apply to my work, is there a way of getting Eclipse to refresh automatically when it encounters this state?. (I appreciate that it should refresh as little as it needs to in normal development to increase performance for human developers.)
UPDATE (2012-06-25):
My latest update (Version: Indigo Release Build id: 20110615-0604)
no longer shows
Preferences - General - Workspace - Refresh Automatically
There is an option "Refresh on access" - should I use this?
You can enable this in Window - Preferences - General - Workspace - Refresh Automatically (called Refresh using native hooks or polling in newer builds)
The only reason I can think why this isn't enabled by default is performance related.
For example, refreshing source folders automatically might trigger a build of the workspace. Perhaps some people want more control over this.
There is also an article on the Eclipse site regarding auto refresh.
Basically, there is no external trigger that notifies Eclipse of files changed outside the workspace. Rather a background thread is used by Eclipse to monitor file changes that can possibly lead to performance issues with large workspaces.
Just right click on the file or on the project and click Refresh. The error will vanish. I also faced the same issue and it worked for me.
Window -> Preferences -> General -> Workspace
For the new Indigo version, the Preferences change to "Refresh on access", and with a detail explanation : Automatically refresh external workspace changes on access via the workspace.
As “resource is out of sync with the filesystem” this problem happens when I use external workspace, so after I select this option, problem solved.
This happens to me all the time.
Go to the error log, find the exception, and open a few levels until you can see something more like a root cause. Does it says "Resource is out of sync with the file system" ?
When renaming packages, of course, Eclipse has to move files around in the file system. Apparently what happens is that it later discovers that something it thinks it needs to clean up has been renamed, can't find it, throws an exception.
There are a couple of things you might try. First, go to Window: Preferences, Workspace, and enable "Refresh Automatically". In theory this should fix the problem, but for me, it didn't.
Second, if you are doing a large refactoring with subpackages, do the subpackages one at a time, from the bottom up, and explicitly refresh with the file system after each subpackage is renamed.
Third, just ignore the error: when the error dialog comes up, click Abort to preserve the partial change, instead of rolling it back. Try it again, and again, and you may find you can get through the entire operation using multiple retries.
If this occurs trying to delete a folder (on *nix) and Refresh does not help, open a terminal and look for a symlink below the folder you are trying to delete and remove this manually. This solved my issues.
When you open an Eclipse workspace from within a clearcase view and try to rename the project, you will often get the pop-up warning ... “Resource ‘project’ is out of sync with the file system”. If refreshing the project does not fix the problem, then do the following workaround: a. Open workspace WITHOUT being in a view b. Select the project in Project Explorer c. ClearCase -> Associate Project (project should now look like project [] ) d. Right click project -> Refresh (vob sub-folders should now be empty) e. Right click project -> Rename ... f. Enter New name
Now you can close the workspace, reopen it in a view and refresh the project. You may also dissociate the project if you prefer the project not to be associated with the vob.
A little hint. The message often appears during rename operation. The quick workaround for me is pressing Ctrl-Y (redo shortcut) after message confirmation. It works only if the renaming affects a single file.
If you are a regular Eclipse user than you might have got this error many times. The error simply says, “you’ve made changes in files in your workspace from outside eclipse”. The simplest solution would be to select the project and press F5 (Right click -> Refresh).
if you need more explanation you can read from this web site
I was not able to resolve this error by either refresh or by turning on "native polling" workspace feature. Turned out my project was also opened in two instances of eclipse. Once I closed the other instance, the error went away. So make sure your project is only opened at one place if you are seeing this error.

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.