use of org.eclipse.egit.ui.internal.repository.tree.RefNode in project egit by eclipse.
the class RepositoriesView method getShowInElements.
private static List<Object> getShowInElements(IStructuredSelection selection) {
List<Object> elements = new ArrayList<>();
for (Object element : selection.toList()) {
if (element instanceof FileNode || element instanceof FolderNode || element instanceof WorkingDirNode) {
RepositoryTreeNode treeNode = (RepositoryTreeNode) element;
IPath path = treeNode.getPath();
IResource resource = ResourceUtil.getResourceForLocation(path, false);
if (resource != null)
elements.add(resource);
} else if (element instanceof RepositoryNode) {
// Can be shown in History, Reflog and Properties views
elements.add(element);
} else if (element instanceof RepositoryNode || element instanceof RemoteNode || element instanceof FetchNode || element instanceof PushNode || element instanceof TagNode || element instanceof RefNode) {
// These can be shown in Properties view directly
elements.add(element);
}
}
return elements;
}
use of org.eclipse.egit.ui.internal.repository.tree.RefNode in project egit by eclipse.
the class RenameBranchCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final List<RefNode> nodes = getSelectedNodes(event);
RefNode refNode = nodes.get(0);
Shell shell = getShell(event);
new BranchRenameDialog(shell, refNode.getRepository(), refNode.getObject()).open();
return null;
}
use of org.eclipse.egit.ui.internal.repository.tree.RefNode in project egit by eclipse.
the class ConfigureBranchCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final List<RefNode> nodes = getSelectedNodes(event);
if (nodes.size() == 1) {
RefNode node = nodes.get(0);
String branchName = Repository.shortenRefName(node.getObject().getName());
BranchConfigurationDialog dlg = new BranchConfigurationDialog(getShell(event), branchName, node.getRepository());
dlg.open();
}
return null;
}
Aggregations