if (pasteInMainNode) {
m = linker.getSelectionContext().getMainNode();
}
if (m != null) {
linker.loading(Messages.get("statusbar.pasting.label"));
final CopyPasteEngine copyPasteEngine = CopyPasteEngine.getInstance();
JahiaContentManagementService
.App.getInstance().paste(JCRClientUtils.getPathesList(copyPasteEngine.getCopiedPaths()), m.getPath(), null, copyPasteEngine.isCut(), new BaseAsyncCallback() {
public void onApplicationFailure(Throwable throwable) {
Window.alert(Messages.get("failure.paste.label") + "\n" + throwable.getLocalizedMessage());
linker.loaded();
}
public void onSuccess(Object o) {
boolean refresh = false;
for (GWTJahiaNode n : copyPasteEngine.getCopiedPaths()) {
if (!n.isFile()) {
refresh = true;
break;
}
}
copyPasteEngine.onPastedPath();
linker.loaded();
if (refresh) {
linker.refresh(EditLinker.REFRESH_ALL);
} else {
linker.refresh(Linker.REFRESH_MAIN);