@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; }
@Override protected Scene getScene() { return new LabeledsApp.LabeledScene() { @Override protected Labeled getTestedLabeled() { return new SplitMenuButton(); } }; }
@Override protected Labeled getListenable() { SplitMenuButton button = new FireListenableButton(); button.setText(DEFAULT); defaultLayout.apply(button); return button; }
@Override protected Labeled getButton() { SplitMenuButton button = new SplitMenuButton(); button.setText(DEFAULT); defaultLayout.apply(button); return button; }
@Test public void testGetMenuSplitButtonAdjuster() { Adjuster adjuster = Adjuster.getAdjuster(SplitMenuButton.class); assertThat(adjuster, is(instanceOf(ControlAdjuster.class))); assertThat(adjuster.getNodeClass(), is(sameInstance(Control.class))); }
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); }
public AquaSplitMenuButtonSkin(SplitMenuButton menuButton) { super(menuButton); registerChangeListener(menuButton.focusedProperty(), "FOCUSED"); if (getSkinnable().isFocused()) { setFocusBorder(); } else { setDropShadow(); } }
private SplitMenuButton createNewButton() { SplitMenuButton newButton = new SplitMenuButton(newTestcaseAction.getMenuItem(), etAction.getMenuItem()); newButton.setGraphic(newTestcaseAction.getButton().getGraphic()); newButton.setOnAction(newTestcaseAction.getButton().getOnAction()); return newButton; }
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(); }
@Override protected void createMenuButton() { menuButton = new SplitMenuButton(); menuButton.setText("Menu Button"); }
public SplitMenuButton getBtnRun() { return btnRun; }
public abstract void splitMenuButtonExpandCollapseAction(final SplitMenuButtonWrap<? extends SplitMenuButton> wrap);