Examples of RepositoryTreeNode


Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

* Implements "Merge"
*/
public class MergeCommand extends
    RepositoriesViewCommandHandler<RepositoryTreeNode> {
  public Object execute(final ExecutionEvent event) throws ExecutionException {
    RepositoryTreeNode node = getSelectedNodes(event).get(0);
    final Repository repository = node.getRepository();

    BasicConfigurationDialog.show(repository);

    if (!MergeActionHandler.checkMergeIsPossible(repository, getShell(event)))
      return null;
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

*/
public class SynchronizeCommand extends
    RepositoriesViewCommandHandler<RepositoryTreeNode> {

  public Object execute(ExecutionEvent event) throws ExecutionException {
    final RepositoryTreeNode node = getSelectedNodes(event).get(0);
    final String refName = getRefName(node);
    if (refName == null)
      return null;

    String secondRefName = Constants.HEAD;
    if (getSelectedNodes(event).size() == 2) {
      secondRefName = getRefName(getSelectedNodes(event).get(1));
      if (secondRefName == null)
        return null;
    }

    final String secondRefNameParam = secondRefName;

    final boolean includeLocal = getSelectedNodes(event).size() == 1;

    final Repository repo = node.getRepository();
    Job job = new WorkspaceJob(NLS.bind(UIText.SynchronizeCommand_jobName,
        repo.getDirectory())) {

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

*/
public class PushCommand extends
    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) {
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

*/
public class CheckoutCommand extends
    RepositoriesViewCommandHandler<RepositoryTreeNode> implements
    IElementUpdater {
  public Object execute(final ExecutionEvent event) throws ExecutionException {
    final RepositoryTreeNode node = getSelectedNodes(event).get(0);
    if (!(node.getObject() instanceof Ref))
      return null;

    final Ref ref = (Ref) node.getObject();
    Repository repo = node.getRepository();

    BranchOperationUI op = BranchOperationUI.checkout(repo, ref.getName());
    op.start();

    return null;
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

  }

  public void updateElement(UIElement element, Map parameters) {
    List<RepositoryTreeNode> nodes = getSelectedNodes();
    if (!nodes.isEmpty()) {
      RepositoryTreeNode node = nodes.get(0);
      if (node.getObject() instanceof Ref) {
        Ref ref = (Ref) node.getObject();
        if (BranchOperationUI.checkoutWillShowQuestionDialog(ref
            .getName())) {
          element.setText(UIText.CheckoutCommand_CheckoutLabelWithQuestion);
          return;
        }
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

* Configures the Push
*/
public class ConfigurePushCommand extends
    RepositoriesViewCommandHandler<RepositoryTreeNode> {
  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;
  }
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

* Fetches from the remote
*/
public class FetchConfiguredRemoteCommand extends
    RepositoriesViewCommandHandler<RepositoryTreeNode> {
  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;
  }
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

    return null;
  }

  @Override
  public boolean isEnabled() {
    RepositoryTreeNode node = getSelectedNodes().get(0);
    try {
      return getRemoteConfig(node) != null;
    } catch (ExecutionException e) {
      return false;
    }
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

* Implements "Copy Path to Clipboard"
*/
public class CopyPathCommand extends
    RepositoriesViewCommandHandler<RepositoryTreeNode> {
  public Object execute(ExecutionEvent event) throws ExecutionException {
    RepositoryTreeNode node = getSelectedNodes(event).get(0);
    String path;

    switch (node.getType()) {
    case REPO:
      path = node.getRepository().getDirectory().toString();
      break;
    case WORKINGDIR:
      if (node.getRepository().isBare())
        return null;
      path = node.getRepository().getWorkTree().toString();
      break;
    case FILE:
      path = ((FileNode) node).getObject().getPath().toString();
      break;
    case FOLDER:
View Full Code Here

Examples of org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode

      MessageDialog.openError(Display.getDefault().getActiveShell(),
          UIText.ImportProjectsWrongSelection,
          UIText.ImportProjectsSelectionInRepositoryRequired);
      return null;
    }
    RepositoryTreeNode node = selectedNodes.get(0);
    String path;

    switch (node.getType()) {
    case REPO:
      // fall through
    case WORKINGDIR:
      path = node.getRepository().getWorkTree().toString();
      break;
    case FOLDER:
      path = ((FolderNode) node).getObject().getPath().toString();
      break;
    default:
      MessageDialog.openError(Display.getDefault().getActiveShell(),
          UIText.ImportProjectsWrongSelection,
          UIText.ImportProjectsSelectionInRepositoryRequired);
      return null;
    }

    WizardDialog dlg = new WizardDialog(
        getShell(event),
        new GitCreateProjectViaWizardWizard(node.getRepository(), path)) {
      @Override
      protected IDialogSettings getDialogBoundsSettings() {
        // preserve dialog bounds
        return Activator.getDefault().getDialogSettings();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.