@PersistentProperty public int getBottomTabIndex() { return bottomTabPane.getSelectionModel().getSelectedIndex(); }
public void setBottomTabIndex(int i) { if (i >= 0 && i < bottomTabPane.getTabs().size()) { bottomTabPane.getSelectionModel().select(i); } }
@Override protected void handleControlPropertyChanged(String property) { super.handleControlPropertyChanged(property); if ("SELECTED_TAB".equals(property)) { isSelectingTab = true; selectedTab = getSkinnable().getSelectionModel().getSelectedItem(); getSkinnable().requestLayout(); } else if ("WIDTH".equals(property)) { clip.setWidth(getSkinnable().getWidth()); } else if ("HEIGHT".equals(property)) { clip.setHeight(getSkinnable().getHeight()); } }
selectedTab = getSkinnable().getSelectionModel().getSelectedItem(); if (selectedTab == null && getSkinnable().getSelectionModel().getSelectedIndex() != -1) { getSkinnable().getSelectionModel().select(getSkinnable().getSelectionModel().getSelectedIndex()); selectedTab = getSkinnable().getSelectionModel().getSelectedItem(); getSkinnable().getSelectionModel().selectFirst(); selectedTab = getSkinnable().getSelectionModel().getSelectedItem(); while (change.next()) { if (change.wasPermutated()) { Tab selectedTab = getSkinnable().getSelectionModel().getSelectedItem(); List<Tab> permutatedTabs = new ArrayList<>(change.getTo() - change.getFrom()); getSkinnable().getSelectionModel().clearSelection(); for (int i = change.getFrom(); i < change.getTo(); i++) { permutatedTabs.add(getSkinnable().getTabs().get(i)); getSkinnable().getSelectionModel().select(selectedTab); }); registerChangeListener(tabPane.getSelectionModel().selectedItemProperty(), "SELECTED_TAB"); registerChangeListener(tabPane.widthProperty(), "WIDTH"); registerChangeListener(tabPane.heightProperty(), "HEIGHT");
/** * select the Vertical Tab with the given tabPaneId * * @param tabPaneId */ public void selectVTab(String tabPaneId) { Tab tab = vTabMap.get(tabPaneId); if (tab == null) throw new IllegalArgumentException( "unknown tabPaneId for vertical tab " + tabPaneId); vTabPane.getSelectionModel().select(tab); }
/** * get the select horizontal TabPane * * @return - the tabPane */ public TabPane getSelectedTabPane() { Tab vTab = vTabPane.getSelectionModel().getSelectedItem(); TabPane tabPane = this.vTabPaneMapByTab.get(vTab); return tabPane; }
/** * get the selected tab of the given tab Pane * * @param tabPane * @return the selected tab */ public Tab getSelectedTab(TabPane tabPane) { SingleSelectionModel<Tab> vsel = tabPane.getSelectionModel(); return vsel.getSelectedItem(); }
public void showInstallations() { tabPane.getSelectionModel().select(4); } }
public void createNewTab(Tab tab) { this.libraryTabs.getTabs().add(tab); this.libraryTabs.getSelectionModel().select(tab); if (this.onTabOpened != null) { this.onTabOpened.run(); } }
@Override public void select(GenericTab draggedTab) { this.pane.getSelectionModel().select(draggedTab.getNativeInstance()); }
@Override public void select(GenericTab draggedTab) { this.pane.getSelectionModel().select(draggedTab.getNativeInstance()); }
/** * select a random tab * * @param tabPane */ public Tab selectRandomTab(TabPane tabPane) { Random random = new Random(); SingleSelectionModel<Tab> vsel = tabPane.getSelectionModel(); int tabIndex = random.nextInt(vTabPane.getTabs().size()); vsel.select(tabIndex); return vsel.getSelectedItem(); }
/** * select the tab with the given tab id * * @param tabId * @return - the tab; */ public Tab selectTab(String tabId) { Tab tab = getTab(tabId); TabPane tabPane = this.tabPaneByTabIdMap.get(tabId); if (tabPane == null) { LOGGER.log(Level.WARNING,"no tabPane for tabId "+tabId+"active"); } else { Tab vtab = this.vTapMapByTabPane.get(tabPane); // first select the Vertical tab if (debug) LOGGER.log(Level.INFO, "selecting tabpane " + tabPane.getId()); vTabPane.getSelectionModel().select(vtab); // then the horizontal one if (debug) LOGGER.log(Level.INFO, "selecting tab " + tab.getId()); tabPane.getSelectionModel().select(tab); } return tab; }
private void adjustBorders() { boolean foundSelected = false; List<Tab> tabs = getSkinnable().getTabs(); Tab selectedTab = getSkinnable().getSelectionModel().getSelectedItem(); for (Tab tab : tabs) { tab.getStyleClass().remove("neighbor"); if (foundSelected) { tab.getStyleClass().add("neighbor"); foundSelected = false; } if (tab.equals(selectedTab)) { foundSelected = true; } } }
tabPane.getSelectionModel().selectedItemProperty() .addListener((ov, oldTab, newTab) -> { if (oldTab != null) { "tabPane " + currentTab.getTabPaneId() + " selected"); TabPane selectedTabPane = tabPaneMap.get(tabId); Tab selectedTab = selectedTabPane.getSelectionModel() .getSelectedItem(); if (selectedTab != null)
static Node createTabPane(int numOfTabs, int prefWidth, int prefHeight, String firstTabText, boolean floating, boolean disableFirst, Side side) { TabPane tabPane = new TabPane(); tabPane.setSide(side); if (floating) tabPane.getStyleClass().add("floating"); for (int i=1; i<=numOfTabs; i++) { tabPane.getTabs().add( TabBuilder.create() .text("Tab "+i) .disable(i==0 && disableFirst) .content(new Label((i==1 && firstTabText!=null)? firstTabText :"Tab "+i+" Content")) .build() ); } if (disableFirst) tabPane.getSelectionModel().select(1); tabPane.setPrefWidth(prefWidth); tabPane.setPrefHeight(prefHeight); return tabPane; }
@Override public void dispose() { control.getDockables().removeListener(dockablesChangeListener); tabPane.getTabs().removeListener(tabsChangeListener); control.getSelectionModel().selectedIndexProperty().removeListener(dockableSelectedIndexChangeListener); tabPane.getSelectionModel().selectedIndexProperty().removeListener(tabSelectedIndexChangeListener); control = null; tabPane = null; }
@Override public void dispose() { control.getDockables().removeListener(dockablesChangeListener); tabPane.getTabs().removeListener(tabsChangeListener); control.getSelectionModel().selectedIndexProperty().removeListener(dockableSelectedIndexChangeListener); tabPane.getSelectionModel().selectedIndexProperty().removeListener(tabSelectedIndexChangeListener); control = null; tabPane = null; }
tabPane.getSelectionModel().selectedIndexProperty().addListener(tabSelectedIndexChangeListener); tabPane.getSelectionModel().select(selectedIndex);
tabPane.getSelectionModel().selectedItemProperty().addListener((ov, t, t1) -> { LOGGER.info("Tab selection changed"); if (selectedBrowserTab() == null) {