David Botterill's Weblog

« Previous month (Aug 2007) | Main | Next month (Oct 2007) »

20071027 Saturday October 27, 2007

No Java 6 on Mac OS X Leopard

This picture says it all!

no jdk6


If you're thinking about upgrading to Leopard and you do Java development on your Mac (at least try to), don't bother.  I searched for hours trying to find Java 6 on Leopard and it just isn't there.  I did install some documentation pack but I can't even find it after I installed.  Honestly, I only bought the Leopard upgrade for Java 6.  There's really nothing else that is noticably worth it so far.  My fan control stopped working.  I have about a 1 year old Macbook Pro "17 with the core duo.  So now I have a hot Mac again. :(  Things actually seem more sluggish than before.  I already had to restart Finder which I NEVER had to do on Tiger.  All in all, as a Java developer, I might have to move off the Mac OS X platform.  This hardware is just too expensive to boot into some inferior OS like Windows.
Posted by David Botterill ( Oct 27 2007, 07:44:28 AM MDT ) Permalink Comments [11] del.icio.us | digg | technorati

20071016 Tuesday October 16, 2007

NetBeans 6.0: Ask The Experts on SDN October 22, 2007

Remember that burning question you had about NetBeans 6.0?  Well now is your chance to get that question answered.  I will be involved in a Sun Developers Network "Ask the Experts" starting October 22, 2007.   Brian Leonard, a fellow NetBeans Evangelist, as well as Judith Lilienfeld, my manager and Director of Tools Evangelism at Sun will also be on the panel.

Posted by David Botterill ( Oct 16 2007, 01:18:01 PM MDT ) Permalink Comments [0] del.icio.us | digg | technorati

20071013 Saturday October 13, 2007

NetBeans 6.0: Making Me a KeyBoard Junkie

I was recently at a conference giving a demo for the new NetBeans 6.0 editor features.  In preparing for the demo and actually doing it,  I realized that reducing keystrokes is huge for developers.  I've been so accustomed to broken IDEs where I had to cursor and mouse around that I didn't realize how much NetBeans 6.0 editing has improved until I was in the middle of this demo.  I actually got a rush hitting the "Enter" key and seeing smart code completion save me lots of keystrokes.  I'm becoming a keyboard junkie (no sneering from the emacs crowd) so now I'm looking for more keystroke saving key bindings.  A great resource to get started on Java editor enhancments in NetBeans 6.0 is the Java Editor User's Guide on the NetBeans public Wiki.  Two keystroke and mouse saving features I recently found useful are AST (Abstract Syntax Tree) selection and Next/Previous Tab.

The AST (Abstract Syntax Tree) keymap is listed in the "Tools->Options" (Preferences on Mac OS X) under the "Keymap" heading.  The actual setting is "Other->Select Next Element/Select Previous Element".  This lets you select things like a keyword, a line, and a block of code.  The default key mapping is "Alt-Shift-PERIOD" (Ctrl-Shift-PERIOD on Mac OS X) to select more and "Alt-Shift-COMMA" (Ctrl-Shift-COMMA on Mac OS X) to select less.

I found out about Next/Previous Tab in Gregg Sporar's blog.  But I couldn't get this to work so I did some investigation.  On Mac OS X the default key binding to do a Next Tab is "Meta-PAGE_DOWN".  To get this to work you need to press "Meta-Fn-PAGE".  Pressing three keys at once really doesn't save me much so I remapped this to "Meta-DOWN" and "Meta-UP".  Note that you will have to "Remove" these key mappings from the "Other->Insertion Point to End of Document" and "Other->Insertion Point to Beginning of Document".

mapping1


Above all, trying hitting the "Enter" key when you're doing code completion and you'll be amazed at just how smart the code completion really is.  Happy keyboarding!


Posted by David Botterill ( Oct 13 2007, 11:55:31 PM MDT ) Permalink Comments [3] del.icio.us | digg | technorati

20071001 Monday October 01, 2007

Code to Make a Tag Cloud in Wicket

 
       Form form = new Form("form");
        add(form);

        final TextField field = new TextField("field", new Model(""));
        form.add(field);

        final Label label = new Label("selectedValue", new Model(""));
        label.setOutputMarkupId(true);
        form.add(label);

        CategoryCount[] counts = getPluginSystem().getCategoryCounts();
        List countsList = Arrays.asList(counts);

        final DataView repeater = new DataView("cloud", new ListDataProvider(countsList)) {

            protected void populateItem(final Item item) {

                MyLink link = new MyLink("link");

                item.add(link);


                String categoryName = ((CategoryCount) item.getModelObject()).getCategoryName();

                String categoryStart = getCurrentPrefix();
                if (null == categoryName) {
                    link.setVisible(false);
                    return;
                }
                /**
                 * If the category doesn't begin with the typed in prefix, don't add it to the cloud.
                 */
                if (null != categoryStart && null != categoryName) {
                    if (!categoryName.toUpperCase().startsWith(categoryStart.toUpperCase())) {
                        link.setVisible(false);
                        return;
                    }
                }

                Label label = new Label("text", ((CategoryCount) item.getModelObject()).getCategoryName());
                Model model = new Model() {
                };
                AttributeModifier am = new AttributeModifier("style", new Model() {

                    @Override
                    public Object getObject() {
                        return getLinkStyle((CategoryCount) item.getModelObject());
                    }
                });
                label.add(am);

                link.add(label); //the Caption property ought to be picked up by reflection
                //or you could create a subclass of AbstractReadOnlyModel to
                //fetch it if reflection bothers you
            }
        };

        add(repeater);
        /**
         *  We need to set the output markup id so it can be used as an AJAX target
         */
        setOutputMarkupId(true);
        /**
         *  Now set up the AJAX handling
         */
        OnChangeAjaxBehavior onChangeAjaxBehavior = new OnChangeAjaxBehavior() {

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                setCurrentPrefix(field.getModelObjectAsString());
                target.addComponent(getCloudPanel());
            }
        };
        field.add(onChangeAjaxBehavior);
Posted by David Botterill ( Oct 01 2007, 07:20:19 PM MDT ) Permalink Comments [0] del.icio.us | digg | technorati