RepositoriesViewCommandHandler<RepositoryTreeNode> {
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RepositoryTreeNode> nodes = getSelectedNodes(event);
RepositoryTreeNode node = nodes.get(0);
IWizard pushWiz = null;
try {
switch (node.getType()) {
case REF:
Ref ref = (Ref) node.getObject();
pushWiz = new PushBranchWizard(node.getRepository(), ref);
break;
case TAG:
pushWiz = createPushTagsWizard(nodes);
break;
case REPO:
pushWiz = new PushWizard(node.getRepository());
break;
default:
throw new UnsupportedOperationException("type not supported!"); //$NON-NLS-1$
}
} catch (URISyntaxException e1) {
Activator.handleError(e1.getMessage(), e1, true);
return null;
}
WizardDialog dlg = new WizardDialog(getShell(event), pushWiz);
dlg.setHelpAvailable(pushWiz.isHelpAvailable());
dlg.open();
return null;
}