public interface IRunnableWithProgress {
public void run(IProgressMonitor monitor)
throws InvocationTargetException
}
這個類的使用和Runnable非常相似
ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
dialog
public void run(IProgressMonitor monitor)
throws InvocationTargetException
{
final int ticks =
monitor
try
{
for (int i =
{
if (monitor
throw new InterruptedException();
monitor
}
} finally
{
monitor
}
}
});
調用beginTask方法來完成任務
除了ProgressMonitorDialog外
除了可以自己構造進度對話框來顯示進度之外
IProgressService progressService = PlatformUI
progressService
public void run(IProgressMonitor monitor)
{
//執行耗時的操作
}
});
在調用Eclipse的方法或者第三方插件的一些方法的時候
right
From:http://tw.wingwit.com/Article/program/Java/ky/201311/29187.html