Java 类javafx.scene.web.PopupFeatures 实例源码

项目:Gargoyle    文件:TinymceDeligator.java   
@Override
public WebEngine call(PopupFeatures p) {

    Stage stage = new Stage(StageStyle.UTILITY);
    WebView wv2 = new WebView();
    VBox vBox = new VBox(5);
    vBox.getChildren().add(wv2);
    vBox.getChildren().add(new Button("업로딩"));
    wv2.getEngine().setJavaScriptEnabled(true);
    stage.setScene(new Scene(vBox));
    stage.show();
    return wv2.getEngine();
}
项目:openjfx-8u-dev-tests    文件:PopupTest.java   
public WebEngine call(PopupFeatures p) {
    hasMenu = p.hasMenu();
    hasStatus = p.hasStatus();
    hasToolbar = p.hasToolbar();
    isResizable = p.isResizable();
    popupCalled = true;
    returnedEngine = new WebEngine();
    return returnedEngine;
}
项目:openjfx-8u-dev-tests    文件:MenuLauncher.java   
private Scene createScene(String url) {
    view = new WebView();
    view2 = new WebView();
    web = view.getEngine();

    web.load(url);
    web.setCreatePopupHandler(new Callback<PopupFeatures, WebEngine>() {
        @Override
        public WebEngine call(PopupFeatures config) {
            return view2.getEngine();
        }
    });

    view2.getEngine().load(MenuLauncher.class.getResource("resources/empty.html").toExternalForm());

    final VBox box = new VBox();
    view.setMaxHeight(300);
    view.setMinHeight(300);
    view2.setMaxHeight(300);
    view2.setMinHeight(300);
    box.getChildren().addAll(view, view2);

    final Scene scene = new Scene(box);

    scene.setFill(Color.GRAY);
    return scene;
}
项目:EmbeddedTomcatLauncher    文件:EmbeddedServerBrowserFrame.java   
/**
 * ブラウザの別ウィンドウを開くハンドラ.<br>
 * ※ TODO: ウィンドウ名が同一であったとしても区別する方法が不明なため、
 * 現状は、常に新しいウィンドウが開くようにしている.
 *
 * @return
 */
private Callback<PopupFeatures, WebEngine> createPopupHandler(final WebEngine engine) {
    return new Callback<PopupFeatures, WebEngine>() {
        @Override
        public WebEngine call(PopupFeatures popupFeatures) {

            final WebView childWebView = new WebView();
            WebEngine childEngine = childWebView.getEngine();

            setWebEngineHandlers(childEngine);

            final JFXPanel center = new JFXPanel();
            center.setScene(new Scene(childWebView));

            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    JDialog dlg = new JDialog(EmbeddedServerBrowserFrame.this, false);
                    Container contentPane = dlg.getContentPane();
                    contentPane.setLayout(new BorderLayout());
                    contentPane.add(center, BorderLayout.CENTER);
                    dlg.pack();
                    dlg.setVisible(true);
                }
            });

            return childEngine;
        }
    };
}