Recently in Java Category

Eclipse Juno Themes on Windows

I’ve been running Eclipse Juno regularly since the M5 milestone.  One of the things I’ve really noticed is that the default theme for Eclipse Juno on Mac OS X blends in better with other Cocoa applications than Juno looks on my Windows machines. Today I just realised that this is because Eclipse is picking up the Eclipse “Windows XP Blue” theme by default. Below is a picture of Juno RC3 with a Windows Explorer window over it for comparison.

Eclipse Juno RC3 on Windows XP Release Preview

To change the theme, go to Window, Preferences, General, Appearance and select Windows 7.  This looks a lot better on my Windows 8 Release Preview machine as shown below.

Eclipse Juno RC3 on Windows XP Release Preview with Windows 7 theme

Now, one of the great things about e4 is that it is skinnable using CSS.  I thought I’d knock up a quick stylesheet to get rid of the gradient in the toolbar and tidy up a few other little things.  It’s also really easy to define a theme as part of the plugin.xml and only have it apply to people running Windows 8 – simply add the following (note the condition on OS version of 6.2):

<extension
point="org.eclipse.e4.ui.css.swt.theme">
   <theme
         basestylesheeturi="css/e4_default_win8.css"
         id="org.eclipse.e4.ui.css.theme.e4_default"
         label="Windows 8 Desktop"
         os="win32"
         os_version="6.2"
>
   </theme>
</extension>

This is what my Windows 8 theme for Juno currently looks like against explorer:

Eclipse Juno RC3 on Windows XP Release Preview with custom theme

Needs a bit of playing with (for example, I’ve noticed that swapping themes in Eclipse works a lot better if you explicitly override things like the background images that have been used previously in themes in that Eclipse session rather than just leaving them not set).  What do you think?  If you are interested the CSS is below but it’s just a subtly changed version of the default win7 theme.

@import url('e4_basestyle.css');
.MTrimmedWindow {
    background-color: #EFF6FE;
}

.MPartStack {
    font-size: 9;
    font-family: 'Segoe UI';
    swt-simple: true;
    swt-mru-visible: false;
}

.MTrimBar {
    background-color: #EFF6FE;
}

.MToolControl.TrimStack {
    frame-image:  url("./win7TSFrame.png");
    handle-image:  url("./win7Handle.png");
}

.MPartStack.active {
    swt-unselected-tabs-color: #F3F9FF #D0DFEE #CEDDED #CEDDED #D2E1F0 #D2E1F0 #FFFFFF 20% 45% 60% 70% 100% 100%;
    swt-outer-keyline-color: #B6BCCC;
}

#PerspectiveSwitcher  {
    background-color: #E1E6F6 #EFF6FE 100%;
}

#org-eclipse-ui-editorss {
   swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
   swt-unselected-tabs-color: #F0F0F0 #F0F0F0 #F0F0F0 100% 100%;
   swt-outer-keyline-color: #B4B4B4;
   swt-inner-keyline-color: #F0F0F0;
   swt-tab-outline: #F0F0F0;
   color: #F0F0F0;
   swt-tab-height: 8px;
   padding: 0px 5px 7px;
}

CTabFolder.MArea .MPartStack, CTabFolder.MArea .MPartStack.active {
   swt-shadow-visible: false;
}

CTabFolder Canvas {
  background-color: #F8F8F8;
}


Anyway, lesson from this is to at least change the theme in Juno on Windows 8 from Windows XP Blue to the Windows 7. The jury is still out on my customized stylesheet above – I’m sure someone with some actual design skills could do better.

Speaking at EclipseCon 2010

EclipseCon 2010 Tomorrow I will be making my making my maiden talk at EclipseCon in Santa Clara.  I’ve been at the conference all week manning the Microsoft booth and sneaking along to sessions when possible.  I have to say that I’ve really enjoyed my week here.  The conference has a very “un-conference” feel and the calibre of attendees is incredibly high.  I’ve learnt a lot just by joining in hallway conversations and it has been a surreal experience at times chatting with some of the folks that contributed parts of the code that I use on a daily basis or folks that have fixed up and committed the patches that I have submitted.  The Birds of a Feather sessions have also been fantastic.

Many people have done a double-take at the company name on my badge this week – especially when I start bemoaning the difficulties of doing a headless PDE build or paging tables of data containing thousands of rows in an efficient manner via SWT virtual tables.  People are generally pleasantly surprised but intrigued and also pleased that Microsoft has developers using and developing for Eclipse.

So, tomorrow afternoon I’ll be giving my personal view on “The Life and Times of an Eclipse Developer at Microsoft Corporation”.  I have to admit that I’m a little nervous about my talk.  Usually when I’m talking I’m discussing the intricacies of Team Foundation Server or best practices in software development – topics that I’m comfortable with.  When it comes to Eclipse I’m clearly just an average developer and not the expert in the room.  Heck, I’m not even an expert with-in my own team.  I guess I have the advantage of being the only Eclipse developer in the room that works for Microsoft so at least the title of the talk helps :-)

Wish me luck.  If you are at EclipseCon then drop by the booth before or after the session to give me abuse and I’ll give you a pack of planning poker cards or some interoperability mints (gotta love conference schwag).

CruiseControl 2.7.2 Released

Jeffrey Fredrick just announced that CruiseControl 2.7.2 is now available for download: http://tinyurl.com/2zm9mz.

There are lots of bug fixes, lots of changes to the Dashboard and some new plug-ins, but the bit that is of most interest to me was (from the release notes)

TeamFoundationServer source control
----------------------
* Fix compatibility with Microsoft Visual Studio Team Foundation Server 2008 (CC-735). Submitted by Martin Woodward.

This was to work around an issue that came up when using CruiseControl (java version) to talk to a TFS2008 server (TFS2005 worked fine and still does).  If you are attempting to use CruiseControl with TFS 2008 then you should go with CruiseControl 2.7.2.  For that matter - if you are using CruiseControl.NET with TFS then you should also take a look at the latest release of the integration to TFS - as that contains the same fix allowing you to happily talk to a 2008 version of Team Foundation Server (also using the TFS 2008 client API's).

Anyway, congratulations to the CruiseControl team on the 2.7.2 release!

Teamprise 3.0 Ships!

| 3 Comments

At EclipseCon 2008 this morning, we just announced that Teamprise 3.0 has been released!  If you've been wondering why I have been quiet on the blog lately - but also why anything I have been talking about is Team Foundation Build related, then you are about to find out why :-)  First of all, I'd encourage you to go visit the shiny new website at http://www.teamprise.com.  Our marketing team had too much fun putting that together, including getting a real, live, massive Teamprise power button made up and shipped in a huge crate from New York to be photographed and used as the new site/icon image.

The full release notes are available here, but as has been the tradition for the past few Teamprise releases, I thought I would give you a run down of my favourite new features in the 3.0 release.

At a high level, the features in 3.0 can be summarised as:-

  • Full Team Foundation Build integration (including ability to execute Ant based builds)
  • Check-in policy support
  • Recursive folder compare
  • Single sign-on (from Microsoft Windows machines)
  • "Destroy" command for version control
  • Show deleted items and undelete from Source Control Explorer UI
  • much much more (see release notes)

While it is not my area, I should also mention that we've taken this opportunity to make our licensing more affordable for smaller teams.  We have been very pleasantly surprised by the number of people buying 1 to 20 licenses at a time.  Originally, Teamprise pricing was skewed to the Enterprise customers (i.e. simple, all inclusive and with steep volume discounts).  So we have done a couple of things to help out the smaller companies:-

  • You can now purchase the various components (Teamprise Plug-in for Eclipse, Teamprise Explorer, Teamprise Command Line Client) individually as well as the Teamprise Client Suite which gives you the lot.
  • We have lowered the initial prices for a single seat, meaning that people buying one or two licenses can now get the same discounts that used to only be available to folks purchasing 100.

If you have any licensing issues / queries then feel free to contact me, or you can talk to the sales team direct at sales@teamprise.com.  Anyway - back to the part of this release that I do know about - the technology. 

The first feature I want to talk about is one that I had no involvement with.  It's one of those features that many people will not notice because it just works but anyone who has done any Java to .NET web service interop work will instantly recognise as being a little bit clever.

Single Sign-On

New Teamprise Login Dialog

The initial log-in screen has undergone a big overhaul.  On Windows machines you are given the option to use "default credentials", i.e. the username and password that you are logged onto windows with.  It obviously doesn't know your password, but does some JNI magic to get the native Windows API's to handle the authentication logic with Team Foundation Server.  While you are also on the login screen, you may notice the Profile feature.  This is an area that many people probably won't use, but we added for our power users and for ourselves.  Basically, the profiles feature allows you to store sets of servers/credentials that you commonly use to connect to Team Foundation Server and then you can bring up the details using a simple drop down.  Makes it much easier to switch between your production TFS instance and your CodePlex project for example - or switch credentials if you are a TFS administrator.

Check-in Policy Support

In Visual Studio, check-in policies are implemented as a .NET assembly runs every time a policy is evaluated or configured.  The policy also has full access to the .NET API's, the Visual Studio API's as well as anything it might want to pinvoke out to on the Win32 API side.  As you can imagine, this presented us some problems when we wanted to have check-in policies that ran the same in Eclipse on Windows Vista as Teamprise Explorer on the Mac or Aptana on Ubuntu - therefore we have had to develop a parallel Teamprise check-in policy framework.

Teamprise Check-in Policies

As we were doing this, we took the opportunity to learn from some of the feedback folks have been having with the Visual Studio check-in policies.  While our framework and SDK will look very familiar to anyone that has developed a custom check-in policy for Visual Studio, you will notice some differences.

Firstly, we supply different policies out of the box.  The vast majority of custom check-in polices that people deploy are things like "Check for Comments" etc, so we just shipped the common ones our customers wanted to prevent them from having to write their own.

Secondly, we make use of the Eclipse plug-in framework to implement our policies as extension points.  This means that they are easy to deploy (using the Eclipse update site mechanisms built in to the IDE).  We have also separated the configuration (stored as a blob of XML data in our framework) from the implementation - represented by the plug-in deployed.  The again makes it easier to deploy, especially when it comes to version 2 of a policy...

Thirdly, all of our policies can be scoped by the path in version control to which they correspond - you are not limited to per Team Project scoping and you do not have to wrap your policies in a custom policy to get more detailed scoping like you do with the current Visual Studio framework.

Team Foundation Build Integration

Anyone that has been following this blog for a while, or who attended the Team Build talk I did at TechEd with Brian Randell, will notice that I have been increasingly involved in the inner workings of Team Foundation Build.  Now you can see the fruits of that labour.

Teamprise Build Explorer on Widows Vista

In Teamprise we now have full integration with the shiny new build functionality in TFS 2008 as well as support for TFS 2005.  Backwards compatibility with the TFS 2005 server is very similar to if you were using a Visual Studio 2008 client, accept that ours is slightly more backwards compatible (you can create new builds on a TFS 2005 server as well as manage build qualities etc).  However it is with TFS 2008 that you get to see the majority of the features.  I could go on about this aspect all day as their are so small things that I am proud of, but at a high level you can:

  • View existing build definitions
  • Manage builds in Build Explorer
  • Queue new builds
  • View build report
  • Edit Build Quality
  • Delete build
  • Manage Build Qualities
  • Open Drop Folder
  • New/Edit Build Definition
The following features are only available against a TFS2008 server:
  • Edit Retention Policies
  • Keep Build
  • Set Queue Priority
  • Postpone Build
  • Stop/Cancel Build
  • Delete Build Definition

One of the smaller features I will call out is that from the build definition in the Team Explorer, you can right click and do a "View Build Configuration" that will open the Source Control Explorer at the place in which the TFSBuild.proj file is stored so that you can check it out and edit it.  A feature that I added solely for my own sanity during dogfooding :-). 

Build Explorer on Mac OS 10.5 - click for a higher res image All this would be fairly academic, if you didn't have some way to do a cross-platform build using Team Foundation Build.  In the current release, we provide a the Teamprise Extensions for Team Foundation Build which basically Ant enables the Team Foundation build server.  The Teamprise extensions are a set of MSBuild targets that insert the Ant build process into the standard Team Build mechanism as well as a custom MSBuild We hope to extend this to support in the near future to some of the other common build/test tool-chains in the cross-platform world.  However, the Ant integration case will help a lot number of people out there.

Best yet, the Teamprise Extensions for Team Foundation Build are available free of charge for everyone - wether or not you are a Teamprise customer.  Also, if you want to see how they work and customize them to meet your own non-standard build system then the source is available under the permissive open source Microsoft Public License (MS-PL).

I would personally like to thank the Team Foundation Build Team (especially Buck Hodges and Aaron Hallberg) who have been incredibly helpful through the development of the build functionality in Teamprise 3.0 while they were also busy working on TFS 2008. 

Hopefully that gives you a quick flavour of Teamprise 3.0 and where we are going with this release.  If you head over to the new site now and take a look at the many improvements we've made, we'd love to hear what you think.

Radio TFS

| 5 Comments

radiotfs Paul Hacker, Mickey Gousset and I have recently started a Team System related podcast called Radio TFS.

While it is not going to win any awards any time soon, we've been having a lot of fun so we are going to continue to try and get one or two episodes out a month. If you have 40 or so minutes to kill, then feel free to take a listen and subscribe.

If you have any suggestions for topic or any questions about Team System that you would like answered then please drop us a line at radiotfs@gmail.com or visit the website at http://www.radiotfs.com.

Today's Big Launch

The blogosphere today is buzzing with news of the other launch happening today, but there is one a bit closer to my own heart - Eclipse 3.3 (Europa) has been released.  I'm downloading it right now.

I've been running Eclipse 3.3 since Milestone 3 at the start of the year, and as the releases have been coming out it has been getting better and better.  Interestingly, the download site today has broken down Eclipse into separate versions geared towards downloading the parts that different audiences are interested in - bringing the straight "Eclipse IDE for Java Developers" down to 78MB.  The version I need "Eclipse for RCP/Plug-in Developers" is a more substantial 153MB.

My immediate needs in Eclipse 3.3 was support for the Windows Vista native UI widgets (including things like the Vista tree control).  The version of SWT that was shipping at the time of Vista launch had a weird bug which caused the JVM to crash randomly, but was fixed early in the 3.3 codebase.  SWT in the 3.3 release has also got a version which renders using WPF rather than Win32.  I'm still not really sure what the reasoning behind a WPF version, but it is funny to compile Teamprise Explorer against this version of WPF and then zoom in using the magnification tool in Vista and everything is all smooth as it is vector based.  Performance sucks with the WPF version - but still.  With Teamprise Explorer compiled against the 3.3 Win32 SWT libraries, performance is super with the application looking more native on Vista than ones written using .NET 3.0.

Other the next few weeks I'm also going to try looking into some of the additional Europa projects.  The whole organization of the Eclipse Open Source project is very interesting to watch.  Today sees the simultaneous launch of 21 separate open source projects - many of which have dependencies on other projects.  The complexity is very interesting and yet (from the outside at least) seems to work impressively well.  Eclipse has been very good at doing releases every year, with substantial improvements as well as incremental changes.

As I write, I am 89% done downloading.  I'll let you know how I get on.  If anyone is queuing for the other launch, be sure to let me know how that goes.

So, the day after I get made a Microsoft MVP I do two posts about Java - go figure.  Anyway, today I had one of those moments where you thought you understood something and then realize you didn't and probably a lot of your code that you've written over the past 10 years doesn't work as well as you thought...  All this with the humble String.compareTo method.

Take the following strings:-

  • charlotte
  • Chloé
  • Raoul
  • Real
  • Réal
  • Rico

In .NET, if you want to perform a standard case insensitive, dictionary based comparison between two strings then you can use the String.Compare method.  This does a culture based, case insensitive comparison.

In Java, if you were to do use the Comparable interface which makes use of the standard String.compareTo method to sort a list, you would end up with:-

  • Chloé
  • Raoul
  • Real
  • Rico
  • Réal
  • charlotte

That is because compareTo looks at the unicode value of the character and sorts on that - which for those of us that tend to live in the ASCII range tends to work ok (only that lowercase letters come after the uppercase ones) - however if you have a language that uses one of the many other characters it doesn't work so well.  If you had a language where M comes before A in the alphabet you are totally screwed.

This is were you should be using the java.text.Collator class in Java.  The Collator class does locale sensitive string comparisons - i.e. allowing you to do a dictionary base sort of a set of strings.

Dope.  One of those classes I should have been using for a while...  I thought I was just being dumb, but then a couple of other people I mentioned this to were not aware of the issue so I thought it worth a blog post.

Archives

Creative Commons License
This blog is licensed under a Creative Commons License.