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
This commit is contained in:
Dmitry Batrak
2024-10-30 14:46:15 +02:00
committed by intellij-monorepo-bot
parent b2cac236d1
commit d20f07b063
2 changed files with 10 additions and 6 deletions

View File

@@ -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

View File

@@ -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);