use of org.eclipse.egit.ui.internal.repository.tree.RepositoryNode in project egit by eclipse.
the class RemoveOrDeleteRepositoryCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RepositoryNode> selectedNodes = getSelectedNodes(event);
if (selectedNodes.size() != 1) {
return null;
}
Repository repository = selectedNodes.get(0).getObject();
if (repository == null) {
return null;
}
String repositoryName = Activator.getDefault().getRepositoryUtil().getRepositoryName(repository);
String message = MessageFormat.format(UIText.RemoveOrDeleteRepositoryCommand_DialogMessage, repositoryName);
String[] buttonLabels = { UIText.RemoveOrDeleteRepositoryCommand_RemoveFromViewButton, UIText.RemoveOrDeleteRepositoryCommand_DeleteRepositoryButton, IDialogConstants.CANCEL_LABEL };
MessageDialog dialog = new MessageDialog(getShell(event), UIText.RemoveOrDeleteRepositoryCommand_DialogTitle, null, message, MessageDialog.QUESTION, buttonLabels, 0);
int result = dialog.open();
if (result == 0) {
// Remove from View
super.removeRepository(event, false);
} else if (result == 1) {
// Delete Repository...
super.removeRepository(event, true);
}
return null;
}
use of org.eclipse.egit.ui.internal.repository.tree.RepositoryNode in project egit by eclipse.
the class FetchCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RepositoryNode node = getSelectedNodes(event).get(0);
try {
WizardDialog dlg = new WizardDialog(getShell(event), new FetchWizard(node.getRepository()));
dlg.setHelpAvailable(false);
dlg.open();
} catch (URISyntaxException e1) {
Activator.handleError(e1.getMessage(), e1, true);
}
return null;
}
Aggregations