-
canCopy()
-
Checks if the copy to clipboard operation can be performed.
Returns:
Returns true if the copy to clipboard can be performed; otherwise, false.
-
Type
-
boolean
Example
const { Core } = window.getInstance();
const spreadsheetEditorManager = Core.documentViewer.getSpreadsheetEditorManager();
const spreadsheetEditorClipboard = spreadsheetEditorDocument.getClipboard();
const canCopy = spreadsheetEditorClipboard.canCopy();
if (canCopy) {
... // Perform copy operation
}
-
canCut()
-
Checks if the cut operation can be performed.
Returns:
Returns true if the cut operation can be performed; otherwise, false.
-
Type
-
boolean
Example
const { Core } = window.getInstance();
const spreadsheetEditorManager = Core.documentViewer.getSpreadsheetEditorManager();
const spreadsheetEditorClipboard = spreadsheetEditorDocument.getClipboard();
const canCut = spreadsheetEditorClipboard.canCut();
if (canCut) {
... // Perform cut operation
}
-
canPaste()
-
Checks if the clipboard contains data that can be pasted.
Returns:
Returns true if the paste operation can be performed; otherwise, false.
-
Type
-
boolean
Example
const { Core } = window.getInstance();
const spreadsheetEditorManager = Core.documentViewer.getSpreadsheetEditorManager();
const spreadsheetEditorClipboard = spreadsheetEditorDocument.getClipboard();
const canPaste = spreadsheetEditorClipboard.canPaste();
if (canPaste) {
... // Perform paste operation
}
-
copy()
-
Copies the currently selected content to the clipboard.
Returns:
-
Type
-
void
Example
const { Core } = window.getInstance();
const spreadsheetEditorManager = Core.documentViewer.getSpreadsheetEditorManager();
const spreadsheetEditorClipboard = spreadsheetEditorDocument.getClipboard();
if (spreadsheetEditorClipboard.canCopy()) {
spreadsheetEditorClipboard.copy();
}
-
cut()
-
Cuts the currently selected content from the SheetEditor and placing it on the clipboard.
Returns:
-
Type
-
void
Example
const { Core } = window.getInstance();
const spreadsheetEditorManager = Core.documentViewer.getSpreadsheetEditorManager();
const spreadsheetEditorClipboard = spreadsheetEditorDocument.getClipboard();
spreadsheetEditorClipboard.cut();
-
paste()
-
Pastes content from the clipboard.
Returns:
A promise that resolves when the paste operation is complete.
-
Type
-
Promise.<void>
Example
const { Core } = window.getInstance();
const spreadsheetEditorManager = Core.documentViewer.getSpreadsheetEditorManager();
const spreadsheetEditorClipboard = spreadsheetEditorDocument.getClipboard();
if (spreadsheetEditorClipboard.canPaste()) {
await spreadsheetEditorClipboard.paste();
}