本文整理汇总了Java中com.intellij.history.integration.IdeaGateway类的典型用法代码示例。如果您正苦于以下问题:Java IdeaGateway类的具体用法?Java IdeaGateway怎么用?Java IdeaGateway使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IdeaGateway类属于com.intellij.history.integration包,在下文中一共展示了IdeaGateway类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContentRevision
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
private ContentRevision createContentRevision(final Entry e, final IdeaGateway gw) {
if (e == null) return null;
return new ContentRevision() {
@Nullable
public String getContent() throws VcsException {
if (e.isDirectory()) return null;
return e.getContent().getString(e, gw);
}
@NotNull
public FilePath getFile() {
return VcsUtil.getFilePath(new File(e.getPath()), e.isDirectory());
}
@NotNull
public VcsRevisionNumber getRevisionNumber() {
return VcsRevisionNumber.NULL;
}
};
}
示例2: testAskingForReadOnlyStatusClearingOnlyForTheSpecifiedFile
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
public void testAskingForReadOnlyStatusClearingOnlyForTheSpecifiedFile() throws Exception {
myRoot.createChildData(null, "foo1.txt");
f.setBinaryContent("one".getBytes());
myRoot.createChildData(null, "foo2.txt");
f.setBinaryContent("two".getBytes());
myRoot.createChildData(null, "foo3.txt");
final List<VirtualFile> files = new ArrayList<VirtualFile>();
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));
}
示例3: createContentRevision
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
private ContentRevision createContentRevision(final Entry e, final IdeaGateway gw) {
if (e == null) return null;
return new ContentRevision() {
@Nullable
public String getContent() throws VcsException {
if (e.isDirectory()) return null;
return e.getContent().getString(e, gw);
}
@NotNull
public FilePath getFile() {
return new FilePathImpl(new File(e.getPath()), e.isDirectory());
}
@NotNull
public VcsRevisionNumber getRevisionNumber() {
return VcsRevisionNumber.NULL;
}
};
}
示例4: update
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
@Override
public void update(@Nonnull 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));
}
}
示例5: createContentRevision
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
private ContentRevision createContentRevision(final Entry e, final IdeaGateway gw) {
if (e == null) return null;
return new ContentRevision() {
@Nullable
public String getContent() throws VcsException {
if (e.isDirectory()) return null;
return e.getContent().getString(e, gw);
}
@Nonnull
public FilePath getFile() {
return new FilePathImpl(new File(e.getPath()), e.isDirectory());
}
@Nonnull
public VcsRevisionNumber getRevisionNumber() {
return VcsRevisionNumber.NULL;
}
};
}
示例6: testAskingForReadOnlyStatusClearingOnlyForTheSpecifiedFile
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
public void testAskingForReadOnlyStatusClearingOnlyForTheSpecifiedFile() throws Exception {
myRoot.createChildData(null, "foo1.txt");
f.setBinaryContent("one".getBytes());
myRoot.createChildData(null, "foo2.txt");
f.setBinaryContent("two".getBytes());
myRoot.createChildData(null, "foo3.txt");
final List<VirtualFile> files = new ArrayList<VirtualFile>();
myGateway = new IdeaGateway() {
@Override
public boolean ensureFilesAreWritable(@Nonnull Project p, @Nonnull List<VirtualFile> ff) {
files.addAll(ff);
return true;
}
};
List<String> errors = checkCanRevertToPreviousRevision();
assertTrue(errors.isEmpty());
assertEquals(1, files.size());
assertEquals(f, files.get(0));
}
示例7: SelectionReverter
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
public SelectionReverter(Project p,
LocalHistoryFacade vcs,
IdeaGateway gw,
SelectionCalculator c,
Revision leftRevision,
Entry rightEntry,
int fromLine,
int toLine) {
super(p, vcs, gw);
myCalculator = c;
myLeftRevision = leftRevision;
myRightEntry = rightEntry;
myFromLine = fromLine;
myToLine = toLine;
}
示例8: HistoryDialog
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
protected HistoryDialog(@NotNull Project project, IdeaGateway gw, VirtualFile f, boolean doInit) {
super(project);
myProject = project;
myGateway = gw;
myFile = f;
setProject(project);
setDimensionKey(getPropertiesKey());
setImage(ImageLoader.loadFromResource("/diff/Diff.png"));
closeOnEsc();
if (doInit) init();
}
示例9: SelectionDifferenceModel
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
public SelectionDifferenceModel(Project p,
IdeaGateway gw,
SelectionCalculator c,
Revision left,
Revision right,
int from,
int to,
boolean editableRightContent) {
super(p, gw, editableRightContent);
myCalculator = c;
myLeftRevision = left;
myRightRevision = right;
myFrom = from;
myTo = to;
}
示例10: update
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
Presentation p = e.getPresentation();
if (getEventProject(e) == null) {
p.setVisible(false);
p.setEnabled(false);
return;
}
p.setVisible(true);
p.setText(getText(e), true);
LocalHistoryFacade vcs = getVcs();
IdeaGateway gateway = getGateway();
p.setEnabled(vcs != null && gateway != null && isEnabled(vcs, gateway, getFile(e), e));
}
示例11: showDialog
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
@Override
protected void showDialog(Project p, IdeaGateway gw, VirtualFile f, AnActionEvent e) {
String labelName = Messages.showInputDialog(p, message("put.label.name"), message("put.label.dialog.title"),null,
"", new NonEmptyInputValidator());
if (labelName == null) return;
LocalHistory.getInstance().putUserLabel(p, labelName);
}
示例12: showDialog
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
@Override
protected void showDialog(Project p, IdeaGateway gw, VirtualFile f, AnActionEvent e) {
VcsSelection sel = getSelection(e);
int from = sel.getSelectionStartLineNumber();
int to = sel.getSelectionEndLineNumber();
new SelectionHistoryDialog(p, gw, f, from, to).show();
}
示例13: ByteContentRetriever
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
public ByteContentRetriever(IdeaGateway gateway, LocalHistoryFacade vcs, VirtualFile file, FileRevisionTimestampComparator c) {
super(file.getPath());
myVcs = vcs;
myComparator = c;
Entry e = gateway.createTransientEntry(file);
myCurrentFileContent = e.getContent();
myCurrentFileTimestamp = e.getTimestamp();
}
示例14: HistoryDialog
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
protected HistoryDialog(@Nonnull Project project, IdeaGateway gw, VirtualFile f, boolean doInit) {
super(project);
myProject = project;
myGateway = gw;
myFile = f;
setProject(project);
setDimensionKey(getPropertiesKey());
setImage(ImageLoader.loadFromResource("/diff/Diff.png"));
closeOnEsc();
if (doInit) init();
}
示例15: ChangeRange
import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
public ChangeRange(IdeaGateway gw, LocalHistoryFacade vcs, @NotNull Long changeId) {
this(gw, vcs, changeId, changeId);
}