當前位置: 首頁>>代碼示例>>Java>>正文


Java Reverter類代碼示例

本文整理匯總了Java中com.intellij.history.integration.revertion.Reverter的典型用法代碼示例。如果您正苦於以下問題:Java Reverter類的具體用法?Java Reverter怎麽用?Java Reverter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Reverter類屬於com.intellij.history.integration.revertion包,在下文中一共展示了Reverter類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: revert

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
protected void revert(Reverter r) {
  try {
    if (!askForProceeding(r)) return;

    List<String> errors = r.checkCanRevert();
    if (!errors.isEmpty()) {
      showError(message("message.cannot.revert.because", formatErrors(errors)));
      return;
    }
    r.revert();

    showNotification(r.getCommandName());
  }
  catch (IOException e) {
    showError(message("message.error.during.revert", e));
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:HistoryDialog.java

示例2: testRevertChange

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
public void testRevertChange() throws IOException {
  getVcs().beginChangeSet();
  myRoot.createChildData(null, "f1.txt");
  getVcs().endChangeSet("change");

  getVcs().beginChangeSet();
  myRoot.createChildData(null, "f2.txt");
  getVcs().endChangeSet("another change");

  RecentChange c = getVcs().getRecentChanges(getRootEntry()).get(1);
  RecentChangeDialogModel m = new RecentChangeDialogModel(myProject, myGateway, getVcs(), c);

  Reverter r = m.createReverter();
  r.revert();

  assertNull(myRoot.findChild("f1.txt"));
  assertNotNull(myRoot.findChild("f2.txt"));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:RecentChangeDialogTest.java

示例3: askForProceeding

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
private boolean askForProceeding(Reverter r) throws IOException {
  List<String> questions = r.askUserForProceeding();
  if (questions.isEmpty()) return true;

  return Messages.showYesNoDialog(myProject, message("message.do.you.want.to.proceed", formatQuestions(questions)),
                                  CommonBundle.getWarningTitle(), Messages.getWarningIcon()) == Messages.YES;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:HistoryDialog.java

示例4: testRevert

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
public void testRevert() throws IOException {
  initModelOnSecondLineAndSelectRevisions(0, 0);
  Reverter r = m.createReverter();
  r.revert();

  assertEquals("a\nbc\ne\n", new String(f.contentsToByteArray()));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:SelectionHistoryDialogTest.java

示例5: initModelFor

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
private void initModelFor() {
  m = new HistoryDialogModel(myProject, myGateway, getVcs(), f) {
    @Override
    public Reverter createReverter() {
      throw new UnsupportedOperationException();
    }
  };
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:HistoryDialogModelTest.java

示例6: askForProceeding

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
private boolean askForProceeding(Reverter r) throws IOException {
  List<String> questions = r.askUserForProceeding();
  if (questions.isEmpty()) return true;

  return Messages.showYesNoDialog(myProject, message("message.do.you.want.to.proceed", formatQuestions(questions)),
                                  CommonBundle.getWarningTitle(), Messages.getWarningIcon()) == 0;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:8,代碼來源:HistoryDialog.java

示例7: createReverter

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
@Override
public Reverter createReverter() {
  return new SelectionReverter(myProject, myVcs, myGateway, getCalculator(), getLeftRevision(), getRightEntry(), myFrom, myTo);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:SelectionHistoryDialogModel.java

示例8: createReverter

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
@Override
public Reverter createReverter() {
  Revision l = getLeftRevision();
  Revision r = getRightRevision();
  return new DifferenceReverter(myProject, myVcs, myGateway, l.getDifferencesWith(r), l);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:FileHistoryDialogModel.java

示例9: createReverter

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
@Override
public Reverter createReverter() {
  return createRevisionReverter(getDifferences());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:DirectoryHistoryDialogModel.java

示例10: createRevisionReverter

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
public Reverter createRevisionReverter(List<Difference> diffs) {
  return new DifferenceReverter(myProject, myVcs, myGateway, diffs, getLeftRevision());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:DirectoryHistoryDialogModel.java

示例11: createReverter

import com.intellij.history.integration.revertion.Reverter; //導入依賴的package包/類
public abstract Reverter createReverter(); 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:2,代碼來源:HistoryDialogModel.java


注:本文中的com.intellij.history.integration.revertion.Reverter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。