import org.eclipse.jface.util.Util; //导入方法依赖的package包/类
private Shell createLoadingShell() {
final Shell shell = new Shell(SWT.NO_TRIM);
shell.setLayout(new FormLayout());
shell.setMinimumSize(backgroundWidth, backgroundHeight);
shell.setSize(backgroundWidth, backgroundHeight);
Image background = IconLoader.loadIconNormal("loading");
Label lblTitle = new Label(shell, SWT.TRANSPARENT);
lblTitle.setFont(FontSize.getThisFontInNewSize(lblTitle.getFont(), 24, SWT.BOLD));
FormData fd_lblTitle = new FormData();
fd_lblTitle.top = new FormAttachment(0, 0);
fd_lblTitle.left = new FormAttachment(0, 10);
fd_lblTitle.right = new FormAttachment(100, -10);
lblTitle.setLayoutData(fd_lblTitle);
lblTitle.setText("Loading");
progressBar = new ProgressBar(shell, SWT.NONE);
progressBar.setMaximum(expectedMessageCount);
progressBar.setMinimum(0);
progressBar.setSelection(0);
FormData fd_progressBar = new FormData();
fd_progressBar.bottom = new FormAttachment(100, -10);
fd_progressBar.left = new FormAttachment(0, 10);
fd_progressBar.right = new FormAttachment(100, -10);
progressBar.setLayoutData(fd_progressBar);
lblAction = new Text(shell, SWT.WRAP | SWT.TRANSPARENT);
lblAction.setEditable(false);
FormData fd_lblAction = new FormData();
fd_lblAction.top = new FormAttachment(progressBar, -60);
fd_lblAction.bottom = new FormAttachment(progressBar, -10);
fd_lblAction.left = new FormAttachment(0, 10);
fd_lblAction.right = new FormAttachment(100, -200);
lblAction.setLayoutData(fd_lblAction);
lblAction.setText("Starting...");
if (!Util.isGtk()) {
shell.setBackgroundImage(background);
shell.setBackgroundMode(SWT.INHERIT_FORCE);
lblTitle.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
lblAction.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
}
shell.setSize(background.getBounds().x, background.getBounds().y);
shell.setLocation(getMonitorCenter(shell));
return shell;
}