当前位置: 首页>>代码示例>>Java>>正文


Java IdeaGateway类代码示例

本文整理汇总了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;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:Difference.java

示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:SelectionReverterTest.java

示例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;
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:Difference.java

示例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));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:LocalHistoryAction.java

示例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;
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:Difference.java

示例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));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:SelectionReverterTest.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:SelectionReverter.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:HistoryDialog.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:SelectionDifferenceModel.java

示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:LocalHistoryAction.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PutLabelAction.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ShowSelectionHistoryAction.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ByteContentRetriever.java

示例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();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:HistoryDialog.java

示例15: ChangeRange

import com.intellij.history.integration.IdeaGateway; //导入依赖的package包/类
public ChangeRange(IdeaGateway gw, LocalHistoryFacade vcs, @NotNull Long changeId) {
  this(gw, vcs, changeId, changeId);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ChangeRange.java


注:本文中的com.intellij.history.integration.IdeaGateway类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。