2008-09-28

Hawkscope: System Tray File Browser

I'm happy to announce the first usable release of my new weekend project. It's Hawkscope - a simple productivity tool that allows you to find and open any file or folder in seconds by single-clicking a tray icon and navigating through dynamically generated menus that reflect the contents of your available file systems.

Hawkscope is open source, it's built with Java 1.6, therefore it doesn't run on Mac OS X (for now...), even with SoyLatte JDK. I tested it on Windows (XP and Vista) and Linux (Ubuntu + Gnome). Should work perfectly where Java 6 System Tray and Desktop API are supported.

Here's how it looks on Windows Vista (running inside VirtualBox):


And on my Ubuntu:


You can always download latest release here. Enjoy!

2008-09-26

Java 6 on 32-bit Intel Mac

Dying to have Java 6 on an older, non Core 2 Duo Intel Mac? You should get SoyLatte.

SoyLatte is a functional, X11-based port of the FreeBSD Java 1.6 patchset to Mac OS X Intel machines. SoyLatte is initially focused on supporting Java 6 development; however, the long-term view far more captivating: open development of Java 7 for Mac OS X, with a release available in concert with the official Sun release, supported on all recent versions of Mac OS X.

It lacks some features like system tray support, but overall these folks are doing a way better job than the official Apple Java team.

2008-09-18

Eclipse Template: Singleton Pattern

Are you writing your Java classes as Singletons quite often? Use this Eclipse template and make any class a singleton in two seconds:

Setup

Go to Window -> Preferences -> Java -> Editor -> Templates. Create New:



Code for copy paste:
private static final ${enclosing_type} instance = new ${enclosing_type}();
private ${enclosing_type}() {}
public static ${enclosing_type} getInstance() {
    return instance;
}


Action

Type "single" or "singleton", hit Content Assist shortcut key (ctrl+space by default), then enter:



And there you go - a singleton in two seconds (actual time may vary on your typing and CPU speed).



You may want to use a different Singleton implementation. Check out Java Singleton: The Proper Way for a good example.

2008-09-01

Add loggers to your Java code in seconds using Eclipse Templates

Custom Eclipse Templates can greatly increase your productivity by automating daily development. For instance, instead of creating Apache Commons Logging loggers by hand, you can do this:

Setup

Go to Window -> Preferences -> Java -> Editor -> Templates. Create New:



Action

Type "log", hit Content Assist shortcut key (ctrl+space by default), then enter:



Hit Ctrl+Shift+O to import Log and LogFactory:



Saves hell of a time in the long run.