Monday, November 29, 2004

Get Stylin'

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.



I wrote the

November newsletter editorial
for the Creator site; it covers using CSS styles and components to make better looking web applications. We're going to incorporate more of this in sample applications too.




Tuesday, November 23, 2004

Component Writer Tips

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


If you're writing a JSF component, there are a couple of things
you can do to make the component behave more nicely at design
time. (Well, there are actually a lot of things you can be doing,
and we'll document these shortly, such that your components
can have the same rich designtime behavior in Creator that for example the
standard JSF data table has.)



Anyway, some of these techniques are general beyond the Creator JSF
designtime library:



First, in your renderer, which generates HTML from the JSF component,
you can check the
Beans.isDesignTime() property. If set, the component
is being rendered during design time preview of the component,
so you can change what you render accordingly. For example,
if you have a "container" component, and it has zero children,
at runtime you probably want your container to render nothing, but
at design time you should render something to show the user
your component; for example, you can set up a particular size
for your component or render some explanatory text within the
container. This example for simplicity just sets the background color to red:


if (Beans.isDesignTime() && component.getChildCount() == 0) {
writer.writeAttribute("bgcolor", "red", null); // Ugly example
} else {
...



Another thing you can do is include images from your component library
at designtime -- these don't need to be included in the user's project
since they are just shown at design time and are therefore available
to the IDE:


if (Beans.isDesignTime() && component.getChildCount() == 0) {
// Show special design time icon
writer.startElement("img", component);
URL url = MyClass.class.getResource("myicon.png");
writer.writeURIAttribute("src", url, null);
...



Finally, I've

already mentioned
how you might want to set the
default property for your component to improve the design time
handling of this component.


Sunday, November 21, 2004

Back In Business

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I just got back from a really nice week in Prague. I got to see
some demos of upcoming NetBeans features. Unbelievably cool.
The form editor has a new design mode which is just going to,
well, kick ass. No more

gridbag, dude
.
The new mobile stuff is also fantastic. NetBeans is really
getting fabulous.



What's the deal with airports and power sockets? I really wanted to
connect my laptop while waiting for my next flight (and the battery
was flat) yet I couldn't find a place to plug in anywhere in Frankfurt
airport.
I had the same experience last year at Heathrow. That time I finally found
one in the middle of nowhere, but as soon as I had gotten comfortable
security came by and told me to leave because there's some kind of
"danger" with having people connect their own hardware to the airport power
net. In Frankfurt I walked around for 45 minutes before locating a
place to plug in -- at the airport McDonalds. So I was lovin' it...


Thursday, November 11, 2004

Slow Application Outline?

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I recently mentioned the component default properties being shown inline in the application outline, as of Creator patch 3. Turns out there's a performance issue related to this for components whose default property is a value bound expression -- such as an output text in a data-bound data table for example. If you're noticing sluggish performance (this will most likely be the case if you're using a database that is not running locally) try hiding the application outline.



I've just fixed this, so look for the fix in the next patch if this affects you.


TGIF!

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.





It's been quite a week. We had a deadline for an internal milestone
this week, so we've been up coding late every night - I even pulled
an all-nighter Wednesday. Working hard to improve Creator, people :-)
The next version will have some important fixes in it. Yes, I have
to be vague or I will be arrested by the You Can't Promise Anything
Police...



Today my youngest son had a CAT scan in preparation for surgery in the next month;
the picture on the right is from his other scan.



Next week I'm heading out to
Prague
for some interesting engineering discussions. I've been there before
-- it's a beautiful city full
of nice people and good food, so I'm really looking forward to it.




Wednesday, November 10, 2004

Anatomy of a Creator JSF Application

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I've written an article for the developers.sun.com Creator site which describes how a Creator application is put together, from the JSPX markup and stylesheets to the page beans and navigation files.
You can read Anatomy of a Java Studio Creator Application here, but be sure to check out the other resources added this month as well, around the theme of JSF components.



Sunday, November 7, 2004

Source Code Profanity

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


The source code for J2SE 5.0 has been made available. Slashdot covered the event, and one of the posts
showed that the community has already

poured over the source code in an attempt to clean up its quality...



I immediately started a search command on the current Creator source to see if we have any juicy comments I can share with you.... But we don't. I tried successively less "offensive" words, and the only hits I got were for "stupid" and "lame"...


xxx/Utilities.java: * is really lame. The problem is that at the top level, I need
xxx/DnDSupport.java: // insertTab is too stupid to notice that inserting a tab at the



This brought back some good (?) memories though. I used to work on
Sun WorkShop, the C/C++ IDE for Solaris from Sun, and one of the really nice things about the IDE was that it integrated (not emulated) the XEmacs and vi editors. So we shipped XEmacs with the product. Well, XEmacs came with a bunch of supporting packages, such as Zippy -- which had a large database of insults copackaged with it, ready to be automatically attached as e-mail signatures etc. People actually complained about this, so we removed some of these, and we added a script to the emacs source tree integration process which scanned for a list of "offensive words" and yanked elisp packages containing them!


Thursday, November 4, 2004

Default Properties

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.



Here's another feature in patch 3: the application outline shows the
most important property in a component. For example, if you have
four buttons in the outline, how do you know which one is which?
Most likely the buttons will have different labels, and as you can see
from the screenshot, the button labels now appear next to the instance
names.



This relies on the

default property

of a component. As you can see, the default property for a button is its label (value)
property. For images, it's the (base) filename of the image. For
a hyperlink, it's the url, and for a text component it's the actual
text shown.



Note that you can quickly edit these properties. Click on a component,
such as a button. Now just start typing. Keyboard focus will transfer
to the property sheet, scroll to the default property, and you have
started editing it.



For html tags there's no instance name (since the html markup
does not appear in the page beans), but if tag has an id or
name
attribute, those are shown next to the tag name.




Tuesday, November 2, 2004

Creator Review

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I've got a couple of external links to share. First,
App Dev Trends have
reviewed Creator
- 4/5 stars.
Second,

here's an interview with Tim Boudreau
who's done some
really great work on NetBeans, including the Navigator module I can't
live without; I hope it's made part of the standard distribution
soon. I've met Tim several times, last time at JavaOne this summer at
the Creator launch party, and he's a really nice guy. The interview
mentions some future trends for NetBeans which I can't wait to use.



I've been doing a lot of debugging lately (which I use NetBeans 3.6
for), but I decided to take 4.0 beta2 for a test spin. Wow. In addition to
improvements for various usability issues

I had brought up in the past
, there are lots of other improvements.



I really like the new project system. I'm using my own ant files - the
same ones used by release engineering for Creator - and I can run,
debug, and test the project. I've also got Fix & Continue working
now. There's a new special target in my ant file such that when ant is
run inside the IDE, the ant target causes the freshly built class files
to be hotswapped into the running target VM. Unlike the old fix &
continue action, where I'd have to wait about ten seconds, fix and
continue now takes about two seconds.



The new code editor stuff seems to work well too -- I've used rename
refactoring, find usages, and fix imports.



I noticed some sluggishness in one area of my code, so I think I'll
have to check out their new
Performance Profiler as well!



I'm not just happy with these NetBeans changes because they make me more
productive. Creator is built on top of NetBeans and will take advantage
of many of these features when we upgrade to the 4.0 platform.



Happy U.S. election day folks, now do your duty and go and vote! It's
not like it's hard to choose this time.