Netbeans itacilized file name - netbeans

Today I opened netbeans after a month of not using it, and when I opened it all my program tabs with file names were italicized. This makes it a class like println, but the classes I am working on are my own files, and now I can't edit it.
How can I make them read and write files again?

Italized file names mean that the files are read only. Are those files located on your computer or on a remote server? Did you have write access to project files? Do you have them as .java, .class, or .jar? To begin with right click on the tab, use select in projects and see what is selected.

Related

How to group up commonly accessed files in a Project, and then show them in a simple fast accessible folder?

When you are working with a project, you often need to click many times in the Tree view & search for files in different locations, just to get the desire files opened.
Is there a way to let some commonly accessed files directly shown under the root of the Project (or group them up in a simple fast accessible folder)?
eg: like creating virtual Links to those files under the root of the Project. (or other solutions).
This is what I am doing right now:
the problem is::
manually creating the links in Windows are really time consuming. You can't just right click in Eclipse to create them.
when you open them, they will be opened with Default Editor -- which treats them as Text file not link file.
you can open it with System Editor, but that
requires you to set all these file to be opened by Eclipse.exe in your operating system.
maybe its fine for .java file, but for all other files (eg: .xml, .html) is probably not good.
you have to right click to open it everytime
the icons in the tree view becomes just a Text file icon.

Eclipse: Two Linked Resources pointing to same physical file are opening twice in Editor

I had to create multiple linked resources pointing to a single physical file in an Eclipse project. The problem is, whenever I try to open these two files, the editor opens each file in a separate tab, it won't direct me to the already opened file.
This is different from how VisualStudio works. VisualStudio has an option to add an existing file to a project. A single file can be used in multiple projects. Whenever we open both files, VS will direct us to the already opened file, it won't open the file in a new tab.
It's possible that developers open/edit multiple files at the same time and not notice that the same physical file was opened more than once. This behavior can potentially cause a lot of problems, for example, if File 1 is modified but not saved, and later File 2 is modified then saved, all modifications previously done in File 1 will be lost.
Is there any preference to turn-off/on this behavior? If not, can I implement this hook as a plugin?

Opening many files in Eclipse with a script for formatting

So i want to format a bunch of files that i have to a certain standard. The problem is, there is A LOT of files. Is there anyway to have Eclipse open a file, hit CTRL+SHIFT+F (to format the file), save it, close it, then open the next file and repeat that process through a directory that i specify?
I don't have any experience with scripting so i have not even attempted doing something like this. I looked into plugins for Eclipse that could maybe do this but i really didn't get anywhere.
Any help is appreciated.
Thanks
You can right-click on any source folder in the Package Explorer (including the root of the project) and select Source > Format, or Source > Cleanup (which gives you even more control than a simple format)
You can right click on a folder in the Navigator or Package Explorer view and select Source -> Format. This will format all the files in the selected directory.

Can I search Netbeans' local history?

In one of the previous versions of one of my file in a Netbeans project I wrote code that I later removed, and now I want to retrieve it. However now I can't find it when I manually go to previous versions, as I have many versions in the local history of this file, and I don;t remember when exactly I wrote this code.
Is there a way to run a search on the local history of this file?
I saw in this answer that the local history is kept in this path
<HOME>/.netbeans/<NB_VERSION>/var/filehistory where HOME is my user home and NB_VERSION is the version of NetBeans (e.g. 7.0).
I tried running AgentRansack on that directory, but to no avail.
I recently had to solve this problem and figured it out. Netbeans stores local history files in your user directory as mentioned above. Inside that folder are numbered directories. It's pretty easy to guess which one you need based on the modification date of the folder (if you know when you last looked at it, so that doesn't help you much). In side the numbered folders is another folder with a hashed name, and inside of that folder is a set of files: a data file, and numbered files. The data file can be read with a binary file reader, and if viewed in ascii mode will show the filename that this history belongs to. The numbered files are actually zip files and they have full versions of the file in them. Just unzip those and open with a text editor if they are plain text files.
Hope this helps you out, but I realize its probably too late now. I had to figure this out because I had opened a remote file with netbeans (a file that was not associated with a project), and couldn't get back into the Local History because the file didn't have a project. However I could see it in the Local history by reading the data file, and I just guessed that the other files were zipped by the fact that they started with "PK" in the binary viewer. Once I put it all together I was home free.

Opening a temporary buffer / scratchpad in Netbeans?

I often have to open a secondary editor outside of Netbeans in order to work on temporary bits of text outside of my project files. Is there a way to create temporary files in Netbeans without adding them to a project?
File -> New expects every file to be part of a project.
I know this has already been answered successfully, but there is now a proper Netbeans plugin for this requirement: http://code.google.com/p/netbeans-scratchpad-plugin/ It works nicely for me and allows multiple scratchpads which can be handy.
Also note that the Copy/Paste History plugin which is available by default (with NB7 at least) is handy for this too.
HTH,
JD
By default, there is no such feature yet (I'm using 6.5).
You could include a folder in the Favorites window, and right click > New > Empty File from the folder, it won't be part of the project.