大梦想家

5年开发工程师,2年实施经理,X年售前顾问,......
数据加载中……
How to show taskbar icon when use splash?
    这个问题非常的重要!
    做过RCP开发的朋友应该都遇到过,使用AbstractSplashHandler做的登陆界面,在windows的任务栏上面是不会显示的,这个问题让客户用起来很麻烦,总是动不动就找不到登陆界面了!现在有解决办法了~
 1Here is the modified Code of the InteractiveSplashHandler Class:
 2
 3
 4    private Shell splash;
 5
 6
 7    public void init(final Shell splash) {
 8        // Shell replaced by one with task bar icon
 9        // (old Style: SWT.TOOL, new Style: SWT.NO_TRIM)
10        replaceShell(splash);
11        // Store the shell
12        super.init(getSplash());
13        // Configure the shell layout
14        configureUISplash();
15        // Create UI Colors and Fonts
16        createColorsAndFonts();
17        // Create UI
18        createUI();
19        // Create UI listeners
20        createUIListeners();
21        // Force the splash screen to layout
22        splash.dispose();
23        getSplash().layout(true);
24        // Keep the splash screen visible and prevent the RCP application from
25        // loading until the close button is clicked.
26        doEventLoop();
27    }

28
29
30    private void replaceShell(Shell splash) {
31        Shell newSplash = new Shell(Display.getCurrent(), SWT.NO_TRIM);
32        newSplash.setBackgroundImage(splash.getBackgroundImage());
33        newSplash.setBounds(splash.getBounds());
34        newSplash.setFont(splash.getFont());
35        newSplash.setVisible(true);
36        setSplash(newSplash);
37    }

38
39
40    public Shell getSplash() {
41        return splash;
42    }

43
44
45    public void setSplash(Shell splash) {
46        this.splash = splash;
47    }

48
49

稍稍进行改造,就可以了~

客户虐我千百遍,我待客户如初恋!

posted on 2009-03-15 20:59 阿南 阅读(1286) 评论(0)  编辑  收藏 所属分类: Eclipse-RCP


只有注册用户登录后才能发表评论。


网站导航: