本文整理匯總了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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
示例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());
}
示例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;
}
}
示例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;
}