• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DiffManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.diff.DiffManager的典型用法代码示例。如果您正苦于以下问题:Java DiffManager类的具体用法?Java DiffManager怎么用?Java DiffManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DiffManager类属于com.intellij.diff包,在下文中一共展示了DiffManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: diff

import com.intellij.diff.DiffManager; //导入依赖的package包/类
/**
 * 调用 Android 文件对比
 * @param project
 * @param f1
 * @param f2
 */
public static void diff(final Project project, final File f1, final File f2) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
            try {
                VirtualFile v1 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f1);
                Document document1 = FileDocumentManager.getInstance().getDocument(v1);
                FileDocumentContentImpl fileDocumentContent1 = new FileDocumentContentImpl(project, document1, v1);
                VirtualFile v2 = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f2);
                Document document2 = FileDocumentManager.getInstance().getDocument(v2);
                FileDocumentContentImpl fileDocumentContent2 = new FileDocumentContentImpl(project, document2, v2);
                SimpleDiffRequest simpleDiffRequest = new SimpleDiffRequest(Constant.TITLE, fileDocumentContent1, fileDocumentContent2,
                        f1.getName(), f2.getName());
                DiffManager.getInstance().showDiff(project, simpleDiffRequest);
            } catch (Exception e) {
                NotificationUtils.errorNotification("Diff Source Error:" + e.getMessage());
            }
        }
    });
}
 
开发者ID:pengwei1024,项目名称:AndroidSourceViewer,代码行数:27,代码来源:DiffSourceAction.java


示例2: showDiffForFiles

import com.intellij.diff.DiffManager; //导入依赖的package包/类
private void showDiffForFiles(File remoteFile, VirtualFile localFile) {
    if (remoteFile == null || localFile == null) {
        return;
    }

    final DiffContent remoteFileContent = DiffContentFactory.getInstance().create(new String(remoteFile.getContent(), StandardCharsets.UTF_8));

    final DiffContent localFileContent = DiffContentFactory.getInstance().create(project, localFile);

    DiffRequest dr = new SimpleDiffRequest("NetSuite File Cabinet Compare", remoteFileContent, localFileContent, "NetSuite File Cabinet - " + remoteFile.getName(), "Local File - " + localFile.getName());

    ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
            ApplicationManager.getApplication().runWriteAction(new Runnable() {
                @Override
                public void run() {
                    DiffManager.getInstance().showDiff(project, dr);
                }
            });
        }
    }, ModalityState.NON_MODAL);
}
 
开发者ID:Topher84,项目名称:NetSuite-Tools-For-WebStorm,代码行数:24,代码来源:CompareWithFileCabinetTask.java


示例3: showDiffForChange

import com.intellij.diff.DiffManager; //导入依赖的package包/类
private static void showDiffForChange(@Nullable Project project,
                                      @NotNull List<ChangeDiffRequestProducer> presentables,
                                      int index,
                                      @NotNull ShowDiffContext context) {
  if (presentables.isEmpty()) return;
  if (index < 0 || index >= presentables.size()) index = 0;

  DiffRequestChain chain = new ChangeDiffRequestChain(presentables);
  chain.setIndex(index);

  for (Map.Entry<Key, Object> entry : context.getChainContext().entrySet()) {
    chain.putUserData(entry.getKey(), entry.getValue());
  }
  chain.putUserData(DiffUserDataKeys.CONTEXT_ACTIONS, context.getActions());

  DiffManager.getInstance().showDiff(project, chain, context.getDialogHints());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ShowDiffAction.java


示例4: showDiff

import com.intellij.diff.DiffManager; //导入依赖的package包/类
/**
 * Invokes {@link com.intellij.openapi.diff.DiffManager#getDiffTool()} to show difference between the given revisions of the given file.
 * @param project   project under vcs control.
 * @param path  file which revisions are compared.
 * @param revision1 first revision - 'before', to the left.
 * @param revision2 second revision - 'after', to the right.
 * @throws VcsException
 * @throws IOException
 */
public static void showDiff(@NotNull final Project project, @NotNull FilePath path,
                            @NotNull VcsFileRevision revision1, @NotNull VcsFileRevision revision2,
                            @NotNull String title1, @NotNull String title2) throws VcsException, IOException {
  final byte[] content1 = loadRevisionContent(revision1);
  final byte[] content2 = loadRevisionContent(revision2);

  String title = DiffRequestFactoryImpl.getContentTitle(path);

  DiffContent diffContent1 = createContent(project, content1, revision1, path);
  DiffContent diffContent2 = createContent(project, content2, revision2, path);

  final DiffRequest request = new SimpleDiffRequest(title, diffContent1, diffContent2, title1, title2);

  request.putUserData(REVISIONS_KEY, new VcsFileRevision[]{revision1, revision2});

  WaitForProgressToShow.runOrInvokeLaterAboveProgress(new Runnable() {
    public void run() {
      DiffManager.getInstance().showDiff(project, request);
    }
  }, null, project);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:VcsHistoryUtil.java


示例5: showResult

import com.intellij.diff.DiffManager; //导入依赖的package包/类
@Override
protected void showResult() {
  if (!success.isNull()) {
    String title = SvnBundle.message("compare.with.branch.diff.title");

    String title1 = remoteTitleBuilder.toString();
    String title2 = myVirtualFile.getPresentableUrl();

    try {
      DiffContent content1 = DiffContentFactory.getInstance().createFromBytes(myProject, myVirtualFile, content.get());
      DiffContent content2 = DiffContentFactory.getInstance().create(myProject, myVirtualFile);

      DiffRequest request = new SimpleDiffRequest(title, content1, content2, title1, title2);

      DiffManager.getInstance().showDiff(myProject, request);
    }
    catch (IOException e) {
      reportGeneralException(e);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:FileWithBranchComparer.java


示例6: showDiffForChange

import com.intellij.diff.DiffManager; //导入依赖的package包/类
private static void showDiffForChange(@Nullable Project project,
                                      @Nonnull List<ChangeDiffRequestProducer> presentables,
                                      int index,
                                      @Nonnull ShowDiffContext context) {
  if (presentables.isEmpty()) return;
  if (index < 0 || index >= presentables.size()) index = 0;

  DiffRequestChain chain = new ChangeDiffRequestChain(presentables);
  chain.setIndex(index);

  for (Map.Entry<Key, Object> entry : context.getChainContext().entrySet()) {
    chain.putUserData(entry.getKey(), entry.getValue());
  }
  chain.putUserData(DiffUserDataKeys.CONTEXT_ACTIONS, context.getActions());

  DiffManager.getInstance().showDiff(project, chain, context.getDialogHints());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ShowDiffAction.java


示例7: createCenterPanel

import com.intellij.diff.DiffManager; //导入依赖的package包/类
@Nullable
@Override
@RequiredDispatchThread
protected JComponent createCenterPanel()
{
	final Project project = myOldMethod.getProject();
	final VirtualFile file = PsiUtilCore.getVirtualFile(myOldMethod);

	DiffContentFactory contentFactory = DiffContentFactory.getInstance();
	DocumentContent oldContent = contentFactory.create(myOldMethod.getText() + "\n\n\nmethod call:\n " + myOldCall.getText(), file);
	DocumentContent newContent = contentFactory.create(myNewMethod.getText() + "\n\n\nmethod call:\n " + myNewCall.getText(), file);
	SimpleDiffRequest request = new SimpleDiffRequest(null, oldContent, newContent, "Before", "After");

	DiffRequestPanel diffPanel = DiffManager.getInstance().createRequestPanel(project, getDisposable(), null);
	diffPanel.putContextHints(DiffUserDataKeys.PLACE, "ExtractSignature");
	diffPanel.setRequest(request);

	final JPanel panel = new JPanel(new BorderLayout());
	panel.add(diffPanel.getComponent(), BorderLayout.CENTER);
	panel.setBorder(IdeBorderFactory.createEmptyBorder(JBUI.insetsTop(5)));
	return panel;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:ExtractMethodSignatureSuggester.java


示例8: showDiff

import com.intellij.diff.DiffManager; //导入依赖的package包/类
private void showDiff() {
	Project project = CptUtil.getActiveProject();

	CptUtil.getTemplateFile("java").ifPresent(file -> {
		VirtualFile vFile = LocalFileSystem.getInstance().findFileByIoFile(file);

		DocumentContent content1 = DiffContentFactory.getInstance().create(templatesText);
		DocumentContent content2 = DiffContentFactory.getInstance().createDocument(project, vFile);
		DiffManager.getInstance().showDiff(project, new SimpleDiffRequest("Templates Diff", content1, content2,
			"Predefined plugin templates", "Your templates"));
	});
}
 
开发者ID:xylo,项目名称:intellij-postfix-templates,代码行数:13,代码来源:CptPluginSettingsForm.java


示例9: actionPerformed

import com.intellij.diff.DiffManager; //导入依赖的package包/类
public void actionPerformed(@NotNull AnActionEvent e) {
  Project project = e.getProject();
  DiffRequest request = getDiffRequest(e);
  if (request == null) return;

  DiffManager.getInstance().showDiff(project, request);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:BaseShowDiffAction.java


示例10: actionPerformed

import com.intellij.diff.DiffManager; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  List<DiffContent> contents = myRequest.getContents();
  List<String> titles = myRequest.getContentTitles();

  DiffRequest request = new SimpleDiffRequest(myRequest.getTitle(),
                                              mySide1.select(contents), mySide2.select(contents),
                                              mySide1.select(titles), mySide2.select(titles));
  DiffManager.getInstance().showDiff(myProject, request, new DiffDialogHints(null, myPanel));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ThreesideDiffViewer.java


示例11: process

import com.intellij.diff.DiffManager; //导入依赖的package包/类
@Override
public boolean process(final VirtualFile file, final Document document) {
  String message = UIBundle.message("file.cache.conflict.message.text", file.getPresentableUrl());

  final DialogBuilder builder = new DialogBuilder();
  builder.setCenterPanel(new JLabel(message, Messages.getQuestionIcon(), SwingConstants.CENTER));
  builder.addOkAction().setText(UIBundle.message("file.cache.conflict.load.fs.changes.button"));
  builder.addCancelAction().setText(UIBundle.message("file.cache.conflict.keep.memory.changes.button"));
  builder.addAction(new AbstractAction(UIBundle.message("file.cache.conflict.show.difference.button")) {
    @Override
    public void actionPerformed(ActionEvent e) {
      final ProjectEx project = (ProjectEx)ProjectLocator.getInstance().guessProjectForFile(file);

      FileType fileType = file.getFileType();
      String fsContent = LoadTextUtil.loadText(file).toString();
      DocumentContent content1 = DiffContentFactory.getInstance().create(fsContent, fileType);
      DocumentContent content2 = DiffContentFactory.getInstance().create(project, document, file);
      String title = UIBundle.message("file.cache.conflict.for.file.dialog.title", file.getPresentableUrl());
      String title1 = UIBundle.message("file.cache.conflict.diff.content.file.system.content");
      String title2 = UIBundle.message("file.cache.conflict.diff.content.memory.content");
      DiffRequest request = new SimpleDiffRequest(title, content1, content2, title1, title2);
      request.putUserData(DiffUserDataKeys.GO_TO_SOURCE_DISABLE, true);
      DialogBuilder diffBuilder = new DialogBuilder(project);
      DiffRequestPanel diffPanel = DiffManager.getInstance().createRequestPanel(project, diffBuilder, diffBuilder.getWindow());
      diffPanel.setRequest(request);
      diffBuilder.setCenterPanel(diffPanel.getComponent());
      diffBuilder.setDimensionServiceKey("FileDocumentManager.FileCacheConflict");
      diffBuilder.addOkAction().setText(UIBundle.message("file.cache.conflict.save.changes.button"));
      diffBuilder.addCancelAction();
      diffBuilder.setTitle(title);
      if (diffBuilder.show() == DialogWrapper.OK_EXIT_CODE) {
        builder.getDialogWrapper().close(DialogWrapper.CANCEL_EXIT_CODE);
      }
    }
  });
  builder.setTitle(UIBundle.message("file.cache.conflict.dialog.title"));
  builder.setButtonsAlignment(SwingConstants.CENTER);
  builder.setHelpId("reference.dialogs.fileCacheConflict");
  return builder.show() == 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:FileDocumentManagerImpl.java


示例12: actionPerformed

import com.intellij.diff.DiffManager; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext context = e.getDataContext();
  VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(context);
  if (files == null || files.length != 3){
    return;
  }

  DiffRequestFactory diffRequestFactory = DiffRequestFactory.getInstance();

  try {
    Project project = CommonDataKeys.PROJECT.getData(context);

    String title = DiffBundle.message("merge.files.dialog.title");
    List<String> titles = ContainerUtil.list(files[0].getPresentableUrl(),
                                             files[1].getPresentableUrl(),
                                             files[2].getPresentableUrl());

    VirtualFile outputFile = files[1];
    List<VirtualFile> contents = ContainerUtil.list(files[0], files[1], files[2]);

    MergeRequest request = diffRequestFactory.createMergeRequestFromFiles(project, outputFile, contents, title, titles, null);
    request.putUserData(DiffUserDataKeys.HELP_ID, "cvs.merge");

    DiffManager.getInstance().showMerge(project, request);
  }
  catch (InvalidDiffRequestException err) {
    Messages.showErrorDialog(err.getLocalizedMessage(), DiffBundle.message("merge.files.dialog.title"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:MergeFilesAction.java


示例13: handle

import com.intellij.diff.DiffManager; //导入依赖的package包/类
@Override
protected void handle(final Project project, final String value, XDebuggerTree tree) {
  UIUtil.invokeLaterIfNeeded(new Runnable() {
    @Override
    public void run() {
      DiffRequest request = DiffRequestFactory.getInstance().createClipboardVsValue(value);
      DiffManager.getInstance().showDiff(project, request);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:XCompareWithClipboardAction.java


示例14: showDiff

import com.intellij.diff.DiffManager; //导入依赖的package包/类
private void showDiff() {
  if (ChangeListManager.getInstance(myProject).isFreezedWithNotification(null)) return;
  if (myPatches.isEmpty() || (!myContainBasedChanges)) return;
  final List<AbstractFilePatchInProgress.PatchChange> changes = getAllChanges();
  Collections.sort(changes, myMyChangeComparator);
  List<AbstractFilePatchInProgress.PatchChange> selectedChanges = myChangesTreeList.getSelectedChanges();

  int selectedIdx = 0;
  final List<DiffRequestProducer> diffRequestPresentableList = new ArrayList<DiffRequestProducer>(changes.size());
  final List<Change> diffRequestChangeList = new ArrayList<Change>(changes.size());
  if (selectedChanges.isEmpty()) {
    selectedChanges = changes;
  }
  if (!selectedChanges.isEmpty()) {
    final AbstractFilePatchInProgress.PatchChange c = selectedChanges.get(0);
    for (AbstractFilePatchInProgress.PatchChange change : changes) {
      final AbstractFilePatchInProgress patchInProgress = change.getPatchInProgress();
      if (!patchInProgress.baseExistsOrAdded()) continue;
      diffRequestPresentableList.add(patchInProgress.getDiffRequestProducers(myProject, myReader));
      diffRequestChangeList.add(change);
      if (change.equals(c)) {
        selectedIdx = diffRequestPresentableList.size() - 1;
      }
    }
  }
  if (diffRequestPresentableList.isEmpty()) return;
  MyDiffRequestChain chain = new MyDiffRequestChain(diffRequestPresentableList, diffRequestChangeList, selectedIdx);
  DiffManager.getInstance().showDiff(myProject, chain, DiffDialogHints.DEFAULT);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:ApplyPatchDifferentiatedDialog.java


示例15: showShelvedChangesDiff

import com.intellij.diff.DiffManager; //导入依赖的package包/类
public static void showShelvedChangesDiff(final DataContext dc) {
  final Project project = CommonDataKeys.PROJECT.getData(dc);
  if (project == null) return;
  if (ChangeListManager.getInstance(project).isFreezedWithNotification(null)) return;

  ShelvedChangeList[] changeLists = ShelvedChangesViewManager.SHELVED_CHANGELIST_KEY.getData(dc);
  if (changeLists == null) changeLists = ShelvedChangesViewManager.SHELVED_RECYCLED_CHANGELIST_KEY.getData(dc);
  if (changeLists == null || changeLists.length != 1) return;

  final List<ShelvedChange> textChanges = changeLists[0].getChanges(project);
  final List<ShelvedBinaryFile> binaryChanges = changeLists[0].getBinaryFiles();

  final List<MyDiffRequestProducer> diffRequestProducers = new ArrayList<MyDiffRequestProducer>();

  processTextChanges(project, textChanges, diffRequestProducers);
  processBinaryFiles(project, binaryChanges, diffRequestProducers);

  Collections.sort(diffRequestProducers, ChangeDiffRequestComparator.getInstance());

  // selected changes inside lists
  final Set<Object> selectedChanges = new HashSet<Object>();
  selectedChanges.addAll(ContainerUtil.notNullize(ShelvedChangesViewManager.SHELVED_CHANGE_KEY.getData(dc)));
  selectedChanges.addAll(ContainerUtil.notNullize(ShelvedChangesViewManager.SHELVED_BINARY_FILE_KEY.getData(dc)));

  int index = 0;
  for (int i = 0; i < diffRequestProducers.size(); i++) {
    MyDiffRequestProducer producer = diffRequestProducers.get(i);
    if (selectedChanges.contains(producer.getBinaryChange()) || selectedChanges.contains(producer.getTextChange())) {
      index = i;
      break;
    }
  }

  MyDiffRequestChain chain = new MyDiffRequestChain(diffRequestProducers, index);
  DiffManager.getInstance().showDiff(project, chain, DiffDialogHints.FRAME);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:DiffShelvedChangesAction.java


示例16: actionPerformed

import com.intellij.diff.DiffManager; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(@Nonnull AnActionEvent e) {
  Project project = e.getProject();
  DiffRequest request = getDiffRequest(e);
  if (request == null) return;

  DiffManager.getInstance().showDiff(project, request);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:BaseShowDiffAction.java


示例17: askReloadFromDisk

import com.intellij.diff.DiffManager; //导入依赖的package包/类
public boolean askReloadFromDisk(VirtualFile file, Document document) {
  String message = UIBundle.message("file.cache.conflict.message.text", file.getPresentableUrl());

  final DialogBuilder builder = new DialogBuilder();
  builder.setCenterPanel(new JLabel(message, Messages.getQuestionIcon(), SwingConstants.CENTER));
  builder.addOkAction().setText(UIBundle.message("file.cache.conflict.load.fs.changes.button"));
  builder.addCancelAction().setText(UIBundle.message("file.cache.conflict.keep.memory.changes.button"));
  builder.addAction(new AbstractAction(UIBundle.message("file.cache.conflict.show.difference.button")) {
    @Override
    public void actionPerformed(ActionEvent e) {
      final ProjectEx project = (ProjectEx)ProjectLocator.getInstance().guessProjectForFile(file);

      FileType fileType = file.getFileType();
      String fsContent = LoadTextUtil.loadText(file).toString();
      DocumentContent content1 = DiffContentFactory.getInstance().create(project, fsContent, fileType);
      DocumentContent content2 = DiffContentFactory.getInstance().create(project, document, file);
      String title = UIBundle.message("file.cache.conflict.for.file.dialog.title", file.getPresentableUrl());
      String title1 = UIBundle.message("file.cache.conflict.diff.content.file.system.content");
      String title2 = UIBundle.message("file.cache.conflict.diff.content.memory.content");
      DiffRequest request = new SimpleDiffRequest(title, content1, content2, title1, title2);
      request.putUserData(DiffUserDataKeys.GO_TO_SOURCE_DISABLE, true);
      DialogBuilder diffBuilder = new DialogBuilder(project);
      DiffRequestPanel diffPanel = DiffManager.getInstance().createRequestPanel(project, diffBuilder, diffBuilder.getWindow());
      diffPanel.setRequest(request);
      diffBuilder.setCenterPanel(diffPanel.getComponent());
      diffBuilder.setDimensionServiceKey("FileDocumentManager.FileCacheConflict");
      diffBuilder.addOkAction().setText(UIBundle.message("file.cache.conflict.save.changes.button"));
      diffBuilder.addCancelAction();
      diffBuilder.setTitle(title);
      if (diffBuilder.show() == DialogWrapper.OK_EXIT_CODE) {
        builder.getDialogWrapper().close(DialogWrapper.CANCEL_EXIT_CODE);
      }
    }
  });
  builder.setTitle(UIBundle.message("file.cache.conflict.dialog.title"));
  builder.setButtonsAlignment(SwingConstants.CENTER);
  builder.setHelpId("reference.dialogs.fileCacheConflict");
  return builder.show() == 0;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:40,代码来源:MemoryDiskConflictResolver.java


示例18: actionPerformed

import com.intellij.diff.DiffManager; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext context = e.getDataContext();
  VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
  if (files == null || files.length != 3){
    return;
  }

  DiffRequestFactory diffRequestFactory = DiffRequestFactory.getInstance();

  try {
    Project project = e.getData(CommonDataKeys.PROJECT);

    String title = DiffBundle.message("merge.files.dialog.title");
    List<String> titles = ContainerUtil.list(files[0].getPresentableUrl(),
                                             files[1].getPresentableUrl(),
                                             files[2].getPresentableUrl());

    VirtualFile outputFile = files[1];
    List<VirtualFile> contents = ContainerUtil.list(files[0], files[1], files[2]);

    MergeRequest request = diffRequestFactory.createMergeRequestFromFiles(project, outputFile, contents, title, titles, null);
    request.putUserData(DiffUserDataKeys.HELP_ID, "cvs.merge");

    DiffManager.getInstance().showMerge(project, request);
  }
  catch (InvalidDiffRequestException err) {
    Messages.showErrorDialog(err.getLocalizedMessage(), DiffBundle.message("merge.files.dialog.title"));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:MergeFilesAction.java


示例19: handle

import com.intellij.diff.DiffManager; //导入依赖的package包/类
@Override
protected void handle(final Project project, final String value, XDebuggerTree tree) {
  UIUtil.invokeLaterIfNeeded(() -> {
    DiffRequest request = DiffRequestFactory.getInstance().createClipboardVsValue(value);
    DiffManager.getInstance().showDiff(project, request);
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:XCompareWithClipboardAction.java


示例20: actionPerformed

import com.intellij.diff.DiffManager; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(@Nonnull AnActionEvent e) {
  final DataContext dc = e.getDataContext();
  if ((!isVisible(dc)) || (!isEnabled(dc))) return;

  final Project project = dc.getData(CommonDataKeys.PROJECT);
  final Iterable<Pair<FilePath, FileStatus>> iterable = e.getRequiredData(VcsDataKeys.UPDATE_VIEW_FILES_ITERABLE);
  final Label before = (Label)e.getRequiredData(VcsDataKeys.LABEL_BEFORE);
  final Label after = (Label)e.getRequiredData(VcsDataKeys.LABEL_AFTER);
  final FilePath selectedUrl = dc.getData(VcsDataKeys.UPDATE_VIEW_SELECTED_PATH);

  MyDiffRequestChain requestChain = new MyDiffRequestChain(project, iterable, before, after, selectedUrl);
  DiffManager.getInstance().showDiff(project, requestChain, DiffDialogHints.FRAME);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:ShowUpdatedDiffAction.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IndexedMesh类代码示例发布时间:2022-05-22
下一篇:
Java MetricSampleQuantiles类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap