idea plugin 進度條


ProgressManager.getInstance().run(new Task.Backgroundable(project, "Switching Env") {
@Override
public void run(@NotNull ProgressIndicator indicator) {
indicator.setText("test");
indicator.setIndeterminate(true);

File from = new File(fromPath());
File to = new File(toPath());

if (to.exists()) to.delete();
try {
Files.copy(from.toPath(), to.toPath());
} catch (IOException e1) {
e1.printStackTrace();
}

replaceHost();

// 重新從硬盤加載
VirtualFile virtualFile = VfsUtil.findFileByIoFile(to, true);
if (virtualFile != null) {
virtualFile.refresh(true, false);
}
}
});


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM