protected boolean canPerform() { return getCurrentTarget().canCopy(); }
protected boolean canPerform() { return getCurrentTarget().canCopy(); }
public void actionPerformed(ActionEvent e) { List<OWLObject> objects = getCurrentTarget().getObjectsToCopy(); if (objects.isEmpty()) { // Shouldn't really happen, but just in case return; } // Push the objects on to the clip board ViewClipboard clipboard = ViewClipboard.getInstance(); clipboard.getClipboard().setContents(new TransferableOWLObject(getOWLModelManager(), objects), null); new TransferableOWLObject(getOWLModelManager(), objects); StringBuilder buffer = new StringBuilder(); for (OWLObject owlObject : objects) { buffer.append(getOWLModelManager().getRendering(owlObject)); buffer.append("\n"); } StringSelection stringSelection = new StringSelection(buffer.toString().trim()); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringSelection, null); // Actually, we could put text on to the system clipboard // OWLObject should be serializable!!! }
public void actionPerformed(ActionEvent e) { List<OWLObject> objects = getCurrentTarget().getObjectsToCopy(); if (objects.isEmpty()) { // Shouldn't really happen, but just in case return; } // Push the objects on to the clip board ViewClipboard clipboard = ViewClipboard.getInstance(); clipboard.getClipboard().setContents(new TransferableOWLObject(getOWLModelManager(), objects), null); new TransferableOWLObject(getOWLModelManager(), objects); StringBuilder buffer = new StringBuilder(); for (OWLObject owlObject : objects) { buffer.append(getOWLModelManager().getRendering(owlObject)); buffer.append("\n"); } StringSelection stringSelection = new StringSelection(buffer.toString().trim()); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringSelection, null); // Actually, we could put text on to the system clipboard // OWLObject should be serializable!!! }