use of com.intellij.history.integration.IdeaGateway in project intellij-community by JetBrains.
the class LocalHistoryAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
Presentation p = e.getPresentation();
if (e.getProject() == null) {
p.setEnabledAndVisible(false);
} else {
p.setVisible(true);
p.setText(getText(e), true);
LocalHistoryFacade vcs = getVcs();
IdeaGateway gateway = getGateway();
p.setEnabled(vcs != null && gateway != null && isEnabled(vcs, gateway, e));
}
}
use of com.intellij.history.integration.IdeaGateway in project intellij-community by JetBrains.
the class SelectionReverterTest method testAskingForReadOnlyStatusClearingOnlyForTheSpecifiedFile.
public void testAskingForReadOnlyStatusClearingOnlyForTheSpecifiedFile() throws Exception {
createChildData(myRoot, "foo1.txt");
setBinaryContent(f, "one".getBytes());
createChildData(myRoot, "foo2.txt");
setBinaryContent(f, "two".getBytes());
createChildData(myRoot, "foo3.txt");
final List<VirtualFile> files = new ArrayList<>();
myGateway = new IdeaGateway() {
@Override
public boolean ensureFilesAreWritable(@NotNull Project p, @NotNull List<VirtualFile> ff) {
files.addAll(ff);
return true;
}
};
List<String> errors = checkCanRevertToPreviousRevision();
assertTrue(errors.isEmpty());
assertEquals(1, files.size());
assertEquals(f, files.get(0));
}
Aggregations