javafx.scene.web.WebErrorEvent#com.codename1.io.Log源码实例Demo

下面列出了javafx.scene.web.WebErrorEvent#com.codename1.io.Log 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。


public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if (err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });
}
 
源代码2 项目: CodenameOne   文件: UnicodeFontsSample.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if (err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });
}
 
源代码4 项目: CodenameOne   文件: TextSelectionSample.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码5 项目: CodenameOne   文件: AffineTransformTest.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码7 项目: codenameone-demos   文件: SocialChat.java

private void listenToMessages() {
    try {
        pb = new Pubnub(PUBNUB_PUB_KEY, PUBNUB_SUB_KEY);
        pb.subscribe(tokenPrefix + uniqueId, new Callback() {
            @Override
            public void successCallback(String channel, Object message, String timetoken) {
                if(message instanceof String) {
                    pendingAck.remove(channel);
                    return;
                }
                Message m = new Message((JSONObject)message);
                pb.publish(tokenPrefix + m.getSenderId(),  "ACK", new Callback() {});
                Display.getInstance().callSerially(() -> {
                    addMessage(m);
                    respond(m);
                });
            }
        });
    } catch(PubnubException err) {
        Log.e(err);
        Dialog.show("Error", "There was a communication error: " + err, "OK", null);
    }
}
 
源代码8 项目: CodenameOne   文件: DraggableTabsSample.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if (err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });
}
 

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码10 项目: CodenameOne   文件: LinearGradientSample.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码11 项目: CodenameOne   文件: Display.java

private void addPointerEventWithTimestamp(int type, int x, int y) {
    synchronized(lock) {
        if (this.dropEvents) {
            return;
        }
        try {
            inputEventStack[inputEventStackPointer] = type;
            inputEventStackPointer++;
            inputEventStack[inputEventStackPointer] = x;
            inputEventStackPointer++;
            inputEventStack[inputEventStackPointer] = y;
            inputEventStackPointer++;
            inputEventStack[inputEventStackPointer] = (int)(System.currentTimeMillis() - displayInitTime);
            inputEventStackPointer++;
        } catch(ArrayIndexOutOfBoundsException err) {
            Log.p("EDT performance is very slow triggering this exception!");
            Log.e(err);
        }
        lock.notify();
    }        
}
 
源代码12 项目: CodenameOne   文件: SpanLabelTest2897.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码13 项目: CodenameOne   文件: DnDRegression3048.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码14 项目: CodenameOne   文件: SocketSample.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if (err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });
}
 

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码17 项目: CodenameOne   文件: GradientTest.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码18 项目: CodenameOne   文件: SwitchListSample.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码21 项目: CodenameOne   文件: IOS13RegressionTest.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if (err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });
}
 
源代码23 项目: CodenameOne   文件: Purchase.java

/**
 * Gets all of the receipts for this app.  Note:  You should periodically 
 * reload the receipts from the server to make sure that the user
 * hasn't canceled a receipt or renewed one.
 * @return List of receipts for purchases this app.
 */
public final List<Receipt> getReceipts() {
    synchronized (RECEIPTS_KEY) {
        if (receipts == null) {
            if (Storage.getInstance().exists(RECEIPTS_KEY)) {
                Receipt.registerExternalizable();
                try {
                    receipts = (List<Receipt>)Storage.getInstance().readObject(RECEIPTS_KEY);
                } catch (Exception ex) {
                    Log.p("Failed to load receipts from "+RECEIPTS_KEY);
                    Log.e(ex);
                    receipts = new ArrayList<Receipt>();
                    
                }
            } else {
                receipts = new ArrayList<Receipt>();
            }
        }
        return receipts;
    }
}
 

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码25 项目: CodenameOne   文件: FacebookConnect.java

/**
 * Gets the FacebookConnect singleton instance
 * .
 * @return the FacebookConnect instance
 */ 
public static FacebookConnect getInstance() {
    if (instance == null) {
        if (implClass != null) {
            try {
                instance = (FacebookConnect) implClass.newInstance();
            } catch (Throwable t) {
                Log.e(t);
                instance = new FacebookConnect();
            }
        } else {
            instance = new FacebookConnect();
        }
    }
    return instance;
}
 
源代码26 项目: CodenameOne   文件: FlowLayoutRTLTest.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");
    UIManager.getInstance().getLookAndFeel().setRTL(true);

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码27 项目: CodenameOne   文件: JavascriptContext.java

/**
 * Executes a Javascript string and returns the string.  It is synchronized
 * to disallow multiple threads from running javascript on the same BrowserComponent.
 * 
 * <p>This is just a thin wrapper around the BrowserComponent.executeAndReturnString() method.</p>
 * 
 * @param js
 * @return The string result of executing the Javascript string.
 */
private String exec(String js, boolean async){
    synchronized (browser) {
        if ( DEBUG ){
            Log.p("About to execute("+async+") "+js);
            //browser.execute("console.log(execute ca_weblite_codename1_js_JavascriptContext_LOOKUP_TABLE0[0])");
        }
        if (async) {

            browser.execute(installCode()+";("+js+")");
            return null;
        } else {
            return browser.executeAndReturnString(installCode()+";("+js+")");
        }
    }
}
 
源代码28 项目: CodenameOne   文件: CSSMediaQueriesSample.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}
 
源代码29 项目: CodenameOne   文件: MediaPlayer.java

/**
 * Convenience JavaBean method, see other version of this method
 * @param uri the URL for the media
 */
public void setDataSource(final String uri) {
    if(!isInitialized()) {
        pendingDataURI = uri;
        return;
    }
    if(dataSource == null || !dataSource.equals(uri)) {
        Display.getInstance().startThread(new Runnable() {
            public void run() {
                try {
                    setDataSource(uri, null);
                } catch(Throwable t) {
                    Log.e(t);
                }
            }
        }, "Media Thread").start();
    }
}
 
源代码30 项目: CodenameOne   文件: PickerTest3071.java

public void init(Object context) {
    // use two network threads instead of one
    updateNetworkThreadCount(2);

    theme = UIManager.initFirstTheme("/theme");

    // Enable Toolbar on all Forms by default
    Toolbar.setGlobalToolbar(true);

    // Pro only feature
    Log.bindCrashProtection(true);

    addNetworkErrorListener(err -> {
        // prevent the event from propagating
        err.consume();
        if(err.getError() != null) {
            Log.e(err.getError());
        }
        Log.sendLogAsync();
        Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
    });        
}