Conny Lundgren

On Agile, Development, Mac, Technology and life in general.

Leopard Trick: Latest App, Doc, Server Etc.

| Comments

Just a quick tip for the Leopard users out there, to have a stack in the dock which reflect you Recent Applications, Recent Documents, Recent Servers, Favorite Volumes or Favorite Items simply do the following

Fire up a terminal and enter

defaults write com.apple.dock persistent-others -array-add ‘{ “tile-data” = { “list-type” = 1; }; “tile-type” = “recents-tile”; }’

Followed by a restart of the dock with the trusted

killall Dock

There should now be a new stack on your dock, change the “mode” by right(ctrl) clicking the stack to change what the stack shows.

No JDK6 With OS X 10.5 Leopard

| Comments

So what’s up with Java on the Mac? After the initial chock of Apple not mentioning anything about Java 6 support in Leopard, as well as pulling the alpha/beta release from ADC a while ago the future of Java as a first-class citizen on the Mac has been questioned around the blogosphere..

Well having just installed Leopard on my MacBook Pro (The upgrade was painless, 30min) I can say that JDK 6 is not included in Leopard, those of you might remember that JDK 1.5 shipped exclusivly with the Tiger release, and I was really expecting the same this time.

Hopefully (and most probably) Apple will release a JDK 6 sometime, but the real question here is “sometime”, how long can you afford to wait? (For the record Sun released JDK6 almost a year ago at December 11 2006)

So how does this effect you? Personally I am not that effected since I mostly do Enterprise development, but I could use the speedup in JDK6 for running IDE’s and other tools.

OS X “must-have” Software, Revisited

| Comments

Following up on a popular, but somewhat outdated list of my “must-have software for OS X”, some applications remains the same and some have been replaced.

Without further ado.

Bonecho (Firefox) - Nothing to say really, Firefox native build, some usefull plugins I use Adblock, Google Browser Sync, Google Gears, PDF Download, Server Spy, Stylish, Better Gmail, del.icio.us Bookmarks ) CoreDuoTemp Disco MagicDraw UML MailActOn Mailplane MailTags MenuCalendarClock iCal OmniDazzle Quicksilver SlimBatteryMonitor Skype SpamSieve SCPlugin Textmate The Unarchiver UNO Yep VMWare Fusion

Web Beans

| Comments

In case someone missed last weeks post from Gavin about the JSR299, be sure to take a peak since there are some really nice features, and should give you a better understanding of what to expect when we hit public draft.

Netbeans, Subversion and Mac

| Comments

NetBeans has SVN support pretty much out-of-the-box, but on OS X you will be presented with the not so obvious message

NetBeans Subversion support requires Subversion 1.3 executable!

Install Subversion 1.3 (http://subversion.tigris.org) or later, add it to PATH, test by running ‘svn –version’ from command line, and finally restart IDE, please

Since I apparently has forgotten how I made it work before here is the instruction for future reference, hopefully this will save me (and perhaps others) from some frustration.

  1. Fire up a terminal

  2. Navigate to your Netbeans installtion folder like

cd /Applications/NetBeans5.5.app/Contents/Resources/NetBeans/bin

  1. Open the netbeans file in your favorite editor

  2. On the first line (after comments) add

PATH=$PATH:/usr/local/bin:/usr/local/sbin
export PATH

  1. Save the file, and restart NetBeans

Your all set!

JSF Tags Reference

| Comments

While working on some custom renderers last week I one again found myself searching for the Component Type and Family for any given renderer, so here is a compilation of render-types for future reference.

Say what you want about JSF, but the concept of renderers is a feature I really like, and is one area where JSF actually shines (No this is not intended as flame bait).

Tag Name Component Family Component Type Renderer Type

h:column

javax.faces.Column

javax.faces.Column

-

h:commandButton

javax.faces.Command

javax.faces.HtmlCommandButton

javax.faces.Button

h:commandLink

javax.faces.Command

javax.faces.HtmlCommandLink

javax.faces.Link

h:dataTable

javax.faces.Data

javax.faces.HtmlDataTable

javax.faces.Table

h:form

javax.faces.Form

javax.faces.HtmlForm

javax.faces.Form

h:graphicImage

javax.faces.Graphic

javax.faces.HtmlGraphicImage

javax.faces.Image

h:inputHidden

javax.faces.Input

javax.faces.HtmlInputHidden

javax.faces.Hidden

h:inputSecret

javax.faces.Input

javax.faces.HtmlInputSecret

javax.faces.Secret

h:inputText

javax.faces.Input

javax.faces.HtmlInputText

javax.faces.Text

h:inputTextarea

javax.faces.Input

javax.faces.HtmlInputTextarea

javax.faces.Textarea

h:message

javax.faces.Message

javax.faces.HtmlMessage

javax.faces.Message

h:messages

javax.faces.Messages

javax.faces.HtmlMessages

javax.faces.Messages

h:outputFormat

javax.faces.Output

javax.faces.HtmlOutputFormat

javax.faces.Format

h:outputLabel

javax.faces.Output

javax.faces.HtmlOutputLabel

javax.faces.Label

h:outputLink

javax.faces.Output

javax.faces.HtmlOutputLink

javax.faces.Link

h:outputText

javax.faces.Output

javax.faces.HtmlOutputText

javax.faces.Text

h:panelGrid

javax.faces.Panel

javax.faces.HtmlPanelGrid

javax.faces.Grid

h:panelGroup

javax.faces.Panel

javax.faces.HtmlPanelGroup

javax.faces.Group

h:selectBooleanCheckbox

javax.faces.SelectBoolean

javax.faces.HtmlSelectBooleanCheckbox

javax.faces.Checkbox

h:selectManyCheckbox

javax.faces.SelectMany

javax.faces.HtmlSelectManyCheckbox

javax.faces.Checkbox

h:selectManyListbox

javax.faces.SelectMany

javax.faces.HtmlSelectManyListbox

javax.faces.Listbox

h:selectManyMenu

javax.faces.SelectMany

javax.faces.HtmlSelectManyMenu

javax.faces.Menu

h:selectOneListbox

javax.faces.SelectOne

javax.faces.HtmlSelectOneListbox

javax.faces.Listbox

h:selectOneMenu

javax.faces.SelectOne

javax.faces.HtmlSelectOneMenu

javax.faces.Menu

h:selectOneRadio

javax.faces.SelectOne

javax.faces.HtmlSelectOneRadio

javax.faces.Radio

SVN, Fix “Can’t Convert String From ‘UTF-8’ to Native Encoding:”

| Comments

Well getting back from vacation I tried to update one of my subversion repositories, and I were once more met with the “Can’t convert string from ‘UTF-8’ to native encoding:” , luckily it is easily fixed. This problem is caused by filename containing “special” characters (in my case Swedish ÅÄÖ).

[conlun@mbp:/]$ export LC_CTYPE=en_US.UTF-8

Verify you changes by running

[conlun@mbp:/]$ locale LANG= LC_COLLATE=”C” LC_CTYPE=”en_US.UTF-8” LC_MESSAGES=”C” LC_MONETARY=”C” LC_NUMERIC=”C” LC_TIME=”C” LC_ALL=”C/en_US.UTF-8/C/C/C/C”

Boosting You Productivity in Eclipse Using Shortcuts

| Comments

Recently a team member approached me wanting to switch IDE from the corporate standard Borland JBuilder to Eclipse, and she asked if I had some nice advice to boost productivity. Well using keyboard shortcuts is IMHO a huge productivity booster, and I compiled a list of my 13 most used shortcuts I find useful in my everyday work.

The hard part about shortcuts is that I never seem to be able to say which combination to press, they are just subconscious. Start saving some time, learn them, perhaps not all but everyone of them will save you quite some time over a day of use.

Note: If your using OS X exchange CTRL with the Command key

So buckle up, and start being more productive right now..

Open type (ctrl + shift + T)

This will open up a class in the workspace (or in dependencies such as jar- files), the dialog accepts wildcards (for instance *Action), another nifty feature are the CamelCase notation to quickly open a file, for instance if you want to open the class HotelBookingAction entering HBA´would give you the correct result right away, and save you some typing.

Open Resource (ctrl + shift + R)

Same tip as above, but it works on every resource (.jsp, .properties, .xml etc) in your workspace, same tips for wildcards as above applies.

Navigate to member (ctrl + O)

You know, even if you probably shouldn’t you have some class which is really large, several hundreds of code, maybe even thousands. How do you navigate to a member (method, variable) one option (and most often used) is to search for it using Ctrl + F, it’s really not that efficient, instead use this short cut to list all the methods, to narrow the list start typing the method name navigate to the one you want with the arrow keys and press enter. Even more, press the key another time and it will show you the inherited members.

Go to Line (ctrl + L)

Often you find a line number when digging through stack traces and such, to simply go to a line in the open file press Cmd + L and enter the line number.

Go to last edit (ctrl +Q)

Do you know the scenario when you edit your large class file, and you change something in one method, and want to go to the last thing you edited in before this? Instead of browsing to the previous method, finding the right spot use this command to jump right back to the last edit, use it multiple times to track back in history.

Show type hirarchy (ctrl + T)

This one took me quite some time to find, usually i just jump to the top of the class, find the supertype and hit F3 to open the supertype, with this the power are at your fingertips.

Go to open editor (ctrl + E)

I often keep some 10 editor windows open at any given time (or more), if you want an easy way to switch between open editors try this command, either select the file you want to bring to the front, or start typing to narrow the results down a bit.

Next error/warning (ctrl + +.

This command will cycle through the errors/warnings in the current file, instead of using the Problems view. I tend not to use this so often, the this since the short not that intuitive (easily fixed by remapping, but then I would go nuts when using another machine).

Move block of code (alt + arrow up/down)

Often find yourself copying and pasting code while moving around declarations, or whole block of code? No more, this shortcut will move a line (or block) of code up/down one line much easier and faster than cut’n’paste.

Block comment/uncomment (Shift + Ctrl + /)

Instead of commenting out blocks of code with / / use this, it will make every selected line commented out with a // , to remove the comment invoke this again to remove.

Search workspace for references (ctrl + shift + G)

Do you want to know if anyone is calling your method, or using the variable? Find the method, invoke this command and se the results of all references in the workspace.

Reformat code (ctrl + shift + F)

Apply the current code formatting set to the open file, this one is pretty much etched in mine spine doing this just before I commit/save a class.

Organize imports (ctrl + Shift + O)

Do you want to keep you imports nice and tidy, and organized according to the preferences?

JSR 316 a.ka Java EE 6

| Comments

Posted yesterday were the JSR316, or the umbrella JSR for EE 6. (well it was posted as JSR313 a while ago). So the news?

Included “new” JSRs

  • 196
  • 236
  • 237
  • 299
  • 311 As well as updated versions of EJB, JPA, Servlet, JSF, JAX-WS, and the Java EE Connector API.

Good news nonetheless.