I’ve always been curious about Netbeans but never quite made the transition. I remember how it saved me once while working on a Rails project because it was (and I think still is) the only viable ruby/rails debugger.

My biggest problem with it had always, and still is, aesthetics. It really does look clunky; especially on a Mac compared to TextMate or Eclipse, but recently it got a little better and I guess I’m a little more forgiving when it comes to looks.

I’ve been playing with it now for 2 days and some of strengths are starting to really win me over. First, importing an Eclipse project just works! You ask it to import it and get on with your life coding, debugging, and what have you. Second, the plugin architecture and update mechanisms just work, which, compared to Eclipse, is a huge step forward.

The project I imported uses TestNG, and unfortunately the plugin for TestNG doesn’t appear in the plugins repository right within NetBeans.

Here’s what you need to do to get TestNG working within the IDE. Download the plugin bundle from here and install it from the the Plugins dialog using the “Downloaded” tab:

Picture 3.png

Once installed, restart Netbeans. The only problem I found was that the plugin did not recognize the tests that already existed in the project so I had to recreate them by copying and pasting.

Picture 1.png

Running the test class is a matter of right clicking it and asking Netbeans to run the test class. The output is quite nice!

Picture 2 14-58-33.png

Yesterday I was creating a simple salesforce demo for one of our prospective clients. At the end of the day I decided it would be cool to show a google or live map of the account’s billing address. While it wasn’t really hard to put it together, it wasn’t also something that you could do with embedding a link in an S-Control.

Here’s are the steps:

  1. Create a new S-Control.
  2. Insert the code below into the S-Control.
  3. Change the Account layout page to include the SControl. I have mine at a 800 pixels wide so its better to create a single column section below the address (see the screen shots).
  4. Done!

I hope this helps someone :-).


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Live Map
</title>
<script charset="UTF-8" type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&amp;amp;amp;amp;amp;mkt=en-us">
</script>
</head>
<body>
<div id='myMap' style="position:absolute; width:800px; height:400px;"></div>

<script type="text/javascript">
//<![CDATA[
function getLatLong(layer, resultsArray, places, hasMore, veErrorMessage)
{
var ll = places[0].LatLong;
AddPin(ll);
map.SetCenter(ll);

}

function AddPin(ll)
{
pin = new VEShape(VEShapeType.Pushpin,ll);
layer.AddShape(pin);
map.FindLocations(ll,null);
}

var map = new VEMap('myMap');
var layer = null;

map.SetDashboardSize(VEDashboardSize.Small);

map.LoadMap();
layer = new VEShapeLayer();
map.AddShapeLayer(layer);

var address = "{!Account.BillingStreet}" +
"{!Account.BillingCity}"   +
"{!Account.BillingPostalCode}" +
"{!Account.BillingCountry}";
map.Find(null, address, null, null, null, null, null, null, null,null, getLatLong);

//]]>
</script>
</body>
</html>

Here are some screen shots of the results:

This is my new blog! If you had come here before you might have seen my older blog, about 3 years ago, where I wrote about politics, philosophy, and religion. Well, that’s now no more :). This blog will be dedicated to technology and may have the occasional post about philosophy or any random rant I may have.