private static void writeContextData(
      @NotNull DiffContext context, @NotNull TransferableFileEditorState state) {
    Map<String, Map<String, String>> map = context.getUserData(TRANSFERABLE_FILE_EDITOR_STATE);
    if (map == null) {
      map = ContainerUtil.newHashMap();
      context.putUserData(TRANSFERABLE_FILE_EDITOR_STATE, map);
    }

    map.put(state.getEditorId(), state.getTransferableOptions());
  }
  private static void readContextData(
      @NotNull DiffContext context,
      @NotNull FileEditor editor,
      @NotNull TransferableFileEditorState state) {
    Map<String, Map<String, String>> map = context.getUserData(TRANSFERABLE_FILE_EDITOR_STATE);
    Map<String, String> options = map != null ? map.get(state.getEditorId()) : null;
    if (options == null) return;

    state.setTransferableOptions(options);
    editor.setState(state);
  }
コード例 #3
0
 public void processContextHints(@NotNull DiffRequest request, @NotNull DiffContext context) {
   ThreeSide side = context.getUserData(DiffUserDataKeys.PREFERRED_FOCUS_THREESIDE);
   if (side != null) setCurrentSide(side);
 }
コード例 #4
0
 public void updateContextHints(@NotNull DiffRequest request, @NotNull DiffContext context) {
   context.putUserData(DiffUserDataKeys.PREFERRED_FOCUS_SIDE, myCurrentSide);
 }