An Eclipse Miscellany

I set up a personal Wiki quite a while back, and I don’t think I could do without it today. When solving some silly issue, writing a nifty regular expression, or finding some well-hidden functionality in, say, Eclipse, I just stick a quick line in my own wiki, and there it is, for me to find, with just the organization that I need. The format is much more appropriate than a blog. It is also easier to access than a stack of notebooks — provided that I have an Internet connection handy.
It’s a collection of links important to me (a bit like a commented bookmark set), and not only for development purposes: it ranges from films I’ve seen to photography techniques I’ve dug out.

I’m stressing that this is a personal wiki, which means that no one else has access to it. This gives me liberty to be as messy as I want, or if needed, as wordy as I want. If someone was to browse it, I am pretty sure he or she would be confused by some organization choices, or by the way some categories are split into different sub-categories in a logic that I know is easier for me because it’s the way I work. I also feel free to copy/paste full articles from other places for later reference which would be totally unacceptable for something publicly available.

One of the drawbacks of the fact that this is private, is, obviously, that it’s available to no one else… It means that where I’m wrong, or not knowledgeable, or still searching, no one pops up to tell me I’m wrong or where to look. So I thought I might give you a glimpse of the Eclipse page of this wiki (there’s also an EclipsePlugin page, and an SWT page). I’ve removed some obvious stuff copied directly from other places, but that’ll give you an idea of how much of a “open-that-notebook-and-scribble-in-it” that thing is, and I can only recommend to use this approach if you intend to set up your own wiki. It’s far from being the largest page (I think pages about WebSphere, and another one about transaction handling are the largest monsters in this zoo), but it’s the kind of things that always come handy. Enjoy!

Display Workspace in title bar

When executing eclipse, run the following on the command line (or modify the launcher):

eclipse  -showlocation

I’ve tried to add this to eclipse.ini, but it doesn’t seem to work when it’s added in there.

Force JVM

C:\eclipse\eclipse.exe -vm C:\jdk1.5.0_12\jre\bin\java.exe

Quick Access

To quickly access UI elements such as views, commands, preference pages, and others, use the new Quick Access dialog, available under Window > Navigation and bound to Ctrl+3 by default

Fix it Quick

Ctrl+1 !!!

Make Eclipse refresh files automatically

Window | Preferences | General | Workspace | Refresh Automatically

Search/Replace across multiple files

Global replace in Eclipse. Could be more obvious, really…

Do Search > File…. And instead of clicking Search, well, click Replace…!

Convert File to Unix format

Go into File > Convert Line Delimiters To, and select Unix.

To force the line delimiter across the whole workspace, go into Preferences, General > Workspace, and set line delimiter to Unix for new files. You can also specify default encoding there (iso-8859-1, utf-8, etc.).

Replace plain dates by Oracle dates in SQL Files

Ctrl+F to make the Search/Replace window appear.

In the Search field, type in:

, '([0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2})\.0',

In the replace field, type in:

, TO_DATE('$1', 'YYYY-MM-DD HH24:MI:SS'),

Changing Splashscreen

Go into in the folder plugins/org.eclipse.platform_x.x.x.x, and modify splash.bmp. Source

More about rebranding.

Change colour in sidebar for occurrences

Go into Preferences… > General > Editors > Text Editors > Anntotations (Occurrences)

Lost Completion on Types

Can’t explain why it happened (I think that was after a plugin install, so the culprit might be in there…), but to set it back:

Go into Preferences… > Java > Editor > Content Assist > Advanced. In the first list, make sure “Type Proposals” is selected.

Builders

A specific way of building an Eclipse project can be defined by creating a new Builder. Right-click the project, click on Builders. You can add a new Ant Builder calling a specific ant file and target.

Add Java Nature to a project

  • Close your project.
  • Open your project file (which is located in your root directory of the appropriate project) called .project with your default editor. Search for
              <natures>
              </natures>
    
    and change it to
              <natures>
                  <nature>org.eclipse.jdt.core.javanature</nature>
              </natures>
    
    Store the changed file.
  • Open the project again – now it’s a java project.
 
---

Comment

your_ip_is_blacklisted_by sbl.spamhaus.org

---