@Test public void selectNoIconAndTextTab() { TabPane tabPane = (TabPane) getPrimaryStage().getScene().getRoot().lookup(".tab-pane"); LoggingRecorder lr = new LoggingRecorder(); Platform.runLater(new Runnable() { @Override public void run() { tabPane.getTabs().add(new Tab()); tabPane.getSelectionModel().select(4); RFXTabPane rfxTabPane = new RFXTabPane(tabPane, null, null, lr); rfxTabPane.mouseClicked(null); } }); List<Recording> recordings = lr.waitAndGetRecordings(1); Recording select = recordings.get(0); AssertJUnit.assertEquals("recordSelect", select.getCall()); AssertJUnit.assertEquals("tabIndex-4", select.getParameters()[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; }