// Path: tmc-plugin-intellij/src/main/java/fi/helsinki/cs/tmc/intellij/services/ClipboardService.java
// public class ClipboardService {
// 
//     private static final Logger logger = LoggerFactory.getLogger(ClipboardService.class);
// 
//     public static void copyToClipBoard(String stringToCopy) {
//         logger.info("Copying {} to the clip board. @ClipboardService", stringToCopy);
//         Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
//         StringSelection selection = new StringSelection(stringToCopy);
//         clipboard.setContents(selection, null);
//     }
// 
//     public static String getClipBoard() {
//         return ClipboardUtil.getTextInClipboard();
//     }
// }


import fi.helsinki.cs.tmc.intellij.services.ClipboardService;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.intellij.util.ui.JBUI;
import java.awt.*;
import java.io.IOException;
import java.net.URI;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
package fi.helsinki.cs.tmc.intellij.ui.pastebin;




/**
 * Creates the Pastebin result panel.
 */
public class ResultPanel {
    private JTextField textField1;
    private JButton viewPasteButton;
    private JButton copyToClipboardButton;
    private JButton okButton;
    private JPanel jpanel1;

    public ResultPanel(final URI uri, final PasteWindow pasteWindow) {
        okButton.addActionListener(
                event -> pasteWindow.close());
        viewPasteButton.addActionListener(
                event -> {
                    try {
                        Desktop.getDesktop().browse(uri);
                    } catch (IOException e1) {
                        e1.printStackTrace();
                    }
                });
        copyToClipboardButton.addActionListener(
// Path: tmc-plugin-intellij/src/main/java/fi/helsinki/cs/tmc/intellij/services/ClipboardService.java
// public class ClipboardService {
// 
//     private static final Logger logger = LoggerFactory.getLogger(ClipboardService.class);
// 
//     public static void copyToClipBoard(String stringToCopy) {
//         logger.info("Copying {} to the clip board. @ClipboardService", stringToCopy);
//         Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
//         StringSelection selection = new StringSelection(stringToCopy);
//         clipboard.setContents(selection, null);
//     }
// 
//     public static String getClipBoard() {
//         return ClipboardUtil.getTextInClipboard();
//     }
// }


// Path: tmc-plugin-intellij/src/main/java/fi/helsinki/cs/tmc/intellij/ui/pastebin/ResultPanel.java
import fi.helsinki.cs.tmc.intellij.services.ClipboardService;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.intellij.util.ui.JBUI;
import java.awt.*;
import java.io.IOException;
import java.net.URI;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

package fi.helsinki.cs.tmc.intellij.ui.pastebin;




/**
 * Creates the Pastebin result panel.
 */
public class ResultPanel {
    private JTextField textField1;
    private JButton viewPasteButton;
    private JButton copyToClipboardButton;
    private JButton okButton;
    private JPanel jpanel1;

    public ResultPanel(final URI uri, final PasteWindow pasteWindow) {
        okButton.addActionListener(
                event -> pasteWindow.close());
        viewPasteButton.addActionListener(
                event -> {
                    try {
                        Desktop.getDesktop().browse(uri);
                    } catch (IOException e1) {
                        e1.printStackTrace();
                    }
                });
        copyToClipboardButton.addActionListener(
                event -> ClipboardService.copyToClipBoard(textField1.getText()));