當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。