/** * This code Ingected By MicroEmulator to enable access to System properties while running in Applet * * @param key the name of the system property. * @return the string value of the system property, * or <code>null</code> if there is no property with that key. */ public static String getProperty(String key) { return MIDletSystemProperties.getProperty(key); }
private static boolean detectJava15() { try { java5Function(); java15 = true; } catch (Throwable ignore) { } return java15; }
private static synchronized void detect() { if (runtimeDetected) { return; } if (detectJava14()) { detectJava15(); detectEclipse(); } runtimeDetected = true; }
public MIDletThread() { super(THREAD_NAME_PREFIX + nextThreadNum()); register(this); }
private static void initOnce() { // Can't use static initializer because of applyToJavaSystemProperties // in applet if (initialized) { return; } initialized = true; // This are set in Config // setProperty("microedition.configuration", "CLDC-1.1"); // setProperty("microedition.profiles", "MIDP-2.0"); setProperty("microedition.platform", "MicroEmulator"); setProperty("microedition.encoding", getSystemProperty("file.encoding")); }
public void cancel() { unregister(this); terminate(); }
public static boolean isInEclipseUnitTests() { detect(); return inEclipseUnitTests; } }
public MIDletThread(Runnable target, String name) { super(target, THREAD_NAME_PREFIX + name); register(this); }
private static PrintStream errPrintStream() { return new MIDletOutputStreamRedirector(true); }
private void fireListener(Object item) { if (this.listener != null) { this.listener.listItemChanged(item); } }
private MIDletOutputStreamRedirector(boolean error) { super(new OutputStream2Log(error)); this.isErrorStream = error; }
protected URLConnection openConnection(URL url) throws IOException { return new ResURLConnection(url, entries); }
public int checkPermission(String permission) { return MIDletSystemProperties.getPermission(permission); }
/** * * Returns an input stream for reading the specified resource. * * <p> The search order is described in the documentation for {@link * #getResource(String)}. </p> * * @param origClass * @param name The resource name * * @return An input stream for reading the resource, or <tt>null</tt> * if the resource could not be found */ public static InputStream getResourceAsStream(Class origClass, String name) { return MIDletResourceLoader.getResourceAsStream(origClass, name); }
public MIDletThread(Runnable target) { super(target, THREAD_NAME_PREFIX + nextThreadNum()); register(this); }
public static boolean isJava13() { detect(); return java13; }
public MIDletThread(String name) { super(THREAD_NAME_PREFIX + name); register(this); }
private static PrintStream outPrintStream() { return new MIDletOutputStreamRedirector(false); }
public static boolean isJava14() { detect(); return java14; }
public static boolean isJava15() { detect(); return java15; }