如何在java的非UI线程中使用OleFrame?
你能告诉我怎么使用吗如何在java的非UI线程中使用OleFrame?,java,swt,ui-thread,Java,Swt,Ui Thread,你能告诉我怎么使用吗 org.eclipse.swt.ole.win32.OleFrame 在非UI线程中? 如果在非UI线程抛出中创建“OleFrame”。 我知道UI线程和非UI线程的区别。 我试图实现的是在“IRunnableWithProgress”中使用org.eclipse.swt.ole.win32.OleAutomation 添加 for(;mShell.getDisplay().readAndDispatch();); (mShell在构造函数中给出)每次OLE调用后都会有
org.eclipse.swt.ole.win32.OleFrame
在非UI线程中?
如果在非UI线程抛出中创建“OleFrame”。
我知道UI线程和非UI线程的区别。
我试图实现的是在“IRunnableWithProgress”中使用org.eclipse.swt.ole.win32.OleAutomation
添加
for(;mShell.getDisplay().readAndDispatch(););
(mShell
在构造函数中给出)每次OLE调用后都会有一些帮助,但还不够
任何帮助都将不胜感激
OutlookHelper outlook = new OutlookHelper(mShell, mModel.getEmailToAddresses(), "Feedback report", emailInfo.body, attachment);
new ProgressMonitorDialog(mShell).run(true, false, outlook);
public class OutlookHelper implements IRunnableWithProgress {
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Sending...", IProgressMonitor.UNKNOWN);
send(monitor);
monitor.done();
}
private void send(IProgressMonitor monitor) throws InterruptedException {
monitor.subTask("Creating OLE frame");
// Will block UI thread here ...
final OleFrame frame = new OleFrame(mShell, SWT.NONE);
monitor.subTask("Starting Outlook application");
// Will block UI thread here ...
OleClientSite site = new OleClientSite(frame, SWT.NONE, "Outlook.Application");
...
}
}