@Override protected void execute(ExecutionEvent event, SortedSet<IEntity> resources) { if (resources.size() == 0) { return; } if (!CommonIDEParameters.isRolesEnabled()) { // assume trial instance, hence disable this function MessageDialog.openInformation(null, PASTE_ERROR, PASTE_FUNCTION_IS_DISABLED_IN_THIS_INSTANCE); return; } IRepository repository = RepositoryFacade.getInstance().getRepository(); String targetReposiotryPath = resources.first().getPath().toString(); Clipboard clipboard = Clipboard.getInstance(); String command = clipboard.getCommand(); Throwable throwable = null; if (CUT.equals(command) || COPY.equals(command)) { for (Object name : clipboard) { IEntity resource = (IEntity) name; String sourceRepositoryPath = resource.getPath().toString(); try { byte[] data = repository.exportZip(sourceRepositoryPath, true); repository.importZip(data, targetReposiotryPath); } catch (IOException e) { if (throwable == null) { throwable = e; } } if (CUT.equals(command)) { try { resource.delete(); } catch (IOException e) { if (throwable == null) { throwable = e; } } } } } if (throwable != null) { MessageDialog.openWarning(null, PASTE_ERROR, SOME_OR_ALL_OF_THE_FILES_COULD_NOT_BE_PASTED); } RefreshHandler.refreshActivePart(event); }