javafx.scene.control.Tab类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(211)

本文整理了Java中javafx.scene.control.Tab类的一些代码示例,展示了Tab类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tab类的具体详情如下:
包路径:javafx.scene.control.Tab
类名称:Tab

Tab介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

  1. Tab tab = new Tab();
  2. tab.setText(msg);
  3. tab.setContent(new Label(TAB_0));
  4. Tab tab1 = new Tab();
  5. tab1.setText(TAB_01);
  6. tab1.setContent(new Label(TAB_01));
  7. Tab temp = new Tab();
  8. int count = tabPane.getTabs().size();
  9. temp.setText(msg + count);
  10. temp.setContent(new Label(TAB_0 + count));
  11. tabPane.getTabs().add(temp);
  12. });

代码示例来源:origin: jfoenixadmin/JFoenix

  1. getStyleClass().setAll(tab.getStyleClass());
  2. setId(tab.getId());
  3. setStyle(tab.getStyle());
  4. tabLabel = new Label(tab.getText(), tab.getGraphic());
  5. tabLabel.getStyleClass().setAll("tab-label");
  6. tooltip = tab.getTooltip();
  7. if (tooltip != null) {
  8. Tooltip.install(this, tooltip);
  9. listener.registerChangeListener(tab.selectedProperty(), "SELECTED");
  10. listener.registerChangeListener(tab.textProperty(), "TEXT");
  11. listener.registerChangeListener(tab.graphicProperty(), "GRAPHIC");
  12. listener.registerChangeListener(tab.tooltipProperty(), "TOOLTIP");
  13. listener.registerChangeListener(tab.disableProperty(), "DISABLE");
  14. listener.registerChangeListener(tab.styleProperty(), "STYLE");
  15. listener.registerChangeListener(getSkinnable().tabClosingPolicyProperty(), "TAB_CLOSING_POLICY");
  16. listener.registerChangeListener(getSkinnable().tabMinWidthProperty(), "TAB_MIN_WIDTH");
  17. listener.registerChangeListener(getSkinnable().sideProperty(), "SIDE");
  18. listener.registerChangeListener(widthProperty(), "WIDTH");
  19. tab.getStyleClass().addListener(weakStyleClassListener);
  20. if (tab.isDisable() || !event.isStillSincePress()) {
  21. return;
  22. ContextMenu contextMenu = tab.getContextMenu();
  23. if (contextMenu != null) {

代码示例来源:origin: jfoenixadmin/JFoenix

  1. private void updateContent() {
  2. Node newContent = tab.getContent();
  3. if (newContent == null) {
  4. getChildren().clear();
  5. } else {
  6. getChildren().setAll(newContent);
  7. }
  8. }

代码示例来源:origin: pmd/pmd

  1. private void notifyMetricsAvailable(long numMetrics) {
  2. metricResultsTab.setText("Metrics\t(" + (numMetrics == 0 ? "none" : numMetrics) + ")");
  3. metricsTitledPane.setTitle("Metrics\t(" + (numMetrics == 0 ? "none" : numMetrics) + " available)");
  4. metricResultsTab.setDisable(numMetrics == 0);
  5. }

代码示例来源:origin: jfoenixadmin/JFoenix

  1. private void handlePropertyChanged(final String p) {
  2. if ("SELECTED".equals(p)) {
  3. pseudoClassStateChanged(SELECTED_PSEUDOCLASS_STATE, tab.isSelected());
  4. updateInnerUI();
  5. } else if ("TEXT".equals(p)) {
  6. tabLabel.setText(tab.getText());
  7. } else if ("GRAPHIC".equals(p)) {
  8. tabLabel.setGraphic(tab.getGraphic());
  9. } else if ("TOOLTIP".equals(p)) {
  10. Tooltip.uninstall(this, oldTooltip);
  11. tooltip = tab.getTooltip();
  12. if (tooltip != null) {
  13. Tooltip.install(this, tooltip);
  14. pseudoClassStateChanged(DISABLED_PSEUDOCLASS_STATE, tab.isDisable());
  15. updateInnerUI();
  16. } else if ("STYLE".equals(p)) {
  17. setStyle(tab.getStyle());
  18. } else if ("TAB_CLOSING_POLICY".equals(p)) {
  19. updateInnerUI();

代码示例来源:origin: io.datafx/flow

  1. /**
  2. * This methods creates a tab that contains the given view.
  3. * By doing so the metadata of the view will be bound to the tab properties.
  4. * So the text and icon of the tab can be changed by the view.
  5. *
  6. * @param context the context of the view. This includes the view and its controller instance
  7. * so that all needed informations are part of the context
  8. * @param exceptionHandler the exception handle for the view. This handler will handle all exceptions that will be thrown in the DataFX container context
  9. */
  10. public <T> Tab createTab(ViewContext<T> context, ExceptionHandler exceptionHandler) {
  11. Tab tab = new Tab();
  12. tab.textProperty().bind(context.getMetadata().titleProperty());
  13. tab.graphicProperty().bind(context.getMetadata().graphicsProperty());
  14. tab.setOnClosed(e -> {
  15. try {
  16. context.destroy();
  17. } catch (Exception exception) {
  18. exceptionHandler.setException(exception);
  19. }
  20. });
  21. tab.setContent(context.getRootNode());
  22. return tab;
  23. }

代码示例来源:origin: com.aquafx-project/aquafx

  1. Tab tab1 = new Tab("Allgemein");
  2. Image image = new Image(AquaFx.class.getResource("demo/images/preferences/allgemein.png").toExternalForm());
  3. ImageView pages = new ImageView(image);
  4. pages.setPreserveRatio(true);
  5. pages.setFitHeight(36);
  6. tab1.setGraphic(pages);
  7. Label label =new Label("Allgemein...");
  8. label.setPadding(new Insets(15));
  9. tab1.setContent(label);
  10. tabPane.getTabs().add(tab1);
  11. Tab tab2 = new Tab("Etiketten");
  12. Image image2 = new Image(AquaFx.class.getResource("demo/images/preferences/labels.png").toExternalForm());
  13. ImageView layout = new ImageView(image2);
  14. layout.setPreserveRatio(true);
  15. layout.setFitHeight(36);
  16. tab2.setGraphic(layout);
  17. Label label2 = new Label("Etiketten");
  18. label2.setPadding(new Insets(15));
  19. tab2.setContent(label2);
  20. tabPane.getTabs().add(tab2);
  21. Tab tab3 = new Tab("Seitenleiste");
  22. Image image3 = new Image(AquaFx.class.getResource("demo/images/preferences/seitenleiste.png").toExternalForm());
  23. ImageView umbruch = new ImageView(image3);
  24. umbruch.setPreserveRatio(true);
  25. umbruch.setFitHeight(36);
  26. tab3.setGraphic(umbruch);
  27. Label label3 = new Label("seitenleiste...");

代码示例来源:origin: org.drombler.commons/drombler-commons-docking-fx

  1. private void addTab(PositionableAdapter<FXDockableEntry> dockable) {
  2. final Tab tab = new Tab();
  3. final FXDockableData dockableData = dockable.getAdapted().getDockableData();
  4. tab.textProperty().bind(dockableData.titleProperty());
  5. tab.graphicProperty().bind(dockableData.graphicProperty());
  6. tab.tooltipProperty().bind(dockableData.tooltipProperty());
  7. tab.contextMenuProperty().bind(dockableData.contextMenuProperty());
  8. tab.setContent(dockable.getAdapted().getDockable());
  9. tab.setOnCloseRequest(tabManager.createOnCloseRequestHandler(tab, dockable.getAdapted(), control));
  10. observeDockableData(dockableData, tab);
  11. tabPane.getTabs().add(control.getDockables().indexOf(dockable), tab);
  12. }

代码示例来源:origin: org.copper-engine/copper-monitoring-client

  1. if (tab.getContent()==form.getCachedContent()){
  2. formTab=tab;
  3. formTab = new Tab();
  4. formTab.textProperty().bind(form.displayedTitleProperty());
  5. formTab.setContent(form.getCachedContent());
  6. component.getTabs().add(formTab);
  7. formTab.setOnClosed(new EventHandler<Event>() {
  8. @Override
  9. public void handle(Event event) {
  10. formTab.setOnSelectionChanged(new EventHandler<Event>() {
  11. @Override
  12. public void handle(Event event) {

代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx

  1. Tab tab = new Tab();
  2. tab.setId(tabId);
  3. if (glyphName != null) {
  4. this.setTabGlyph(tab, glyphName);
  5. tab.setTooltip(new Tooltip(title));
  6. if (tab.getGraphic() == null) {
  7. tab.setText(title);
  8. tab.setContent(content);
  9. if (index > 0)
  10. tabPane.getTabs().add(index, tab);

代码示例来源:origin: org.drombler.commons/drombler-commons-fx-docking

  1. private void addTab(PositionableAdapter<FXDockableEntry> dockable) {
  2. final Tab tab = new Tab();
  3. final FXDockableData dockableData = dockable.getAdapted().getDockableData();
  4. tab.textProperty().bind(dockableData.titleProperty());
  5. tab.graphicProperty().bind(dockableData.graphicProperty());
  6. tab.contextMenuProperty().bind(dockableData.contextMenuProperty());
  7. tab.setContent(dockable.getAdapted().getDockable());
  8. tabPane.getTabs().add(control.getDockables().indexOf(dockable), tab);
  9. }
  10. }

代码示例来源:origin: jfoenixadmin/JFoenix

  1. tabContent.setMinHeight(100);
  2. Tab rgbTab = new Tab("RGB");
  3. rgbTab.setContent(tabContent);
  4. Tab hsbTab = new Tab("HSB");
  5. hsbTab.setContent(hsbField);
  6. Tab hexTab = new Tab("HEX");
  7. hexTab.setContent(hexField);

代码示例来源:origin: PhoenicisOrg/phoenicis

  1. this.libraryTabs.getStyleClass().add("rightPane");
  2. this.installedApplicationsTab = new Tab();
  3. this.installedApplicationsTab.setClosable(false);
  4. this.installedApplicationsTab.setText(tr("My applications"));
  5. this.installedApplicationsTab.setContent(this.availableShortcuts);

代码示例来源:origin: com.aquafx-project/aquafx

  1. Tab tabD = new Tab();
  2. tabD.setText("Buttons");
  3. VBox buttonBox = new VBox();
  4. buttonBox.setSpacing(10);
  5. tabD.setContent(buttonBox);
  6. buttonTabPane.getTabs().add(tabD);
  7. Tab tabE = new Tab();
  8. tabE.setText("RadioButtons");
  9. VBox radioButtonBox = new VBox();
  10. radioButtonBox.setSpacing(10);
  11. raBu4.setSelected(true);
  12. radioButtonBox.getChildren().add(raBu4);
  13. tabE.setContent(radioButtonBox);
  14. buttonTabPane.getTabs().add(tabE);
  15. Tab tabF = new Tab();
  16. tabF.setText("CheckBoxes");
  17. VBox checkBoxBox = new VBox();
  18. checkBoxBox.setSpacing(10);
  19. box6.setDisable(true);
  20. checkBoxBox.getChildren().add(box6);
  21. tabF.setContent(checkBoxBox);
  22. buttonTabPane.getTabs().add(tabF);
  23. Tab tabG = new Tab();

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

  1. @SuppressWarnings("unchecked")
  2. private Node createEditor(Data newValue, Data previousValue){
  3. if (newValue==null) {
  4. return new Label("empty");
  5. } else {
  6. if (newValue.internal().attributeListGrouped().size()==1){
  7. final Node attributeGroupVisual = createAttributeGroupVisual(newValue.internal().attributeListGrouped().get(0).group,previousValue, () -> newValue.internal().validateFlat());
  8. return customizeVis(attributeGroupVisual,newValue);
  9. } else {
  10. TabPane tabPane = new TabPane();
  11. for (AttributeGroup attributeGroup: newValue.internal().attributeListGrouped()) {
  12. Tab tab=new Tab(uniformDesign.getText(attributeGroup.title));
  13. tab.setClosable(false);
  14. tab.setContent(createAttributeGroupVisual(attributeGroup.group,previousValue, () -> newValue.internal().validateFlat()));
  15. tabPane.getTabs().add(tab);
  16. }
  17. return customizeVis(tabPane,newValue);
  18. }
  19. }
  20. }

代码示例来源:origin: com.aquafx-project/aquafx

  1. Tab tab1 = new Tab("Tab 1 (disabled)");
  2. tab1.setContent(new Label("Lorem Ipsum tab1"));
  3. tab1.setDisable(true);
  4. tabPane.getTabs().add(tab1);
  5. final Tab tab2 = new Tab("Tab 2");
  6. tab2.setContent(new Label("Lorem Ipsum"));
  7. tabPane.getTabs().add(tab2);
  8. pane.setTop(tabPane);

代码示例来源:origin: PhoenicisOrg/phoenicis

  1. public void populate(List<ShortcutCategoryDTO> categories) {
  2. Platform.runLater(() -> {
  3. this.categories.setAll(categories);
  4. closeDetailsView();
  5. this.installedApplicationsTab.setContent(this.availableShortcuts);
  6. });
  7. }

代码示例来源:origin: com.aquafx-project/aquafx

  1. public Node getContent(Scene scene) {
  2. // TabPane
  3. final TabPane tabPane = new TabPane();
  4. tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
  5. tabPane.setPrefWidth(scene.getWidth());
  6. tabPane.setPrefHeight(scene.getHeight());
  7. tabPane.prefWidthProperty().bind(scene.widthProperty());
  8. tabPane.prefHeightProperty().bind(scene.heightProperty());
  9. // list view examples
  10. Tab listViewTab = new Tab("ListView");
  11. buildListViewTab(listViewTab);
  12. tabPane.getTabs().add(listViewTab);
  13. // tree view examples
  14. Tab treeViewTab = new Tab("TreeView");
  15. buildTreeViewTab(treeViewTab);
  16. tabPane.getTabs().add(treeViewTab);
  17. // table view examples
  18. Tab tableViewTab = new Tab("TableView");
  19. buildTableViewTab(tableViewTab);
  20. tabPane.getTabs().add(tableViewTab);
  21. return tabPane;
  22. }

代码示例来源:origin: brunoborges/webfx

  1. public void newTab() {
  2. Tab tab = new Tab("New tab");
  3. tab.setClosable(true);
  4. tabPane.getTabs().add(tab);
  5. selectionTab.selectLast();
  6. focusAddressBar();
  7. }

代码示例来源:origin: com.powsybl/powsybl-gse-security-analysis

  1. FlowPane preContGraphic = new FlowPane(3, 3, new Label(RESOURCE_BUNDLE.getString("PreContingency")), preContBadge);
  2. preContGraphic.setPrefWrapLength(150);
  3. preContTab = new Tab("", preContResultPane);
  4. preContTab.setGraphic(preContGraphic);
  5. preContTab.setClosable(false);
  6. postContTab = new Tab("", postContResultPane);
  7. postContTab.setGraphic(postContGraphic);
  8. postContTab.setClosable(false);

相关文章