Wednesday, July 26, 2006

Business Computing and Web 2.0

Just discovered:

Corporate America wakes up to Web 2.0
Web 2.0 meets the enterprise

That is what we (Jonathan and myself) were just thinking about. Note the nice features on the web page: there is a shortcut to bookmark the articles on delicious, and a mind map showing related articles.

Tuesday, July 25, 2006

Eclipse-based IE for Google's GWT

Found here:

http://www.webpronews.com/topnews/topnews/wpn-60-20060720IDEforGoogleWebToolkitDebuts.html

Sunday, July 23, 2006

Presentation by ORION: give aways + jobs

There is a presentation by ORION on the 3 August at noon in SSLB3. They are given away a portable playstation! There are more good reasons to attent: Orion is one of the biggest Java shops in NZ and has employed our graduates in teh past. E.g. Jonathan Wright (Jared's brother) is working for them.

Java Actions

Java Actions let you move all gui component logic to an Action object, allowing it to
be used in multiple places (i.e. appear in multiple places in the gui).
There is clearly no reason to have any more than one Action object of
each type (I believe) - so that means Actions are inherently singletons.

If that is correct, does Java treat each Action as a singleton, or
should I explicitly make them all singleton classes.

The question arises due to code like this:

JMenuItem helpItem = new JMenuItem(new HelpAction());
.....
JButton helpBtn = new JButton(new HelpAction());

I have spent a bit of time rewriting the GUI components to deal with
Actions, as they tidy the code up quite considerably.

Cheers,
Jonathan.

Non-deterministic plugin loading and menubar item ordering

I was wondering if anyone knew in Eclipse how they went about placing menus
in the top menu bar. For example, how do they position 'Edit' after
'File', and how does the WOP plugin menu get added in the
place it was added.

This is the current problem I'm wanting to refine in Centruflow - as
little tweaks throughout my system can result in menus moving all around.

Cheers,
Jonathan

Wednesday, July 19, 2006

Opening files in Java

I have spent a bit of time tonight looking into ways of opening files in Java such that they are loaded using their default viewer (i.e. loading MS Word documents in MS Word). There are the hacks that makes the OS-independent believer in me cringe, for example:
Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL \""+fileName+"\"");
and
Runtime.getRuntime().exec(
"cmd /c \""+fileName+"\"");

Both will equivalently load any (?) file, but only within Windows...

Then I stumbled upon two similar projects:
The JDIC library and similar functionality in the soon-to-be released Java 6.
Both of these abstract away the underlying way in which to load the files.
This is mighty handy, and so I thought I'd post it here to let everyone know.

Cheers,
Jonathan Giles.

Wednesday, July 05, 2006

Java Properties Rant

[rant]
Grrrr, Sun's annoying me. I've been wasting my time trying to get a problem fixed that I don't think can be fixed other than by emailing Sun - but there is a chocolate fish there for anyone that solves this for me :)

Basically, Properties in Java can now be XML. I thought "swell, let's use that". As specified in the JavaDoc here it is necessary to include the DTD reference at the top of the properties file. That is no problem, as the file contents is listed on the page. When I save the xml in XML Spy however, it complains that the DTD is invalid. Looking at the file 'http://java.sun.com/dtd/properties.dtd', it is slightly different than what is on the page: it now has a nice copyright message and whitespace. It appears that this is causing the DTD to be invalid. It doesn't matter, the Properties object still happily parses it so no problem there.

Today I wrote some code to actually change property values and write them back to the XML (retaining all comments, etc). I set the DocumentBuilderFactory to not validate the file, as I knew it wasn't valid thanks to Suns DTD. However, I still get errors when trying to parse it due to the unexpected statement in the DTD.

I thought I could get around this by copying the DTD to my local codebase and using it there - but the Java Properties object expects a hard coded reference to their DTD or else it fails - so there goes that idea.

As far as I can tell, Sun is the single point of failure in my code, and they decided to fail.

Anyone have any ideas? It appears others have found my problem, like here.
[/rant]

Please let me know,
Jonathan Giles.