Fix error with cut operation

This commit is contained in:
Alexander Lobas
2012-03-23 22:00:50 +04:00
parent 27395b61e6
commit b8d122582f
@@ -142,21 +142,24 @@ public class CommonEditActionsProvider implements DeleteProvider, CopyProvider,
}
private boolean doCopy() {
return myDesigner.getToolProvider().execute(new ThrowableRunnable<Exception>() {
@Override
public void run() throws Exception {
Element root = new Element("designer");
root.setAttribute("target", myDesigner.getPlatformTarget());
try {
Element root = new Element("designer");
root.setAttribute("target", myDesigner.getPlatformTarget());
List<RadComponent> components = RadComponent.getPureSelection(myDesigner.getActionsArea().getSelection());
for (RadComponent component : components) {
component.copyTo(root);
}
SerializedComponentData data = new SerializedComponentData(new XMLOutputter().outputString(root));
CopyPasteManager.getInstance().setContents(new SimpleTransferable(data, DATA_FLAVOR));
List<RadComponent> components = RadComponent.getPureSelection(myDesigner.getActionsArea().getSelection());
for (RadComponent component : components) {
component.copyTo(root);
}
});
SerializedComponentData data = new SerializedComponentData(new XMLOutputter().outputString(root));
CopyPasteManager.getInstance().setContents(new SimpleTransferable(data, DATA_FLAVOR));
return true;
}
catch (Throwable e) {
myDesigner.showError("Copy error:", e);
return false;
}
}
//////////////////////////////////////////////////////////////////////////////////////////
//