mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix error with cut operation
This commit is contained in:
+16
-13
@@ -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;
|
||||
}
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user