RCP的主窗口在桌面自动居中显示的方法
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {@Overridepublic void postWindowOpen() {super.postWindowOpen();// 居中窗口Shell shell = getWindowConfigurer().getWindow().getShell();Rectangle screenSize = Display.getDefault().getClientArea();Rectangle frameSize = shell.getBounds();shell.setLocation((screenSize.width - frameSize.width) / 2,(screenSize.height - frameSize.height) / 2);}}
?