use of org.eclipse.egit.ui.internal.repository.tree.RemoteNode in project egit by eclipse.
the class PushConfiguredRemoteCommand method getRemoteConfig.
private RemoteConfig getRemoteConfig(RepositoryTreeNode node) {
if (node instanceof RepositoryNode)
return SimpleConfigurePushDialog.getConfiguredRemote(node.getRepository());
if (node instanceof RemoteNode || node instanceof PushNode) {
RemoteNode remoteNode;
if (node instanceof PushNode)
remoteNode = (RemoteNode) node.getParent();
else
remoteNode = (RemoteNode) node;
try {
RemoteConfig config = new RemoteConfig(remoteNode.getRepository().getConfig(), remoteNode.getObject());
boolean fetchConfigured = !config.getFetchRefSpecs().isEmpty();
boolean pushConfigured = !config.getPushRefSpecs().isEmpty();
if (fetchConfigured || pushConfigured)
return config;
else
return null;
} catch (URISyntaxException e) {
return null;
}
}
return null;
}
use of org.eclipse.egit.ui.internal.repository.tree.RemoteNode in project egit by eclipse.
the class ConfigureFetchCommand 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 FetchNode)
configName = ((RemoteNode) selectedNode.getParent()).getObject();
else
return null;
Dialog dlg = SimpleConfigureFetchDialog.getDialog(getShell(event), selectedNode.getRepository(), configName);
dlg.open();
return null;
}
use of org.eclipse.egit.ui.internal.repository.tree.RemoteNode in project egit by eclipse.
the class ConfigureGerritRemoteCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final RemoteNode node = getSelectedNodes(event).get(0);
Repository repository = node.getRepository();
final String remoteName = node.getObject();
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
ConfigureGerritWizard configureGerritWizard = new ConfigureGerritWizard(repository, remoteName);
WizardDialog dlg = new WizardDialog(shell, configureGerritWizard);
dlg.setHelpAvailable(false);
dlg.open();
return null;
}
use of org.eclipse.egit.ui.internal.repository.tree.RemoteNode 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;
}
Aggregations