大夢想家

          5年開發工程師,2年實施經理,X年售前顧問,......
          數據加載中……
          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 阿南 閱讀(2206) 評論(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部件,不知道有沒有人遇到過。
            回復  更多評論    
          主站蜘蛛池模板: 远安县| 嘉禾县| 娱乐| 丹江口市| 溧阳市| 东光县| 治县。| 洛隆县| 上饶县| 开平市| 盐亭县| 赣州市| 晋江市| 乐山市| 会理县| 府谷县| 宁城县| 青田县| 平阴县| 河津市| 通辽市| 合作市| 兴义市| 霞浦县| 涿鹿县| 潼南县| 丰城市| 和田县| 三台县| 兴安盟| 桂东县| 永济市| 东安县| 精河县| 辉县市| 灵川县| 台中县| 固安县| 泊头市| 定襄县| 周宁县|