Search in sources :

Example 1 with ExClipboard

use of org.openide.util.datatransfer.ExClipboard in project netbeans-mmd-plugin by raydac.

the class MMDGraphEditor method registerAsClipboardListener.

private void registerAsClipboardListener() {
    final Clipboard clipboard = NbUtils.findClipboard();
    if (clipboard instanceof ExClipboard) {
        ((ExClipboard) clipboard).addClipboardListener(this);
    } else {
        clipboard.addFlavorListener(this);
    }
    processClipboardChange(clipboard);
}
Also used : Clipboard(java.awt.datatransfer.Clipboard) ExClipboard(org.openide.util.datatransfer.ExClipboard) ExClipboard(org.openide.util.datatransfer.ExClipboard)

Example 2 with ExClipboard

use of org.openide.util.datatransfer.ExClipboard in project netbeans-mmd-plugin by raydac.

the class MMDGraphEditor method componentClosed.

@Override
public void componentClosed() {
    try {
        this.mindMapPanel.dispose();
        LOGGER.info("MMD Editor is disposed : " + this.mindMapPanel.toString());
    } finally {
        final Clipboard clipboard = NbUtils.findClipboard();
        if (clipboard instanceof ExClipboard) {
            ((ExClipboard) clipboard).removeClipboardListener(this);
        } else {
            clipboard.removeFlavorListener(this);
        }
        super.componentClosed();
    }
}
Also used : Clipboard(java.awt.datatransfer.Clipboard) ExClipboard(org.openide.util.datatransfer.ExClipboard) ExClipboard(org.openide.util.datatransfer.ExClipboard)

Aggregations

Clipboard (java.awt.datatransfer.Clipboard)2 ExClipboard (org.openide.util.datatransfer.ExClipboard)2