cutAction.setText("Cut");
copyAction = new Action() {
public void run() {
Clipboard clipboard = new Clipboard(getDisplay());
TargetTransfer transfer = TargetTransfer.getInstance();
IStructuredSelection selection = (IStructuredSelection) targetViewer.getSelection();
InternalTarget[] modelArray = new InternalTarget[selection.size()];
modelArray = (InternalTarget[]) selection.toList().toArray(modelArray);
clipboard.setContents(new Object[]{modelArray},
new Transfer[]{transfer});
clipboard.dispose();
}
};
copyAction.setText("Copy");
pasteAction = new Action() {
public void run() {
TargetTransfer transfer = TargetTransfer.getInstance();
Clipboard clipboard = new Clipboard(getDisplay());
try {
Object[] contents = (Object[]) clipboard.getContents(transfer);