From d20f07b063a88feb8acaaebd1c062fe6c9ad5801 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Wed, 30 Oct 2024 14:46:15 +0200 Subject: [PATCH] move code which accesses system selection to CopyPasteManager (for RDCT-1653) add default implementations to new CopyPasteManager methods (cherry picked from commit 28f7098deb3700a9a7f711986466cb028d4785b3) IJ-CR-147422 GitOrigin-RevId: 2555e6921edb7cfcf4c43b67772efb1bad87ec4a --- platform/editor-ui-api/api-dump.txt | 6 +++--- .../src/com/intellij/openapi/ide/CopyPasteManager.java | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/platform/editor-ui-api/api-dump.txt b/platform/editor-ui-api/api-dump.txt index 6ffa5012c3d1..9f9df5fbc64a 100644 --- a/platform/editor-ui-api/api-dump.txt +++ b/platform/editor-ui-api/api-dump.txt @@ -2689,12 +2689,12 @@ a:com.intellij.openapi.ide.CopyPasteManager - a:getContents(java.awt.datatransfer.DataFlavor):java.lang.Object - s:getCutColor():java.awt.Color - s:getInstance():com.intellij.openapi.ide.CopyPasteManager -- a:getSystemSelectionContents():java.awt.datatransfer.Transferable +- getSystemSelectionContents():java.awt.datatransfer.Transferable - a:isCutElement(java.lang.Object):Z -- a:isSystemSelectionSupported():Z +- isSystemSelectionSupported():Z - a:removeContentChangedListener(com.intellij.openapi.ide.CopyPasteManager$ContentChangedListener):V - a:setContents(java.awt.datatransfer.Transferable):V -- a:setSystemSelectionContents(java.awt.datatransfer.Transferable):V +- setSystemSelectionContents(java.awt.datatransfer.Transferable):V - a:stopKillRings():V - a:stopKillRings(com.intellij.openapi.editor.Document):V com.intellij.openapi.ide.CopyPasteManager$ContentChangedListener diff --git a/platform/editor-ui-api/src/com/intellij/openapi/ide/CopyPasteManager.java b/platform/editor-ui-api/src/com/intellij/openapi/ide/CopyPasteManager.java index ba9fc1a20e30..1b35a179251e 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/ide/CopyPasteManager.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/ide/CopyPasteManager.java @@ -78,18 +78,22 @@ public abstract class CopyPasteManager { /** * Tells whether {@linkplain Toolkit#getSystemSelection() system selection} is supported in the current system. */ - public abstract boolean isSystemSelectionSupported(); + public boolean isSystemSelectionSupported() { + return false; + } /** * Returns current system selection contents, or {@code null} if system selection has no contents, or if it's * {@linkplain #isSystemSelectionSupported() not supported}. */ - public abstract @Nullable Transferable getSystemSelectionContents(); + public @Nullable Transferable getSystemSelectionContents() { + return null; + } /** * Sets current system selection contents. Does nothing if system selection is {@linkplain #isSystemSelectionSupported() not supported}. */ - public abstract void setSystemSelectionContents(@NotNull Transferable content); + public void setSystemSelectionContents(@NotNull Transferable content) {} public interface ContentChangedListener extends EventListener { void contentChanged(final @Nullable Transferable oldTransferable, final Transferable newTransferable);