Browse Source

Merging in latest from upstream (BA/design:refs/heads/dev)

* commit '1019706a1f19dabcef96c639e929745626fbc847':
  窗口缩放到合适的外宽高
  点击链接后能接着使用关闭脚本
  BBSDialog.this
  注释漏传了
  web端的接口不独立文件
  咨询框接口
  rt
  rt
  注释
  cas url接口
master
vito 9 years ago
parent
commit
91764a0a0c
  1. 2
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
  2. 19
      designer/src/com/fr/design/mainframe/bbs/BBSDialog.java
  3. 7
      designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java
  4. 4
      designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java
  5. 15
      designer_base/src/com/fr/design/utils/DesignUtils.java

2
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

File diff suppressed because one or more lines are too long

19
designer/src/com/fr/design/mainframe/bbs/BBSDialog.java

@ -14,6 +14,7 @@ import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import netscape.javascript.JSObject;
import javax.swing.*;
@ -30,8 +31,8 @@ public class BBSDialog extends UIDialog {
private static final int WIDTH = 600;
private static final int HEIGHT = 400;
private static final int OUTER_WIDTH = 605;
private static final int OUTER_HEIGHT = 428;
private static final int OUTER_WIDTH = 600;
private static final int OUTER_HEIGHT = 400;
private JFXPanel jfxPanel;
@ -85,6 +86,8 @@ public class BBSDialog extends UIDialog {
view.setMinSize(widthDouble, heightDouble);
view.setPrefSize(widthDouble, heightDouble);
final WebEngine eng = view.getEngine();
JSObject obj = (JSObject) eng.executeScript("window");
obj.setMember("BBSWebBridge", BBSDialog.this);//一定要在load页面之前加载接口
//webEngine的userAgent貌似支持移动设备的,任何其他浏览器的userAngent都会导致程序崩溃
//eng.setUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) Apple/WebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36");
eng.load(url);
@ -105,6 +108,8 @@ public class BBSDialog extends UIDialog {
@Override
public void changed(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {
if (newValue == Worker.State.SUCCEEDED){
JSObject obj = (JSObject) eng.executeScript("window");
obj.setMember("BBSWebBridge", BBSDialog.this);
setVisible(true);
}
}
@ -112,7 +117,7 @@ public class BBSDialog extends UIDialog {
}
});
}
// 在本地浏览器里打开url
private void openUrlAtLocalWebBrowser(WebEngine eng,String url){
if(Desktop.isDesktopSupported()){
@ -136,6 +141,14 @@ public class BBSDialog extends UIDialog {
}
}
/**
* 提供给web页面调用的关闭窗口
*/
public void closeWindow() {
this.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
this.setVisible(false);
this.dispose();
}
/**
*
*/

7
designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java

@ -21,4 +21,11 @@ public interface DesignerEnvProcessor extends Level{
* @return 修改后的jsessionid
*/
String changeEnvPathBeforeConnect(String userName, String password, String path);
/**
* web端预览的时候不需要jsessionid, 他会默认跳转到登陆页面, 如果带上了, 反而会因为里面资源文件加载不到而出问题.
*
* @return web端预览地址
*/
String getWebBrowserURL(String envPath);
}

4
designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java

@ -15,4 +15,8 @@ public abstract class AbstractDesignerEnvProcessor implements DesignerEnvProcess
return path;
}
public String getWebBrowserURL(String envPath){
return envPath;
}
}

15
designer_base/src/com/fr/design/utils/DesignUtils.java

@ -5,6 +5,8 @@ import com.fr.base.remote.RemoteDeziConstants;
import com.fr.dav.DavXMLUtils;
import com.fr.dav.LocalEnv;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.gui.UILookAndFeel;
import com.fr.design.mainframe.DesignerContext;
import com.fr.env.RemoteEnv;
@ -303,7 +305,8 @@ public class DesignUtils {
postfixOfUri = isUserPrivilege ? postfixOfUri + "&fr_check_url=" + time + "&id=" + FRContext.getCurrentEnv().getUserID(): postfixOfUri ;
}
Desktop.getDesktop().browse(new URI(FRContext.getCurrentEnv().getPath() + postfixOfUri));
String urlPath = getWebBrowserPath();
Desktop.getDesktop().browse(new URI(urlPath + postfixOfUri));
} catch (Exception e) {
FRContext.getLogger().error("cannot open the url Successful", e);
}
@ -319,6 +322,16 @@ public class DesignUtils {
}
}
private static String getWebBrowserPath() {
String urlPath = FRContext.getCurrentEnv().getPath();
DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getEnvProcessor();
if (processor != null) {
//cas访问的时候, url要处理下.
urlPath = processor.getWebBrowserURL(urlPath);
}
return urlPath;
}
//TODO:august:下个版本,要把下面的图片都放在一个preload文件夹下,表示可以预先加载。然后遍历一下就可以了,不用这么一个一个的写了
/**

Loading…
Cancel
Save