Java 类javafx.scene.control.SplitMenuButton 实例源码

项目:openjfx-8u-dev-tests    文件:SplitMenuButtonsApp.java   
@Override
protected List<Labeled> getConstructorPage() {
    List<Labeled> list = new ArrayList<Labeled>();

    SplitMenuButton defaultButton = new SplitMenuButton();
    defaultLayout.apply(defaultButton);
    if (!defaultButton.getText().equals("")) {
        reportGetterFailure("new SplitMenuButton()");
    } else {
        list.add(defaultButton);
    }

    SplitMenuButton itemsButton = new SplitMenuButton(new MenuItem("Item 1"), new MenuItem("Item 2"), new MenuItem("Item 3"));
    defaultLayout.apply(itemsButton);
    if (!itemsButton.getItems().get(0).getText().equals("Item 1")
            || !itemsButton.getItems().get(1).getText().equals("Item 2")
            || !itemsButton.getItems().get(2).getText().equals("Item 3")
            || !itemsButton.getText().equals("")
            || itemsButton.getGraphic() != null) {
        reportGetterFailure("new SplitMenuButton(MenuItem...)");
    } else {
        list.add(itemsButton);
    }

    return list;
}
项目:openjfx-8u-dev-tests    文件:SplitMenuButtonApp.java   
@Override
protected Scene getScene() {
    return new LabeledsApp.LabeledScene() {

        @Override
        protected Labeled getTestedLabeled() {
            return new SplitMenuButton();
        }
    };
}
项目:openjfx-8u-dev-tests    文件:SplitMenuButtonsApp.java   
@Override
protected Labeled getListenable() {
    SplitMenuButton button = new FireListenableButton();
    button.setText(DEFAULT);
    defaultLayout.apply(button);
    return button;
}
项目:openjfx-8u-dev-tests    文件:SplitMenuButtonsApp.java   
@Override
protected Labeled getButton() {
    SplitMenuButton button = new SplitMenuButton();
    button.setText(DEFAULT);
    defaultLayout.apply(button);
    return button;
}
项目:javafx-dpi-scaling    文件:AdjusterTest.java   
@Test
public void testGetMenuSplitButtonAdjuster() {
    Adjuster adjuster = Adjuster.getAdjuster(SplitMenuButton.class);

    assertThat(adjuster, is(instanceOf(ControlAdjuster.class)));
    assertThat(adjuster.getNodeClass(), is(sameInstance(Control.class)));
}
项目:FollowTheBitcoin    文件:TipPanel.java   
public void tip(ActionEvent actionEvent) {
//        String tip = coinBaseAuth.loadToken("tip");

        final String s;
        Object source = actionEvent.getSource();
        if (source instanceof SplitMenuButton) {
            s = ((SplitMenuButton)source).getText();
        } else if (source instanceof MenuItem) {
            s = ((MenuItem)source).getText();
        } else {
            hideTipBar();
            return;
        }

        String url = tipMap.get(s);
        if (url == null) return;

        hostServices.showDocument(url);

//        WebEngine webEngine = webViewLogin.getEngine();
//
//        @SuppressWarnings("unchecked")
//        ChangeListener<? super Worker.State>[] tipListener = new ChangeListener[1];
//
//        tipListener[0] = (ov, oldValue, newValue) -> {
//            if (newValue == Worker.State.SUCCEEDED) {
//                String location = webEngine.getLocation();
//                if (location.startsWith("http://cryptocrumb.com/success")) {
//                    String[] stuff = s.split(" - ");
//                    coinBaseAuth.saveToken(stuff[0], "tip");
//                    webEngine.getLoadWorker().stateProperty().removeListener(tipListener[0]);
//                }
//            }
//        };
//
//        webEngine.getLoadWorker().stateProperty().addListener(tipListener[0]);
//        webEngine.load(url);
//        paneLogin.setVisible(true);

    }
项目:WatchlistPro    文件:AquaSplitMenuButtonSkin.java   
public AquaSplitMenuButtonSkin(SplitMenuButton menuButton) {
    super(menuButton);

    registerChangeListener(menuButton.focusedProperty(), "FOCUSED");
    if (getSkinnable().isFocused()) {
        setFocusBorder();
    } else {
        setDropShadow();
    }
}
项目:marathonv5    文件:DisplayWindow.java   
private SplitMenuButton createNewButton() {
    SplitMenuButton newButton = new SplitMenuButton(newTestcaseAction.getMenuItem(), etAction.getMenuItem());
    newButton.setGraphic(newTestcaseAction.getButton().getGraphic());
    newButton.setOnAction(newTestcaseAction.getButton().getOnAction());
    return newButton;
}
项目:Gargoyle    文件:BehaviorTextComposite.java   
public BehaviorTextComposite() {

        // Top
        smbReferences = new SplitMenuButton();
        this.smbReferences.setText("Reference");

        btnSearch = new Button("Search");
        btnLoad = new Button("Load");
        txtLoacation = new TextField();
        // txtLoacation.setPrefWidth(Double.MAX_VALUE);
        txtLoacation.setMaxWidth(Double.MAX_VALUE);
        txtLoacation.setMinWidth(200d);
        txtLoacation.setPrefWidth(400d);
        smbReferences.setPrefWidth(200d);

        HBox hBox = new HBox(smbReferences, txtLoacation, btnSearch, btnLoad);
        hBox.setPrefWidth(Double.MAX_VALUE);
        hBox.setMaxWidth(Double.MAX_VALUE);
        HBox.getHgrow(txtLoacation);
        hBox.setStyle("-fx-padding : 5px; -fx-spacing : 5px;");

        Menu menuWindow = new Menu("Window");
        MenuItem cmiShowFullText = new MenuItem("Show Full Text");
        cmiShowFullText.setOnAction(ev -> {
            if (this.wib != null) {
                if (xmlStage != null) {
                    xmlStage.show();
                    return;
                }

                xmlStage = FxUtil.createStageAndShow(xmlEditor, stage -> {
                    stage.setTitle("XML - " + this.wib.getName());
                    stage.setWidth(800d);
                    stage.setHeight(600d);
                });
            }
        });

        menuWindow.getItems().add(cmiShowFullText);
        MenuBar mbMaster = new MenuBar(menuWindow);
        VBox top = new VBox(mbMaster, hBox);

        setTop(top);

        // Center
        xmlEditor = new XMLEditor();

        txtScript = new BehaviorTextArea();

        splitPane = new SplitPane(txtScript);

        splitPane.setOrientation(Orientation.HORIZONTAL);

        tabPane = new TabPane();
        mainTab = new Tab("main", splitPane);
        mainTab.setClosable(false);
        tabPane.getTabs().add(mainTab);
        setCenter(tabPane);

        // Events
        this.btnSearch.setOnAction(this::btnSearchOnAction);
        this.btnLoad.setOnAction(this::btnLoadOnAction);

        // DragDrop
        txtScript.setOnDragOver(this::txtScriptOnDagOver);
        txtScript.setOnDragDropped(this::txtScriptOnDragDropped);

        this.wib.addListener((oba, old, newval) -> {
            if (newval != null && newval.exists()) {
                tab.setText(newval.getName());
            }
        });
        init();
    }
项目:openjfx-8u-dev-tests    文件:SplitMenuButtonApp.java   
@Override
protected void createMenuButton() {
    menuButton = new SplitMenuButton();
    menuButton.setText("Menu Button");
}
项目:closurefx-builder    文件:GSSPageController.java   
public SplitMenuButton getBtnRun() {
    return btnRun;
}
项目:closurefx-builder    文件:JSPageController.java   
public SplitMenuButton getBtnRun() {
    return btnRun;
}
项目:closurefx-builder    文件:SOYPageController.java   
public SplitMenuButton getBtnRun() {
    return btnRun;
}
项目:openjfx-8u-dev-tests    文件:ThemeDriverFactory.java   
public abstract void splitMenuButtonExpandCollapseAction(final SplitMenuButtonWrap<? extends SplitMenuButton> wrap);