beansoft / iscratch-support

Supports for the Notes IDEA plugin
Other
3 stars 0 forks source link

移动文件之后需要重新修改文件地址 #37

Open losingmap opened 1 year ago

losingmap commented 1 year ago

移动文件之后路径不会改变,可以考虑监听文件移动的事件来更改文件地址 public class NotesVirtualFileListener implements VirtualFileListener { @Override public void fileMoved(@NotNull VirtualFileMoveEvent event) { String fileName = event.getFileName(); String oldPath = event.getOldParent().getPath() + "/" + fileName; String newPath = event.getNewParent().getPath() + "/" + fileName; ConnectSQLite.executeSql("update favorite_leaf\n" + "set url = '" + newPath + "'\n" + "where url = '" + oldPath + "'"); } }

注册监听事件 VirtualFileManager.getInstance().addVirtualFileListener(new NotesVirtualFileListener());

beansoft commented 1 year ago

哇,核心代码都写了 万分感谢 尽快开发上线

losingmap commented 1 year ago

期待ing ^_^