From f2b273c1b6e84fd83ae4052f4f1159a8f7a9ecd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=94=80?= Date: Thu, 8 Sep 2016 14:41:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=B8=80=E4=B8=8B=E5=86=99=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=BA=9B=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=80=BC=E4=B8=BAerror=E7=9A=84=E5=88=A4=E6=96=AD=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setAlwaysontop 这个方法是1.8jdk才有的,之前1.7的里面就没有这样的方法,那就去掉吧,没什么影响。 --- .../com/fr/design/extra/LoginWebBridge.java | 11 ++++++++--- .../com/fr/design/extra/QQLoginWebPane.java | 18 +++++++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index 6dd4f0f830..46e66c98c2 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/LoginWebBridge.java @@ -27,6 +27,8 @@ public class LoginWebBridge { private static final long CHECK_MESSAGE_TIME = 30 * 1000L; //数据查询正常的标志 ok private static final String SUCCESS_MESSAGE_STATUS = "ok"; + //数据通讯失败 + private static final String FAILED_MESSAGE_STATUS = "error"; //消息条数 private int messageCount; @@ -125,9 +127,12 @@ public class LoginWebBridge { if(getMessage.isServerAlive()){ try { String res = getMessage.getResponseText(); - JSONObject jo = new JSONObject(res); - if (jo.getString("status").equals(SUCCESS_MESSAGE_STATUS)) { - setMessageCount(Integer.parseInt(jo.getString("message"))); + if (res.equals(FAILED_MESSAGE_STATUS)) { + }else { + JSONObject jo = new JSONObject(res); + if (jo.getString("status").equals(SUCCESS_MESSAGE_STATUS)) { + setMessageCount(Integer.parseInt(jo.getString("message"))); + } } } catch (Exception e) { FRContext.getLogger().info(e.getMessage()); diff --git a/designer_base/src/com/fr/design/extra/QQLoginWebPane.java b/designer_base/src/com/fr/design/extra/QQLoginWebPane.java index e9fab4fe17..2d950bb112 100644 --- a/designer_base/src/com/fr/design/extra/QQLoginWebPane.java +++ b/designer_base/src/com/fr/design/extra/QQLoginWebPane.java @@ -104,12 +104,17 @@ public class QQLoginWebPane extends JFXPanel { showAlert(event.getData()); } }); - webEngine.getLoadWorker().stateProperty().addListener((ObservableValue observable, Worker.State oldValue, Worker.State newValue) -> { - if (newValue == Worker.State.SUCCEEDED) { - window = (JSObject) webEngine.executeScript("window"); - window.setMember("QQLoginHelper", QQLoginWebBridge.getHelper(webEngine)); - } - }); + webEngine.getLoadWorker().stateProperty().addListener( + new ChangeListener() { + public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) { + if (newState == Worker.State.SUCCEEDED) { + window = (JSObject) webEngine.executeScript("window"); + window.setMember("QQLoginHelper", QQLoginWebBridge.getHelper(webEngine)); + } + } + } + ); + webView.setContextMenuEnabled(false);//屏蔽右键 root.setCenter(webView); } @@ -151,7 +156,6 @@ public class QQLoginWebPane extends JFXPanel { dialog.setHeight(DEFAULT_CONFIRM_HEIGHT); dialog.setWidth(DEFAULT_CONFIRM_WIDTH); dialog.setIconified(false); - dialog.setAlwaysOnTop(true); dialog.initOwner(parent); dialog.initModality(Modality.WINDOW_MODAL); dialog.setScene(