static boolean alreadyDetectedProxy = false;
/** the result of proxy autodetection */
- static HTTP.Proxy cachedProxyInfo = null;
+ static org.xwt.HTTP.Proxy cachedProxyInfo = null;
/** the current build */
public static String build = "unknown";
/** displays a platform-specific "open file" dialog and returns the chosen filename, or null if the user hit cancel */
protected String _fileDialog(String suggestedFileName, boolean write) { return null; }
- public static String fileDialog(String suggestedFileName, boolean write) {
- if (!ThreadMessage.suspendThread()) return null;
- try {
- return platform._fileDialog(suggestedFileName, write);
- } finally {
- ThreadMessage.resumeThread();
- }
+ public static String fileDialog(String suggestedFileName, boolean write) throws org.xwt.js.JS.Exn {
+ return platform._fileDialog(suggestedFileName, write);
}
/** default implementation is Eric Albert's BrowserLauncher.java */
Surface ret = platform._createSurface(b, framed);
ret.setInvisible(false);
- Object titlebar = b.get("titlebar", true);
- if (titlebar != null) ret.setTitleBarText(titlebar.toString());
-
- Object icon = b.get("icon", true);
- if (icon != null && icon instanceof Res) {
- Picture pic = Picture.fromRes((Res)icon);
- if (pic != null) ret.setIcon(pic);
- else if (Log.on) Log.log(Platform.class, "unable to load icon " + icon);
- }
-
ret.setLimits(b.minwidth, b.minheight, b.maxwidth, b.maxheight);
if (refreshable) {
}
/** detects proxy settings */
- protected synchronized HTTP.Proxy _detectProxy() { return null; }
- public static synchronized HTTP.Proxy detectProxy() {
+ protected synchronized org.xwt.HTTP.Proxy _detectProxy() { return null; }
+ public static synchronized org.xwt.HTTP.Proxy detectProxy() {
if (cachedProxyInfo != null) return cachedProxyInfo;
if (alreadyDetectedProxy) return null;
alreadyDetectedProxy = true;
if (Log.on) Log.log(Platform.class, "attempting environment-variable DNS proxy detection");
- cachedProxyInfo = HTTP.Proxy.detectProxyViaManual();
+ cachedProxyInfo = org.xwt.HTTP.Proxy.detectProxyViaManual();
if (cachedProxyInfo != null) return cachedProxyInfo;
if (Log.on) Log.log(Platform.class, "attempting " + platform.getClass().getName() + " proxy detection");
return cachedProxyInfo;
}
+
+ /** returns a Scheduler instance; used to implement platform-specific schedulers */
+ protected Scheduler _getScheduler() { return new Scheduler(); }
+ public static Scheduler getScheduler() { return platform._getScheduler(); }
public static void running() { platform._running(); }
public void _running() { new Semaphore().block(); }