org.jpedal.examples.viewer.commands.Copy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of OpenViewerFX Show documentation
Show all versions of OpenViewerFX Show documentation
Open Source (LGPL) JavaFX PDF Viewer
/*
* ===========================================
* Java Pdf Extraction Decoding Access Library
* ===========================================
*
* Project Info: http://www.idrsolutions.com
* Help section for developers at http://www.idrsolutions.com/support/
*
* (C) Copyright 1997-2017 IDRsolutions and Contributors.
*
* This file is part of JPedal/JPDF2HTML5
*
@LICENSE@
*
* ---------------
* Copy.java
* ---------------
*/
package org.jpedal.examples.viewer.commands;
import java.awt.Toolkit;
import java.awt.datatransfer.StringSelection;
import org.jpedal.PdfDecoderInt;
import org.jpedal.examples.viewer.Values;
import org.jpedal.examples.viewer.commands.generic.GUICopy;
import org.jpedal.gui.GUIFactory;
/**
* Copies the text a user has selected/highlighted.
*/
public class Copy extends GUICopy {
public static void execute(final GUIFactory currentGUI, final PdfDecoderInt decode_pdf, final Values commonValues) {
final String copyText = copySelectedText(decode_pdf, currentGUI, commonValues);
final StringSelection ss = new StringSelection(copyText);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy