Eclipse3.3m7 VS Eclipse3.2.2
Eclipse3.3m7 VS Eclipse3.2.2
沒有深入研究過兩者的差別,只是昨天在更換平臺時發現的。差別主要存在與Application類上,兩者繼承或者實現的類不同,也就決定了其底層的不同。
Eclipse3.3M7
實現再org.eclipse.core.runtime.IPlatformRunnable;
Eclipse3.2.2
Eclipse3.2.2則實現自org.eclipse.core.runtime.IPlatformRunnable;
看來是又做了一次小幅度的分離,而且給出了更加合理的方法命名。
客戶虐我千百遍,我待客戶如初戀!
沒有深入研究過兩者的差別,只是昨天在更換平臺時發現的。差別主要存在與Application類上,兩者繼承或者實現的類不同,也就決定了其底層的不同。
Eclipse3.3M7
1
import org.eclipse.equinox.app.IApplication;
2
import org.eclipse.equinox.app.IApplicationContext;
3
import org.eclipse.jface.wizard.WizardDialog;
4
import org.eclipse.swt.widgets.Display;
5
import org.eclipse.swt.widgets.Shell;
6
import org.eclipse.ui.IWorkbench;
7
import org.eclipse.ui.PlatformUI;
8
9
import com.glnpu.glbom.ui.wizard.FirstTimeConfigWizard;
10
11
/** *//**
12
* This class controls all aspects of the application's execution
13
*/
14
public 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

2

3

4

5

6

7

8

9

10

11


12

13

14



15

16


17

18

19



20

21

22



23

24

25

26

27

28



29

30

31

32

33

34

35

36


37

38

39



40

41

42

43

44



45



46

47

48

49

50

51

52

實現再org.eclipse.core.runtime.IPlatformRunnable;
Eclipse3.2.2
1
import org.eclipse.core.runtime.IPlatformRunnable;
2
import org.eclipse.jface.wizard.WizardDialog;
3
import org.eclipse.swt.widgets.Display;
4
import org.eclipse.swt.widgets.Shell;
5
import org.eclipse.ui.PlatformUI;
6
7
import com.bom.demo.ui.wizard.FirstTimeConfigWizard;
8
9
/** *//**
10
* This class controls all aspects of the application's execution
11
*/
12
public 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
}

2

3

4

5

6

7

8

9


10

11

12



13

14


15

16

17



18

19

20



21

22



23

24

25

26



27

28

29

Eclipse3.2.2則實現自org.eclipse.core.runtime.IPlatformRunnable;
看來是又做了一次小幅度的分離,而且給出了更加合理的方法命名。
客戶虐我千百遍,我待客戶如初戀!
posted on 2007-05-22 08:37 阿南 閱讀(2206) 評論(7) 編輯 收藏 所屬分類: Eclipse-RCP