大夢想家

          5年開發工程師,2年實施經理,X年售前顧問,......

          公告

          5年開發工程師,2年實施經理,X年售前顧問,......
          <2007年5月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          統計

          • 隨筆 - 130
          • 文章 - 5
          • 評論 - 427
          • 引用 - 0

          常用鏈接

          留言簿(23)

          我參與的團隊

          隨筆分類(188)

          隨筆檔案(123)

          文章分類(3)

          文章檔案(7)

          Friends

          Java Link

          My Link

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 262936
          • 排名 - 217

          最新評論

          閱讀排行榜

          評論排行榜

          Eclipse3.3m7 VS Eclipse3.2.2
          Eclipse3.3m7 VS Eclipse3.2.2
          沒有深入研究過兩者的差別,只是昨天在更換平臺時發現的。差別主要存在與Application類上,兩者繼承或者實現的類不同,也就決定了其底層的不同。
          Eclipse3.3M7
           1import org.eclipse.equinox.app.IApplication;
           2import org.eclipse.equinox.app.IApplicationContext;
           3import org.eclipse.jface.wizard.WizardDialog;
           4import org.eclipse.swt.widgets.Display;
           5import org.eclipse.swt.widgets.Shell;
           6import org.eclipse.ui.IWorkbench;
           7import org.eclipse.ui.PlatformUI;
           8
           9import com.glnpu.glbom.ui.wizard.FirstTimeConfigWizard;
          10
          11/**
          12 * This class controls all aspects of the application's execution
          13 */

          14public class Application implements IApplication {
          15
          16    /* (non-Javadoc)
          17     * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
          18     */

          19    public Object start(IApplicationContext context) throws Exception {
          20        Display display = PlatformUI.createDisplay();
          21
          22        try {
          23            int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
          24            if (returnCode == PlatformUI.RETURN_RESTART)
          25                return IApplication.EXIT_RESTART;
          26            else
          27                return IApplication.EXIT_OK;
          28        }
           finally {
          29            display.dispose();
          30        }

          31        
          32    }

          33
          34
          35
          36    /* (non-Javadoc)
          37     * @see org.eclipse.equinox.app.IApplication#stop()
          38     */

          39    public void stop() {
          40        final IWorkbench workbench = PlatformUI.getWorkbench();
          41        if (workbench == null)
          42            return;
          43        final Display display = workbench.getDisplay();
          44        display.syncExec(new Runnable() {
          45            public void run() {
          46                if (!display.isDisposed())
          47                    workbench.close();
          48            }

          49        }
          );
          50    }

          51}

          52

          實現再org.eclipse.core.runtime.IPlatformRunnable;

          Eclipse3.2.2
           1import org.eclipse.core.runtime.IPlatformRunnable;
           2import org.eclipse.jface.wizard.WizardDialog;
           3import org.eclipse.swt.widgets.Display;
           4import org.eclipse.swt.widgets.Shell;
           5import org.eclipse.ui.PlatformUI;
           6
           7import com.bom.demo.ui.wizard.FirstTimeConfigWizard;
           8
           9/**
          10 * This class controls all aspects of the application's execution
          11 */

          12public class Application implements IPlatformRunnable {
          13
          14    /* (non-Javadoc)
          15     * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)
          16     */

          17    public Object run(Object args) throws Exception {
          18        Display display = PlatformUI.createDisplay();
          19        
          20        try {
          21            int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
          22            if (returnCode == PlatformUI.RETURN_RESTART) {
          23                return IPlatformRunnable.EXIT_RESTART;
          24            }

          25            return IPlatformRunnable.EXIT_OK;
          26        }
           finally {
          27            display.dispose();
          28        }

          29    }

          Eclipse3.2.2則實現自org.eclipse.core.runtime.IPlatformRunnable;
          看來是又做了一次小幅度的分離,而且給出了更加合理的方法命名。

          客戶虐我千百遍,我待客戶如初戀!

          posted on 2007-05-22 08:37 阿南 閱讀(2211) 評論(7)  編輯  收藏 所屬分類: Eclipse-RCP

          評論

          # re: Eclipse3.3m7 VS Eclipse3.2.2 2007-05-22 12:25 dreamstone

          eclipse3.3的效果不錯,用起來感覺很好。
            回復  更多評論    

          # re: Eclipse3.3m7 VS Eclipse3.2.2 2007-05-22 14:41 阿南

          好像有些小問題呢,反正我寫的東西穩定性不好,老出莫名其妙的問題!
            回復  更多評論    

          # re: Eclipse3.3m7 VS Eclipse3.2.2 2007-05-22 18:20 dreamstone

          直接是用eclipse3.3還是配合別的例如myeclipse designer等插件來用 ? 我直接拿來用到沒怎么出問題。
            回復  更多評論    

          # re: Eclipse3.3m7 VS Eclipse3.2.2 2007-05-22 23:52 熱門單曲

          多謝樓主分享 頂了
            回復  更多評論    

          # re: Eclipse3.3m7 VS Eclipse3.2.2 2007-05-23 08:22 阿南

          我裝了SWTdesigner6.3
            回復  更多評論    

          # re: Eclipse3.3m7 VS Eclipse3.2.2 2007-05-23 12:36 dreamstone

          恩,可能不匹配吧。我一般會下最新版本的看看,但很少用,怕的就是和各種插件不匹配,出各種錯誤。。呵呵
            回復  更多評論    

          # re: Eclipse3.3m7 VS Eclipse3.2.2 2007-05-23 15:53 阿南

          恩,有可能,而且我用SWTdesigner6.3+3.3不能新建preferencepage部件,不知道有沒有人遇到過。
            回復  更多評論    
          主站蜘蛛池模板: 隆回县| 增城市| 紫云| 潜江市| 武山县| 迁安市| 左权县| 新竹市| 睢宁县| 桑日县| 徐汇区| 襄樊市| 哈巴河县| 九寨沟县| 永寿县| 射阳县| 庄河市| 博白县| 会同县| 若羌县| 汉沽区| 中宁县| 台湾省| 常宁市| 瑞金市| 根河市| 台中市| 临清市| 巩义市| 离岛区| 宁陵县| 石河子市| 东莞市| 龙胜| 丰城市| 合川市| 陕西省| 五原县| 临沂市| 十堰市| 灵山县|