public void actionPerformed(ActionEvent e) { common.startLauncher(MIDletBridge.getMIDletContext()); } };
private static void register(MIDletThread thread) { MIDletContext midletContext = MIDletBridge.getMIDletContext(); if (midletContext == null) { Logger.error("Creating thread with no MIDlet context", new Throwable()); return; } thread.callLocation = ThreadUtils.getCallLocation(MIDletThread.class.getName()); Map threads = (Map)midlets.get(midletContext); if (threads == null) { threads = new WeakHashMap(); midlets.put(midletContext, threads); } threads.put(thread, midletContext); }
private static void register(MIDletTimer timer) { if (timer.midletContext == null) { timer.midletContext = MIDletBridge.getMIDletContext(); } if (timer.midletContext == null) { Logger.error("Creating Timer with no MIDlet context", new Throwable()); return; } Map timers = (Map) midlets.get(timer.midletContext); if (timers == null) { // Can't use WeakHashMap Timers are disposed by JVM timers = new HashMap(); midlets.put(timer.midletContext, timers); } // Logger.debug("Register timer created from [" + timer.name + "]"); timers.put(timer, timer.midletContext); }
public void destroyMIDletContext(MIDletContext midletContext) { if ((midletContext != null) && (MIDletBridge.getMIDletContext() == midletContext) && !midletContext.isLauncher()) { Logger.debug("destroyMIDletContext"); } MIDletThread.contextDestroyed(midletContext); synchronized (destroyNotify) { destroyNotify.notifyAll(); } }
public void handleEvent(Event e) { if (selectDeviceDialog.open() == SwtDialog.OK) { if (selectDeviceDialog.getSelectedDeviceEntry().equals(getDevice())) { return; } if (MIDletBridge.getCurrentMIDlet() != getLauncher()) { if (!SwtMessageDialog.openQuestion(shell, "Question?", "Changing device needs MIDlet to be restarted. All MIDlet data will be lost. Are you sure?")) { return; } } setDevice(selectDeviceDialog.getSelectedDeviceEntry()); if (MIDletBridge.getCurrentMIDlet() != getLauncher()) { try { startMidlet(MIDletBridge.getCurrentMIDlet().getClass(), MIDletBridge.getMIDletAccess()); } catch (Exception ex) { System.err.println(ex); } } else { startLauncher(MIDletBridge.getMIDletContext()); } } } };
MIDletContext context = startMidlet(midletClass, MIDletBridge.getMIDletAccess()); if (MIDletBridge.getMIDletContext() == context) { synchronized (destroyNotify) { try {
Launcher.addMIDletEntry(new MIDletEntry(jadEntry.getName(), midletClass)); startLauncher(MIDletBridge.getMIDletContext()); setStatusBar(""); } finally {
startLauncher(MIDletBridge.getMIDletContext());