* @param selectedRevision the revision to select when the dialog is displayed, or -1 to select the first item.
* @return the selected revision, or null if the dialog was cancelled.
*/
public Integer showDialog(String resourceName, int selectedRevision) {
RevisionHistory revisionHistory = isModuleChooser ? vault.getModuleRevisionHistory(ModuleName.make(resourceName)) :
vault.getWorkspaceDeclarationRevisionHistory(resourceName);
int[] availableRevisions = revisionHistory.getAvailableRevisions();
// Construct a set of available revisions.
Set<Integer> availableRevisionSet = new TreeSet<Integer>();
for (final int revision : availableRevisions) {
availableRevisionSet.add(Integer.valueOf(revision));