Example usage for com.intellij.openapi.editor EditorModificationUtil getContentsToPasteToEditor

List of usage examples for com.intellij.openapi.editor EditorModificationUtil getContentsToPasteToEditor

Introduction

In this page you can find the example usage for com.intellij.openapi.editor EditorModificationUtil getContentsToPasteToEditor.

Prototype

@Nullable
    public static Transferable getContentsToPasteToEditor(@Nullable Producer<? extends Transferable> producer) 

Source Link

Usage

From source file:com.vladsch.MissingInActions.util.ClipboardCaretContent.java

License:Apache License

@Nullable
public static Transferable getTransferable(final @NotNull Editor editor, DataContext dataContext) {
    try {/*w w w .  jav  a 2  s .c  o m*/
        Producer<Transferable> producer = PasteAction.TRANSFERABLE_PROVIDER.getData(dataContext);
        //noinspection UnnecessaryLocalVariable
        Transferable transferable = EditorModificationUtil.getContentsToPasteToEditor(producer);
        return transferable;
    } catch (Throwable e) {
        logger.error("error", e);
    }
    return null;
}