大梦想家

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 阿南 阅读(2193) 评论(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部件,不知道有没有人遇到过。
  回复  更多评论    

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


网站导航: