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_);
}
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());
}
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;
}
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);
}
}
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;
}
Aggregations