Search in sources :

Example 1 with CayenneTransferable

use of org.apache.cayenne.modeler.util.CayenneTransferable in project cayenne by apache.

the class CopyAction method performAction.

/**
 * Performs copying of items into system buffer
 */
@Override
public void performAction(ActionEvent e) {
    ProjectController mediator = getProjectController();
    Object content = copy(mediator);
    if (content != null) {
        Clipboard sysClip = Toolkit.getDefaultToolkit().getSystemClipboard();
        sysClip.setContents(new CayenneTransferable(content), null);
    }
    // update paste button
    getApplication().getActionManager().getAction(PasteAction.class).updateState();
}
Also used : CayenneTransferable(org.apache.cayenne.modeler.util.CayenneTransferable) Clipboard(java.awt.datatransfer.Clipboard) ProjectController(org.apache.cayenne.modeler.ProjectController)

Aggregations

Clipboard (java.awt.datatransfer.Clipboard)1 ProjectController (org.apache.cayenne.modeler.ProjectController)1 CayenneTransferable (org.apache.cayenne.modeler.util.CayenneTransferable)1