Twittering from NetBeans IDE
By Geertjan-Oracle on Feb 01, 2009
By the way, here's the NetBeans Twitter nest:
It wasn't long before I wanted to send my tweets from inside NetBeans IDE, instead of the web interface.
I found out here about Twitter4J. Right as I was thinking about how to integrate that into NetBeans IDE, I found out about Kishida-san's Twitter Plugin for NetBeans. While it seems to be doing the job perfectly well, it could go a few steps further. Firstly, it could become a better NetBeans Platform citizen by getting the user to set username/password in the Options window. Secondly, it could make use of explorer views rather than a JTable.
That's what I accomplished below and it's working exactly as one would expect:
I tried to put all the pieces around the editor, rather than within a window that dominates the IDE too much, because Twittering is always going to be an ancillary activity, rather than the central focus of NetBeans IDE users. So, for example, the status bar (thanks to this very simple instruction) contains the text field where I do my twittering. (Very simple: when I press Enter in that text field, the tweet is... twittered.) Notice also the Properties window, the Message window, and the explorer mode (which contains the images of my Twitter friends), all of which provide parts of the UI of the plugin. That, I believe, is how it is meant to be done. On top of that, there's an extension to the Options window, where the username and password are set, which are stored to the NetBeans user directory via the NbPreferences class.
Now, here's the puzzle for today. Which of the following coding activities do you think took up most of my time while creating the above plugin?
- Understanding the Twitter4J API classes.
- Figuring out how to resize the images.
- Synchronizing the windows with each other.
- Sending messages to Twitter from the IDE.
- Initializing Twitter from inside the IDE.
What do you think? With which of the above do you think I had (by far) the most trouble? (I spent more time on this than on everything else put together.)