|
|
 |
首页 … 技术文档 Technical Articles |
|
| |
| |
Eclipse3.3m7 VS Eclipse3.2.2
|
| (时间:2007-5-23 0:12:41 共有
人次浏览) |
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; 看来是又做了一次小幅度的分离,而且给出了更加合理的方法命名。
|
|
|
【打印该页】 【关闭窗口】 |
|
此技术资料来自网络,仅供参考。未经许可,不得转载。
若有侵权,请及时与我们取得联系! |
| |
|
|
|
|