コード例 #1
0
    @Override
    public Object getData(String dataId) {
      if (PlatformDataKeys.DIFF_VIEWER.is(dataId)) {
        return myDiffPanel;
      }
      if (FocusDiffSide.DATA_KEY.is(dataId)) {
        return myDiffPanel.myCurrentSide == null ? null : myFocusDiffSide;
      }
      if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
        final DiffSideView currentSide = myDiffPanel.myCurrentSide;
        if (currentSide != null) {
          return new DiffNavigatable(currentSide);
        }
      }

      return super.getData(dataId);
    }
コード例 #2
0
 @Nullable
 public static DiffPanelImpl fromDataContext(DataContext dataContext) {
   DiffViewer viewer = PlatformDataKeys.DIFF_VIEWER.getData(dataContext);
   return viewer instanceof DiffPanelImpl ? (DiffPanelImpl) viewer : null;
 }