use of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode in project egit by eclipse.
the class ConfigurePushCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RepositoryTreeNode selectedNode = getFirstOrNull(getSelectedNodes(event));
final String configName;
if (selectedNode instanceof RemoteNode)
configName = ((RemoteNode) selectedNode).getObject();
else if (selectedNode instanceof PushNode)
configName = ((RemoteNode) selectedNode.getParent()).getObject();
else
return null;
Dialog dlg = SimpleConfigurePushDialog.getDialog(getShell(event), selectedNode.getRepository(), configName);
dlg.open();
return null;
}
use of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode in project egit by eclipse.
the class FetchConfiguredRemoteCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RepositoryTreeNode node = getSelectedNodes(event).get(0);
RemoteConfig config = getRemoteConfig(node);
if (config == null) {
MessageDialog.openInformation(getShell(event), UIText.SimpleFetchActionHandler_NothingToFetchDialogTitle, UIText.SimpleFetchActionHandler_NothingToFetchDialogMessage);
return null;
}
int timeout = Activator.getDefault().getPreferenceStore().getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT);
new FetchOperationUI(node.getRepository(), config, timeout, false).start();
return null;
}
use of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode in project egit by eclipse.
the class ImportProjectsCommand method getMultipleSelectedProjects.
private List<String> getMultipleSelectedProjects(List<RepositoryTreeNode> pSelectedNodes) {
if (!multipleProjectsSelected(pSelectedNodes)) {
return Collections.emptyList();
}
ArrayList<String> paths = new ArrayList<>();
for (RepositoryTreeNode node : pSelectedNodes) {
String path = getPathFromNode(node);
if (path == null) {
return null;
}
paths.add(path);
}
return paths;
}
use of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode in project egit by eclipse.
the class ImportProjectsCommand method openWizard.
private void openWizard(ExecutionEvent event, List<RepositoryTreeNode> selectedNodes) throws ExecutionException {
IWizardDescriptor descriptor = findSmartImportWizardDescriptor();
if (descriptor == null || multipleProjectsSelected(selectedNodes)) {
RepositoryTreeNode node;
if (multipleProjectsSelected(selectedNodes)) {
node = findRepoNode(selectedNodes.get(0));
} else {
node = selectedNodes.get(0);
}
String path = getPathFromNode(node);
if (path == null) {
return;
}
openGitCreateProjectViaWizardWizard(event, node, path, getMultipleSelectedProjects(selectedNodes));
} else {
String path = getPathFromNode(selectedNodes.get(0));
openSmartImportWizard(event, descriptor, path);
}
}
use of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode in project egit by eclipse.
the class PushCommand method execute.
@Override
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:
// $NON-NLS-1$
throw new UnsupportedOperationException("type not supported!");
}
} catch (URISyntaxException e1) {
Activator.handleError(e1.getMessage(), e1, true);
return null;
}
WizardDialog dlg = new PushWizardDialog(getShell(event), pushWiz);
dlg.setHelpAvailable(pushWiz.isHelpAvailable());
dlg.open();
return null;
}
Aggregations