30 |
30 |
31 public class MobileRuntimesBridge implements IRuntimeBridge { |
31 public class MobileRuntimesBridge implements IRuntimeBridge { |
32 private final Map<String, MobileRuntimeStub> stubs = new TreeMap<String, MobileRuntimeStub>(); |
32 private final Map<String, MobileRuntimeStub> stubs = new TreeMap<String, MobileRuntimeStub>(); |
33 |
33 |
34 public Set<String> getExportedRuntimeNames() throws CoreException { |
34 public Set<String> getExportedRuntimeNames() throws CoreException { |
35 final IMobileWebRuntime[] allRuntimes = TMWCore.getDefault().getRuntimesManager().getAllRuntimes(); |
35 final IMobileWebRuntime[] allRuntimes = TMWCore.getRuntimesManager().getAllRuntimes(); |
36 final Set<String> ids = new TreeSet<String>(); |
36 final Set<String> ids = new TreeSet<String>(); |
37 for (IMobileWebRuntime runtime : allRuntimes) { |
37 for (IMobileWebRuntime runtime : allRuntimes) { |
38 ids.add(runtime.getId() + ":" + runtime.getVersion()); |
38 ids.add(TMWCore.getFProjSupport().getRuntimeId(runtime)); |
39 } |
39 } |
40 return ids; |
40 return ids; |
41 } |
41 } |
42 |
42 |
43 public IStub bridge(String name) throws CoreException { |
43 public IStub bridge(String name) throws CoreException { |
44 if (!stubs.containsKey(name)) { |
44 if (!stubs.containsKey(name)) { |
45 final int ind = name.indexOf(":"); |
45 final int ind = name.indexOf(":"); |
46 if (ind > 0) { |
46 if (ind > 0) { |
47 stubs.put( |
47 stubs.put( |
48 name, |
48 name, |
49 new MobileRuntimeStub(TMWCore.getDefault().getRuntimesManager() |
49 new MobileRuntimeStub(TMWCore.getRuntimesManager() |
50 .getRuntime(name.substring(0, ind), name.substring(ind + 1)))); |
50 .getRuntime(name.substring(0, ind), name.substring(ind + 1)))); |
51 } |
51 } |
52 } |
52 } |
53 return stubs.get(name); |
53 return stubs.get(name); |
54 } |
54 } |