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


Java TransferableFileEditorState類代碼示例

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


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

示例1: propertyChange

import com.intellij.openapi.fileEditor.TransferableFileEditorState; //導入依賴的package包/類
@Override
public void propertyChange(PropertyChangeEvent evt) {
  if (myDuringUpdate || !isEnabled()) return;
  if (!(evt.getSource() instanceof FileEditor)) return;

  TransferableFileEditorState sourceState = getEditorState(((FileEditor)evt.getSource()));
  if (sourceState == null) return;

  Map<String, String> options = sourceState.getTransferableOptions();
  String id = sourceState.getEditorId();

  for (FileEditor editor : myEditors) {
    if (evt.getSource() != editor) {
      updateEditor(editor, id, options);
    }
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:18,代碼來源:TransferableFileEditorStateSupport.java

示例2: processContextHints

import com.intellij.openapi.fileEditor.TransferableFileEditorState; //導入依賴的package包/類
public void processContextHints(@Nonnull DiffRequest request, @Nonnull DiffContext context) {
  if (!isEnabled()) return;

  for (BinaryEditorHolder holder : myHolders) {
    FileEditor editor = holder.getEditor();
    TransferableFileEditorState state = getEditorState(holder.getEditor());
    if (state != null) {
      readContextData(context, editor, state);
    }
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:12,代碼來源:TransferableFileEditorStateSupport.java

示例3: updateContextHints

import com.intellij.openapi.fileEditor.TransferableFileEditorState; //導入依賴的package包/類
public void updateContextHints(@Nonnull DiffRequest request, @Nonnull DiffContext context) {
  if (!isEnabled()) return;

  Set<String> updated = ContainerUtil.newHashSet();

  for (BinaryEditorHolder holder : myHolders) {
    TransferableFileEditorState state = getEditorState(holder.getEditor());
    if (state != null) {
      boolean processed = !updated.add(state.getEditorId());
      if (!processed) writeContextData(context, state);
    }
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:14,代碼來源:TransferableFileEditorStateSupport.java

示例4: readContextData

import com.intellij.openapi.fileEditor.TransferableFileEditorState; //導入依賴的package包/類
private static void readContextData(@Nonnull DiffContext context,
                                    @Nonnull FileEditor editor,
                                    @Nonnull 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);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:11,代碼來源:TransferableFileEditorStateSupport.java

示例5: writeContextData

import com.intellij.openapi.fileEditor.TransferableFileEditorState; //導入依賴的package包/類
private static void writeContextData(@Nonnull DiffContext context, @Nonnull 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());
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:10,代碼來源:TransferableFileEditorStateSupport.java

示例6: updateEditor

import com.intellij.openapi.fileEditor.TransferableFileEditorState; //導入依賴的package包/類
private void updateEditor(@Nonnull FileEditor editor, @Nonnull String id, @Nonnull Map<String, String> options) {
  try {
    myDuringUpdate = true;
    TransferableFileEditorState state = getEditorState(editor);
    if (state != null && state.getEditorId().equals(id)) {
      state.setTransferableOptions(options);
      editor.setState(state);
    }
  }
  finally {
    myDuringUpdate = false;
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:14,代碼來源:TransferableFileEditorStateSupport.java

示例7: getEditorState

import com.intellij.openapi.fileEditor.TransferableFileEditorState; //導入依賴的package包/類
@javax.annotation.Nullable
private static TransferableFileEditorState getEditorState(@Nonnull FileEditor editor) {
  FileEditorState state = editor.getState(FileEditorStateLevel.FULL);
  return state instanceof TransferableFileEditorState ? (TransferableFileEditorState)state : null;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:6,代碼來源:TransferableFileEditorStateSupport.java


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