大夢想家

          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 阿南 閱讀(1316) 評論(0)  編輯  收藏 所屬分類: Eclipse-RCP

          主站蜘蛛池模板: 克什克腾旗| 南通市| 兴安县| 都江堰市| 呈贡县| 乐业县| 莆田市| 军事| 广水市| 大安市| 土默特右旗| 岗巴县| 嘉义县| 尖扎县| 鹤岗市| 霍山县| 乐业县| 沧州市| 洛阳市| 辰溪县| 茂名市| 平南县| 铅山县| 淄博市| 淮阳县| 德化县| 阿尔山市| 青阳县| 剑阁县| 连城县| 嘉兴市| 玉龙| 绥德县| 霞浦县| 荆门市| 鸡泽县| 公安县| 信宜市| 兴山县| 仪征市| 九寨沟县|