Search in sources :

Example 6 with StatusAndPath

use of org.rstudio.studio.client.common.vcs.StatusAndPath in project rstudio by rstudio.

the class SVNCommandHandler method onVcsIgnore.

public void onVcsIgnore() {
    // special case for a single directory with property changes
    ArrayList<StatusAndPath> items = display_.getSelectedItems();
    if (items.size() == 1) {
        StatusAndPath item = items.get(0);
        if (item.isDirectory() && item.getStatus().equals("M")) {
            String path = item.getPath();
            if (path.equals("."))
                path = "";
            IgnoreList ignoreList = new IgnoreList(path, new ArrayList<String>());
            pIgnore_.get().showDialog(ignoreList, ignoreStrategy_);
            return;
        }
    }
    // standard case
    ArrayList<String> paths = getPathArray();
    pIgnore_.get().showDialog(paths, ignoreStrategy_);
}
Also used : StatusAndPath(org.rstudio.studio.client.common.vcs.StatusAndPath) IgnoreList(org.rstudio.studio.client.common.vcs.ignore.IgnoreList)

Example 7 with StatusAndPath

use of org.rstudio.studio.client.common.vcs.StatusAndPath in project rstudio by rstudio.

the class VCSApplicationWindow method onInitialize.

@Override
protected void onInitialize(LayoutPanel mainPanel, JavaScriptObject params) {
    // set our window title
    Window.setTitle("RStudio: Review Changes");
    // always show scrollbars on the mac
    StyleUtils.forceMacScrollbars(mainPanel);
    // show the vcs ui in our main panel
    VCSApplicationParams vcsParams = params.<VCSApplicationParams>cast();
    ReviewPresenter rpres = pReviewPresenter_.get();
    ArrayList<StatusAndPath> selected = vcsParams.getSelected();
    if (selected.size() > 0)
        rpres.setSelectedPaths(selected);
    HistoryPresenter hpres = pHistoryPresenter_.get();
    if (vcsParams.getHistoryFileFilter() != null)
        hpres.setFileFilter(vcsParams.getHistoryFileFilter());
    vcsPopupController_ = VCSPopup.show(mainPanel, rpres, hpres, vcsParams.getShowHistory());
}
Also used : StatusAndPath(org.rstudio.studio.client.common.vcs.StatusAndPath) VCSApplicationParams(org.rstudio.studio.client.vcs.VCSApplicationParams) ReviewPresenter(org.rstudio.studio.client.workbench.views.vcs.dialog.ReviewPresenter) HistoryPresenter(org.rstudio.studio.client.workbench.views.vcs.dialog.HistoryPresenter)

Example 8 with StatusAndPath

use of org.rstudio.studio.client.common.vcs.StatusAndPath in project rstudio by rstudio.

the class SVNCommandHandler method getPathArray.

private ArrayList<String> getPathArray() {
    ArrayList<StatusAndPath> items = display_.getSelectedItems();
    ArrayList<String> paths = new ArrayList<String>();
    for (StatusAndPath item : items) paths.add(item.getPath());
    return paths;
}
Also used : StatusAndPath(org.rstudio.studio.client.common.vcs.StatusAndPath) ArrayList(java.util.ArrayList)

Example 9 with StatusAndPath

use of org.rstudio.studio.client.common.vcs.StatusAndPath in project rstudio by rstudio.

the class SVNCommandHandler method onVcsResolve.

@Handler
void onVcsResolve() {
    ArrayList<StatusAndPath> items = display_.getSelectedItems();
    if (items.size() == 0)
        return;
    final ArrayList<String> paths = new ArrayList<String>();
    boolean conflict = false;
    for (StatusAndPath item : items) {
        paths.add(item.getPath());
        if ("C".equals(item.getStatus()))
            conflict = true;
        else if (item.isDirectory())
            conflict = true;
    }
    Operation resolveOperation = new Operation() {

        @Override
        public void execute() {
            new SVNResolveDialog(paths.size(), "Resolve", new OperationWithInput<String>() {

                @Override
                public void execute(String input) {
                    server_.svnResolve(input, paths, new ProcessCallback("SVN Resolve"));
                }
            }).showModal();
        }
    };
    if (conflict) {
        resolveOperation.execute();
    } else {
        String message = (paths.size() > 1 ? "None of the selected paths appear to have conflicts." : "The selected path does not appear to have conflicts.") + "\n\nDo you want to resolve anyway?";
        globalDisplay_.showYesNoMessage(GlobalDisplay.MSG_WARNING, "No Conflicts Detected", message, resolveOperation, true);
    }
}
Also used : ProcessCallback(org.rstudio.studio.client.workbench.views.vcs.common.ProcessCallback) StatusAndPath(org.rstudio.studio.client.common.vcs.StatusAndPath) ArrayList(java.util.ArrayList) OperationWithInput(org.rstudio.core.client.widget.OperationWithInput) Operation(org.rstudio.core.client.widget.Operation) Handler(org.rstudio.core.client.command.Handler)

Example 10 with StatusAndPath

use of org.rstudio.studio.client.common.vcs.StatusAndPath in project rstudio by rstudio.

the class ChangelistTable method getSelectedDiscardablePaths.

public ArrayList<String> getSelectedDiscardablePaths() {
    SelectionModel<? super StatusAndPath> selectionModel = table_.getSelectionModel();
    ArrayList<String> results = new ArrayList<String>();
    for (StatusAndPath item : dataProvider_.getList()) {
        if (selectionModel.isSelected(item) && item.isDiscardable())
            results.add(item.getPath());
    }
    return results;
}
Also used : StatusAndPath(org.rstudio.studio.client.common.vcs.StatusAndPath) ArrayList(java.util.ArrayList)

Aggregations

StatusAndPath (org.rstudio.studio.client.common.vcs.StatusAndPath)10 ArrayList (java.util.ArrayList)7 JSONNumber (com.google.gwt.json.client.JSONNumber)2 Token (org.rstudio.core.client.Invalidation.Token)2 DiffResult (org.rstudio.studio.client.common.vcs.DiffResult)2 ServerError (org.rstudio.studio.client.server.ServerError)2 Handler (org.rstudio.core.client.command.Handler)1 Operation (org.rstudio.core.client.widget.Operation)1 OperationWithInput (org.rstudio.core.client.widget.OperationWithInput)1 PatchMode (org.rstudio.studio.client.common.vcs.GitServerOperations.PatchMode)1 IgnoreList (org.rstudio.studio.client.common.vcs.ignore.IgnoreList)1 VCSApplicationParams (org.rstudio.studio.client.vcs.VCSApplicationParams)1 ProcessCallback (org.rstudio.studio.client.workbench.views.vcs.common.ProcessCallback)1 StageUnstageEvent (org.rstudio.studio.client.workbench.views.vcs.common.events.StageUnstageEvent)1 HistoryPresenter (org.rstudio.studio.client.workbench.views.vcs.dialog.HistoryPresenter)1 ReviewPresenter (org.rstudio.studio.client.workbench.views.vcs.dialog.ReviewPresenter)1 SVNDiffParser (org.rstudio.studio.client.workbench.views.vcs.svn.SVNDiffParser)1