本文共 619 字,大约阅读时间需要 2 分钟。
1、如果此节点已有按钮由此功能,找到他含有IProgressMonitor属性的父类,继承就行,但注意,model属性不要再提供getset方法,否则父类model属性会为空。
2、自己写,通过TPAProgressUtil 获取带风车的幕布组件,而且要另起线程(比如SwingWorker),但一定要记得finally里关掉, if (monitor != null) { monitor.done(); monitor = null; } private void showMonitor() { if ((monitor != null) && (!monitor.isDone())) { return; }monitor = getTpaProgressUtil().getTPAProgressMonitor(); monitor.beginTask("", -1); monitor.setProcessInfo("");}public TPAProgressUtil getTpaProgressUtil() { if (tpaProgressUtil == null) { tpaProgressUtil = new TPAProgressUtil(); tpaProgressUtil.setContext(getModel().getContext()); } return tpaProgressUtil;}
转载地址:http://xzfrf.baihongyu.com/