Suppress checking for changes on file system in Eclipse RCP - eclipse-rcp

Okay, I guess this question is too difficult, but it's worth a try.
I have an eclipse RCP application that edits HTML-files. I deal with the content of the files only in a W3C-Dom representation. There is some stuff that I can not do with that, so I the program edits each file each time after it is saved (save, save as). Of course, the file is then out of synch with the file system, and the next time I touch it, eclipse complains:
"The file has been changed on the file system. Do you want to replace the editor contents with these changes? (Yes/No)" I do not want to load the changes into the editor ("No")
Maybe there is a way to tell Eclipse programmatically to not check that file for changes, or to configure it to not check for changes on any file?
edit: Everything has to be done either programatically or by editing some XML files. I can not expect the user to do anything;-)

I find your question confusing.
I'm assuming you have access to the source code of the RCP application.
If you modify a file outside of Eclipse, Eclipse will respond with the message you mentioned when you want to edit the file inside of Eclipse. This is to protect you.
If you want Eclipse to stop responding with the message, you have to refresh any module you edit and save outside of Eclipse. Right click on the module name, and left click on Refresh or press F5.
Inside the RCP application, you can call the refreshLocal method of IResource in org.eclipse.core.resources to do the refresh.

Related

Can't edit a file in Eclipse after clicking "No" in a popup warning about it being derived

I created, as I was instructed by a more senior developer, a new .sql file in Eclipse in a project folder buried somewhere in the entire application's overall project structure. When I tried to edit the file, Eclipse asked me whether I'm sure if I want to edit a derived file. I clicked "No" arbitrarily to make the popup go away and to be able to check the file's and project's properties just to be sure, because as far as I knew, the files in the project were not actually derived from anything.
Problem is, the file is now apparently locked for editing, and I don't see any way of unlocking it. In the properties, it is not marked as Read-only, nor is it in fact marked as Derived.
How do enable editing on this file again?
In the end, I deleted the file and created a new one with the same name, which is tedious, but it fixed the problem. I did not try closing and opening it again as howlger suggested, though that might have worked as well.

Mylyn opening unwanted files in editors from task context

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.

Can I use the same Eclipse workspace simultaneously on two computers?

My friend and I need to use the same Eclipse workspace. I've put it on an AFP server, so we can both mount the volume and use the workspace there. But will that work without problems as long as we are not editing the same file at once? For example, if there are classes Starter and View, could I be editing Starter.java and saving the project while he edits and saves View.java?
I know that Eclipse cannot normally use workspaces on AFP due to a bug. I had to add "-Dosgi.locking=java.io" to the eclipse.ini file to make it work.
Yes. But you will need to change its configurations to not lock the workspace. This is the default behaviour.
This is the option:
-Dosgi.locking="none"
Use it in your vmargs or in ini file. I do not need to mention you and your friend need some discipline to not be caught by side effects of this solution.
For example, if both are working in file A, when the first save eclipse will ask if you wish update with system file changes. If you click yes your changes will be lost.

Eclipse pydev: automatically save file when running program

It used to be that when I made changes to my .py file in Eclipse, then the changes would be automatically saved when I then ran the program in debug mode. I liked this since it meant that what it was debugging was the same as what I was looking at. Now it no longer does that, which means that's it's actually running an old version, unless I manually save the file first. The first time I ran the program, Eclipse asked me whether I always wanted any changes to be saved when the program was run, and I answered yes. I don't know why it doesn't do it anymore or how to get it back.
This seems to have happened after I started using Mercurial TortoiseHg with BitBucket. As part of that, I did move some files around, but everything is back and named the same as before.
Of course, I can just do change, save, run, but I'd rather not have to remember the extra save step.
Edit: Actually it's a bigger problem. It also shifts my breakpoints. In regular edit mode, I 1) set a break point and Save. 2) Add a new line above the breakpoint. Everything looks fine. 3) Save. Now the first breakpoint shifts position.
From your description, it seems that you're always opening the file as an external file and not a file within your workspace (the fact that breakpoints don't get updated is the major clue here).
You can check if this is what happening from the title that's shown in Eclipse (if it's a full filesystem path and not relative path considering your workspace location, this is what's probably happening).
How are you opening the file you're running? Are you opening it from the PyDev package explorer or dragging from the filesystem? (also, it'd be interesting knowing which eclipse/pydev/tortoise versions are you using)
Look at your Preferences -> Run/Debug -> Launching, you probably have "Never" set for Save Required Dirty Editors before launching.

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.