18
18
import org .eclipse .core .resources .IWorkspaceDescription ;
19
19
import org .eclipse .core .resources .ResourcesPlugin ;
20
20
import org .eclipse .core .runtime .CoreException ;
21
+ import org .eclipse .core .runtime .FileLocator ;
21
22
import org .eclipse .core .runtime .IPath ;
22
23
import org .eclipse .core .runtime .IProgressMonitor ;
24
+ import org .eclipse .core .runtime .IStatus ;
23
25
import org .eclipse .core .runtime .NullProgressMonitor ;
24
26
import org .eclipse .core .runtime .Path ;
25
- import org .eclipse .core .runtime .Platform ;
27
+ import org .eclipse .core .runtime .Status ;
26
28
import org .eclipse .jdt .core .ClasspathVariableInitializer ;
27
29
import org .eclipse .jdt .core .JavaCore ;
28
- import org .eclipse .jdt .internal .launching .LaunchingPlugin ;
29
30
30
31
/**
31
32
* @author zhou renjian
@@ -49,7 +50,7 @@ public void initialize(String variable) {
49
50
URL starterURL = AjaxPlugin .getDefault ().getBundle ().getEntry (File .separator );
50
51
String root = "." ; //$NON-NLS-1$
51
52
try {
52
- root = Platform . asLocalURL (starterURL ).getFile ();
53
+ root = FileLocator . toFileURL (starterURL ).getFile ();
53
54
} catch (IOException e1 ) {
54
55
e1 .printStackTrace ();
55
56
}
@@ -61,6 +62,8 @@ public void initialize(String variable) {
61
62
newPath = Path .fromPortableString (root + "/ajaxrpc.jar" );
62
63
} else if ("AJAX_PIPE" .equals (variable )) {
63
64
newPath = Path .fromPortableString (root + "/ajaxpipe.jar" );
65
+ } else if ("AJAX_STORE" .equals (variable )) {
66
+ newPath = Path .fromPortableString (root + "/ajaxstore.jar" );
64
67
} else if ("J2S_ANNOTATION" .equals (variable )) {
65
68
newPath = Path .fromPortableString (root + "/j2stag.jar" );
66
69
} else if ("AJAX_CORE_SRC" .equals (variable )) {
@@ -71,6 +74,8 @@ public void initialize(String variable) {
71
74
newPath = Path .fromPortableString (root + "/ajaxrpcsrc.zip" );
72
75
} else if ("AJAX_PIPE_SRC" .equals (variable )) {
73
76
newPath = Path .fromPortableString (root + "/ajaxpipesrc.zip" );
77
+ } else if ("AJAX_STORE_SRC" .equals (variable )) {
78
+ newPath = Path .fromPortableString (root + "/ajaxstoresrc.zip" );
74
79
} else if ("J2S_ANNOTATION_SRC" .equals (variable )) {
75
80
newPath = Path .fromPortableString (root + "/j2stagsrc.zip" );
76
81
}
@@ -87,13 +92,15 @@ public void initialize(String variable) {
87
92
setAutobuild (workspace , false );
88
93
setJREVariable (newPath , variable );
89
94
} catch (CoreException ce ) {
90
- LaunchingPlugin .log (ce );
95
+ AjaxPlugin .getDefault ().getLog ().log (new Status (IStatus .ERROR ,
96
+ "net.sf.j2s.ajax" , IStatus .ERROR , ce .getMessage (), ce ));
91
97
return ;
92
98
} finally {
93
99
try {
94
100
setAutobuild (workspace , wasAutobuild );
95
101
} catch (CoreException ce ) {
96
- LaunchingPlugin .log (ce );
102
+ AjaxPlugin .getDefault ().getLog ().log (new Status (IStatus .ERROR ,
103
+ "net.sf.j2s.ajax" , IStatus .ERROR , ce .getMessage (), ce ));
97
104
}
98
105
}
99
106
// }
0 commit comments