use of org.rstudio.core.client.widget.Operation 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.core.client.widget.Operation in project rstudio by rstudio.
the class SVNCommandHandler method doRevert.
private void doRevert(final ArrayList<String> revertList, final Command onRevertConfirmed) {
String noun = revertList.size() == 1 ? "file" : "files";
globalDisplay_.showYesNoMessage(GlobalDisplay.MSG_WARNING, "Revert Changes", "Changes to the selected " + noun + " will be reverted.\n\n" + "Are you sure you want to continue?", new Operation() {
@Override
public void execute() {
if (onRevertConfirmed != null)
onRevertConfirmed.execute();
server_.svnRevert(revertList, new ProcessCallback("SVN Revert"));
}
}, false);
}
Aggregations