Posts from July 2007

Sun tech evangelist Netbeans will be getting first-class Groovy support

Posted

On Weds, July 18th, Gregg Sporar came to the Tampa Java Users Group and gave a presentation on NB 5.5.1 and some glances at NB 6.0 M10. During the talk, he mentioned several times of how the improvements were about bringing NB up to speed with the other IDEs. I couldn’t resist asking during the Q&A session when Groovy support in Netbeans will be brought up to speed with IntelliJ(ie code completion and Grails).

He mentioned Project Schliemann which can be used to add basic language support as a stopgap. He added that Tor Norbye(of Java Posse fame and referred to in the talk as the guy who added Ruby support) will be taking the lessons learned and adding Groovy first class Groovy support. There was no roadmap or time frame given other than after NB 6. Tor has been mum on the topic on the Java Posse. The most interesting point for me was that he said several people in the company questioned the motive behind adding Ruby support before Groovy support...So it seems we weren’t alone.

30Boxes Viewer

Posted

Without further ado, here is the 30Boxes widget I prepared for BarCamp but never got finished. Thanks to SwingX-WS, it was very easy to wrap REST calls, parse the responses, and react appropriately.

Here’s the wrapper function for deleting a Todo:


public void deleteTodo(todo) {
def response = session.get ("http://30boxes.com/api/api.php?method=todos.Delete" +
"&apiKey="+apiKey+"&authorizedUserToken="+authToken+
"&todoId="+todo)
def status = parseResponse(response.getBody())
if (status == "fail")
// Make this an option pane later
println "There was a problem deleting the todo."
}




The viewer works for simple creation and deletion of Todos and creation of Events. The pseudo-API(Groovy service layer) does have method calls for deletion of events[and some other stuff] but Swing was acting funny and I wanted to get it out the door since it wasn’t going to be feature-complete anyways. To run it with your own data, you must visit 30Boxes, get an API key and authorization token, and put them in the config.xml file. Unlike Facebook, these keys are per-user not per-application.

Concerning the layout, I used Nimbus for the look and feel. The task pane is nested inside a titled panel with a simple background painter applied to the title. Here is the code that draws the frame:

 frame = swing.frame(size:[300,300],defaultCloseOperation:WindowConstants.EXIT_ON_CLOSE) {
    titledPanel(title:"30Boxes Viewer", titlePainter:makeTitlePainter(), 
    border:new DropShadowBorder(Color.BLACK,15), size:[300,400],mousePressed:{menu.setVisible(true)}) {
        scrollPane() {
            taskPaneContainer() {
                todoPane = taskPane(title:"To Do:",layout:new MigLayout()) 
                eventPane = taskPane(title:"Events:", layout:new MigLayout())
            }
        }
    }

}

Download the Netbeans project here.

Enjoy!

btw, sorry about the formatting of the code snippets.

 

SwingXBuilder update

Posted

All’s been relatively quiet on the SwingXBuilder front. There has been a little bit going on though.

In an effort to have a full-fledged Groovy SwingX application, I’ve started working on a note-taking application like Tomboy. For the time being, its working title is GroovyNote. Instead of using XML files, I’m using Derby with a JPA middle-layer so that Groovy can manipulate plain objects and not deal with messy SQL calls, though Groovy SQL isn’t that bad really.

The remaining demo app from BarCamp which interfaces with 30Boxes is being rewritten. Some things were hard-coded in, some features are being added, and the Glossitope code is being taken out. Previously it was only able to view events and todos but not manage them.

My linux partition had issues after I had backed it up to try Foresight Linux. It seems the PnP bios is hosed so it’ll run but sound and video won’t work. I had originally thought it was a Foresight issue but it stayed when I reinstalled Ubuntu. So I’m stuck in Windows land for the time being. Hopefully it’s something that can be fixed by the kernel and I’ll just tough it out until Gusty comes out in October.

I’ve accepted an invitation to give a presentation in August at my local Java User Group here in Tampa. I did want to go to another BarCamp that month as well, having had a blast at my first but there aren’t any in FL and the ones that are worth flying to are only a day long, thus requiring a hotel stay($$$). Maybe BarCampDC will get more organized by then. I have fam close by.