类javafx.scene.control.TabPane.TabClosingPolicy源码实例Demo

下面列出了怎么用javafx.scene.control.TabPane.TabClosingPolicy的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: marathonv5   文件: MPFConfigurationStage.java
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;
}
 
源代码2 项目: marathonv5   文件: CompositeLayout.java
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);
}
 
源代码3 项目: marathonv5   文件: BrowserConfigurationStage.java
@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;

}
 
源代码4 项目: tuxguitar   文件: JFXTabFolder.java
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);
}
 
源代码5 项目: JFX-Browser   文件: MainController.java
@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);

}
 
 类所在包
 同包方法