javafx.scene.control.TabPane.TabClosingPolicy Java Examples

The following examples show how to use javafx.scene.control.TabPane.TabClosingPolicy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MPFConfigurationStage.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
private TabPane createTabPane() {
    tabPane = new TabPane();
    tabPane.setId("ConfigurationTabPane");
    tabPane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
    layouts = mpfConfigurationInfo.getProperties(this);
    for (IPropertiesLayout layout : layouts) {
        String name = layout.getName();
        Node content = layout.getContent();
        content.getStyleClass().add(StyleClassHelper.BACKGROUND);
        Tab tab = new Tab(name, content);
        tab.setId(name);
        tab.setGraphic(layout.getIcon());
        tabPane.getTabs().add(tab);
    }
    VBox.setVgrow(tabPane, Priority.ALWAYS);
    return tabPane;
}
 
Example #2
Source File: CompositeLayout.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
private void initComponents() {
    optionBox.setItems(model);
    optionBox.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
        if (newValue != null) {
            updateTabPane();
        }
    });
    optionBox.setCellFactory(new Callback<ListView<PlugInModelInfo>, ListCell<PlugInModelInfo>>() {
        @Override
        public ListCell<PlugInModelInfo> call(ListView<PlugInModelInfo> param) {
            return new LauncherCell();
        }
    });
    optionTabpane.setId("CompositeTabPane");
    optionTabpane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
    optionTabpane.getStyleClass().add(TabPane.STYLE_CLASS_FLOATING);
    VBox.setVgrow(optionTabpane, Priority.ALWAYS);
}
 
Example #3
Source File: BrowserConfigurationStage.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
public Parent getContentPane() {
    BorderPane borderPane = new BorderPane();
    browserTabs = new TabPane();
    browserTabs.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
    for (Browser browser : browsers) {
        IWebBrowserProxy proxy = getProxyInstance(browser);
        browserTabs.getTabs().add((Tab) proxy.getTab(browser.getBrowserName()));
    }
    borderPane.setCenter(browserTabs);
    borderPane.setBottom(buttonBar);
    return borderPane;

}
 
Example #4
Source File: JFXTabFolder.java    From tuxguitar with GNU Lesser General Public License v2.1 5 votes vote down vote up
public JFXTabFolder(JFXContainer<? extends Region> parent, boolean showClose) {
	super(new TabPane(), parent);
	
	this.tabs = new ArrayList<JFXTabItem>();
	this.closeListener = new UICloseListenerManager();
	this.selectionListener = new UISelectionListenerManager();
	
	this.getControl().setTabClosingPolicy(showClose ? TabClosingPolicy.ALL_TABS : TabClosingPolicy.UNAVAILABLE);
}
 
Example #5
Source File: MainController.java    From JFX-Browser with MIT License 3 votes vote down vote up
@Override
public void initialize(URL url, ResourceBundle rb) {


	//addNewTab.setGraphic(new ImageView(new Image(getClass().getResourceAsStream(Main.IMAGES+"newtab.png"))));
	
	// ------All opens tabs should be closed so below line is for just
	// closing tabs
	addNewTab.setClosable(false);
	addNewTab.setId("addNewTab");
	tabPane.setId("tabadded");


	tabPane.setTabClosingPolicy(TabClosingPolicy.ALL_TABS);
	// ------tabPane.setFocusTraversable(false);

	try {
		// -----here below adding page title of tab
		firstTab.setContent(FXMLLoader.load(getClass().getResource(Main.FXMLS+"Tab.fxml")));

		// firstTab.setText("Google");

	} catch (IOException e2) {
		// TODO Auto-generated catch block
		e2.printStackTrace();
	}

	tabPane.getTabs().addAll(firstTab, addNewTab);
	rootBorderPane.setCenter(tabPane);

	getTabPaneView(tabPane, addNewTab);
	tabPaneChangeListener(tabPane);

}