@Test public void getText() throws Throwable { TabPane tabPane = (TabPane) getPrimaryStage().getScene().getRoot().lookup(".tab-pane"); LoggingRecorder lr = new LoggingRecorder(); List<String> text = new ArrayList<>(); Platform.runLater(new Runnable() { @Override public void run() { RFXTabPane rfxTabPane = new RFXTabPane(tabPane, null, null, lr); tabPane.getSelectionModel().select(1); rfxTabPane.mouseClicked(null); text.add(rfxTabPane.getAttribute("text")); } }); new Wait("Waiting for tab pane text.") { @Override public boolean until() { return text.size() > 0; } }; AssertJUnit.assertEquals("Tab 2", text.get(0)); }
@Override protected void mouseClicked(MouseEvent me) { TabPane tp = (TabPane) node; SingleSelectionModel<Tab> selectionModel = tp.getSelectionModel(); Tab selectedTab = selectionModel.getSelectedItem(); if (selectedTab != null && prevSelection != selectionModel.getSelectedIndex()) { recorder.recordSelect(this, getTextForTab(tp, selectedTab)); } prevSelection = selectionModel.getSelectedIndex(); }
RFXTabPane extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { TabPane tp = (TabPane) node; SingleSelectionModel<Tab> selectionModel = tp.getSelectionModel(); Tab selectedTab = selectionModel.getSelectedItem(); if (selectedTab != null && prevSelection != selectionModel.getSelectedIndex()) { recorder.recordSelect(this, getTextForTab(tp, selectedTab)); } prevSelection = selectionModel.getSelectedIndex(); } }
RFXTabPane extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { TabPane tp = (TabPane) node; SingleSelectionModel<Tab> selectionModel = tp.getSelectionModel(); Tab selectedTab = selectionModel.getSelectedItem(); if (selectedTab != null && prevSelection != selectionModel.getSelectedIndex()) { recorder.recordSelect(this, getTextForTab(tp, selectedTab)); } prevSelection = selectionModel.getSelectedIndex(); } RFXTabPane(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); }
RFXTabPane extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { TabPane tp = (TabPane) node; SingleSelectionModel<Tab> selectionModel = tp.getSelectionModel(); Tab selectedTab = selectionModel.getSelectedItem(); if (selectedTab != null && prevSelection != selectionModel.getSelectedIndex()) { recorder.recordSelect(this, getTextForTab(tp, selectedTab)); } prevSelection = selectionModel.getSelectedIndex(); } RFXTabPane(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override String _getText(); }
RFXTabPane extends RFXComponent { @Override protected void mouseClicked(MouseEvent me) { TabPane tp = (TabPane) node; SingleSelectionModel<Tab> selectionModel = tp.getSelectionModel(); Tab selectedTab = selectionModel.getSelectedItem(); if (selectedTab != null && prevSelection != selectionModel.getSelectedIndex()) { recorder.recordSelect(this, getTextForTab(tp, selectedTab)); } prevSelection = selectionModel.getSelectedIndex(); } RFXTabPane(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder); @Override String _getText(); static final Logger LOGGER; }