}
private void startCore() {
/* Dialog to show progress */
final ProgressMonitorDialog dialog = new ProgressMonitorDialog(new Shell(Display.getDefault())) {
@Override
protected Point getInitialLocation(Point initialSize) {
Rectangle displayBounds = getParentShell().getDisplay().getPrimaryMonitor().getBounds();
Point shellSize = getInitialSize();
int x = displayBounds.x + (displayBounds.width - shellSize.x) >> 1;
int y = displayBounds.y + (displayBounds.height - shellSize.y) >> 1;
return new Point(x, y);
}
@Override
protected Point getInitialSize() {
int minWidth = 380;
int minHeight = getShell().computeSize(minWidth, SWT.DEFAULT).y;
return new Point(minWidth, minHeight);
}
@Override
protected Control createButtonBar(Composite parent) {
return null;
}
};
dialog.setOpenOnRun(false);
/* Runnable to start core */
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
LongOperationMonitor callbackMonitor = new LongOperationMonitor(monitor) {
@Override
public void beginLongOperation() {
Display.getDefault().syncExec(new Runnable() {
public void run() {
dialog.open();
}
});
}
};
/* Start Core */
InternalOwl.getDefault().startup(callbackMonitor);
}
};
/* Execute the Runnable */
try {
dialog.run(false, false, runnable);
} catch (InvocationTargetException e) {
Activator.getDefault().logError(e.getMessage(), e);
} catch (InterruptedException e) {
Activator.getDefault().logError(e.getMessage(), e);
}