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

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

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

Tab介绍

暂无

代码示例

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

Tab tab = new Tab();
tab.setText(msg);
tab.setContent(new Label(TAB_0));
Tab tab1 = new Tab();
tab1.setText(TAB_01);
tab1.setContent(new Label(TAB_01));
  Tab temp = new Tab();
  int count = tabPane.getTabs().size();
  temp.setText(msg + count);
  temp.setContent(new Label(TAB_0 + count));
  tabPane.getTabs().add(temp);
});

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

getStyleClass().setAll(tab.getStyleClass());
setId(tab.getId());
setStyle(tab.getStyle());
tabLabel = new Label(tab.getText(), tab.getGraphic());
tabLabel.getStyleClass().setAll("tab-label");
tooltip = tab.getTooltip();
if (tooltip != null) {
  Tooltip.install(this, tooltip);
listener.registerChangeListener(tab.selectedProperty(), "SELECTED");
listener.registerChangeListener(tab.textProperty(), "TEXT");
listener.registerChangeListener(tab.graphicProperty(), "GRAPHIC");
listener.registerChangeListener(tab.tooltipProperty(), "TOOLTIP");
listener.registerChangeListener(tab.disableProperty(), "DISABLE");
listener.registerChangeListener(tab.styleProperty(), "STYLE");
listener.registerChangeListener(getSkinnable().tabClosingPolicyProperty(), "TAB_CLOSING_POLICY");
listener.registerChangeListener(getSkinnable().tabMinWidthProperty(), "TAB_MIN_WIDTH");
listener.registerChangeListener(getSkinnable().sideProperty(), "SIDE");
listener.registerChangeListener(widthProperty(), "WIDTH");
tab.getStyleClass().addListener(weakStyleClassListener);
  if (tab.isDisable() || !event.isStillSincePress()) {
    return;
  ContextMenu contextMenu = tab.getContextMenu();
  if (contextMenu != null) {

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

private void updateContent() {
  Node newContent = tab.getContent();
  if (newContent == null) {
    getChildren().clear();
  } else {
    getChildren().setAll(newContent);
  }
}

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

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

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

private void handlePropertyChanged(final String p) {
  if ("SELECTED".equals(p)) {
    pseudoClassStateChanged(SELECTED_PSEUDOCLASS_STATE, tab.isSelected());
    updateInnerUI();
  } else if ("TEXT".equals(p)) {
    tabLabel.setText(tab.getText());
  } else if ("GRAPHIC".equals(p)) {
    tabLabel.setGraphic(tab.getGraphic());
  } else if ("TOOLTIP".equals(p)) {
      Tooltip.uninstall(this, oldTooltip);
    tooltip = tab.getTooltip();
    if (tooltip != null) {
      Tooltip.install(this, tooltip);
    pseudoClassStateChanged(DISABLED_PSEUDOCLASS_STATE, tab.isDisable());
    updateInnerUI();
  } else if ("STYLE".equals(p)) {
    setStyle(tab.getStyle());
  }  else if ("TAB_CLOSING_POLICY".equals(p)) {
    updateInnerUI();

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

/**
 * This methods creates a tab that contains the given view. 
 * By doing so the metadata of the view will be bound to the tab properties. 
 * So the text and icon of the tab can be changed by the view.
 * 
 * @param  context the context of the view. This includes the view and its controller instance 
 * so that all needed informations are part of the context
 * @param  exceptionHandler the exception handle for the view. This handler will handle all exceptions that will be thrown in the DataFX container context
 */
public <T> Tab createTab(ViewContext<T> context, ExceptionHandler exceptionHandler) {
  Tab tab = new Tab();
  tab.textProperty().bind(context.getMetadata().titleProperty());
  tab.graphicProperty().bind(context.getMetadata().graphicsProperty());
  tab.setOnClosed(e -> {
    try {
      context.destroy();
    } catch (Exception exception) {
      exceptionHandler.setException(exception);
    }
  });
  tab.setContent(context.getRootNode());
  return tab;
}

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

Tab tab1 = new Tab("Allgemein");
Image image = new Image(AquaFx.class.getResource("demo/images/preferences/allgemein.png").toExternalForm());
ImageView pages = new ImageView(image);
pages.setPreserveRatio(true);
pages.setFitHeight(36);
tab1.setGraphic(pages);
Label label =new Label("Allgemein...");
label.setPadding(new Insets(15));
tab1.setContent(label);
tabPane.getTabs().add(tab1);
Tab tab2 = new Tab("Etiketten");
Image image2 = new Image(AquaFx.class.getResource("demo/images/preferences/labels.png").toExternalForm());
ImageView layout =  new ImageView(image2);
layout.setPreserveRatio(true);
layout.setFitHeight(36);
tab2.setGraphic(layout);
Label label2 = new Label("Etiketten");
label2.setPadding(new Insets(15));
tab2.setContent(label2);
tabPane.getTabs().add(tab2);
Tab tab3 = new Tab("Seitenleiste");
Image image3 = new Image(AquaFx.class.getResource("demo/images/preferences/seitenleiste.png").toExternalForm());
ImageView umbruch = new ImageView(image3);
umbruch.setPreserveRatio(true);
umbruch.setFitHeight(36);
tab3.setGraphic(umbruch);
Label label3 = new Label("seitenleiste...");

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

private void addTab(PositionableAdapter<FXDockableEntry> dockable) {
  final Tab tab = new Tab();
  final FXDockableData dockableData = dockable.getAdapted().getDockableData();
  tab.textProperty().bind(dockableData.titleProperty());
  tab.graphicProperty().bind(dockableData.graphicProperty());
  tab.tooltipProperty().bind(dockableData.tooltipProperty());
  tab.contextMenuProperty().bind(dockableData.contextMenuProperty());
  tab.setContent(dockable.getAdapted().getDockable());
  tab.setOnCloseRequest(tabManager.createOnCloseRequestHandler(tab, dockable.getAdapted(), control));
  observeDockableData(dockableData, tab);
  tabPane.getTabs().add(control.getDockables().indexOf(dockable), tab);
}

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

if (tab.getContent()==form.getCachedContent()){
    formTab=tab;
  formTab = new Tab();
  formTab.textProperty().bind(form.displayedTitleProperty());
  formTab.setContent(form.getCachedContent());
  component.getTabs().add(formTab);
formTab.setOnClosed(new EventHandler<Event>() {
  @Override
  public void handle(Event event) {
formTab.setOnSelectionChanged(new EventHandler<Event>() {
  @Override
  public void handle(Event event) {

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

Tab tab = new Tab();
tab.setId(tabId);
if (glyphName != null) {
 this.setTabGlyph(tab, glyphName);
 tab.setTooltip(new Tooltip(title));
 if (tab.getGraphic() == null) {
  tab.setText(title);
tab.setContent(content);
if (index > 0)
 tabPane.getTabs().add(index, tab);

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

private void addTab(PositionableAdapter<FXDockableEntry> dockable) {
    final Tab tab = new Tab();
    final FXDockableData dockableData = dockable.getAdapted().getDockableData();
    tab.textProperty().bind(dockableData.titleProperty());
    tab.graphicProperty().bind(dockableData.graphicProperty());
    tab.contextMenuProperty().bind(dockableData.contextMenuProperty());
    tab.setContent(dockable.getAdapted().getDockable());
    tabPane.getTabs().add(control.getDockables().indexOf(dockable), tab);
  }
}

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

tabContent.setMinHeight(100);
Tab rgbTab = new Tab("RGB");
rgbTab.setContent(tabContent);
Tab hsbTab = new Tab("HSB");
hsbTab.setContent(hsbField);
Tab hexTab = new Tab("HEX");
hexTab.setContent(hexField);

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

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

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

Tab tabD = new Tab();
tabD.setText("Buttons");
VBox buttonBox = new VBox();
buttonBox.setSpacing(10);
tabD.setContent(buttonBox);
buttonTabPane.getTabs().add(tabD);
Tab tabE = new Tab();
tabE.setText("RadioButtons");
VBox radioButtonBox = new VBox();
radioButtonBox.setSpacing(10);
raBu4.setSelected(true);
radioButtonBox.getChildren().add(raBu4);
tabE.setContent(radioButtonBox);
buttonTabPane.getTabs().add(tabE);
Tab tabF = new Tab();
tabF.setText("CheckBoxes");
VBox checkBoxBox = new VBox();
checkBoxBox.setSpacing(10);
box6.setDisable(true);
checkBoxBox.getChildren().add(box6);
tabF.setContent(checkBoxBox);
buttonTabPane.getTabs().add(tabF);
Tab tabG = new Tab();

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

@SuppressWarnings("unchecked")
private Node createEditor(Data newValue, Data previousValue){
  if (newValue==null) {
    return new Label("empty");
  } else {
    if (newValue.internal().attributeListGrouped().size()==1){
      final Node attributeGroupVisual = createAttributeGroupVisual(newValue.internal().attributeListGrouped().get(0).group,previousValue, () -> newValue.internal().validateFlat());
      return customizeVis(attributeGroupVisual,newValue);
    } else {
      TabPane tabPane = new TabPane();
      for (AttributeGroup attributeGroup: newValue.internal().attributeListGrouped()) {
        Tab tab=new Tab(uniformDesign.getText(attributeGroup.title));
        tab.setClosable(false);
        tab.setContent(createAttributeGroupVisual(attributeGroup.group,previousValue, () -> newValue.internal().validateFlat()));
        tabPane.getTabs().add(tab);
      }
      return customizeVis(tabPane,newValue);
    }
  }
}

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

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

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

public void populate(List<ShortcutCategoryDTO> categories) {
  Platform.runLater(() -> {
    this.categories.setAll(categories);
    closeDetailsView();
    this.installedApplicationsTab.setContent(this.availableShortcuts);
  });
}

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

public Node getContent(Scene scene) {
  // TabPane
  final TabPane tabPane = new TabPane();
  tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
  tabPane.setPrefWidth(scene.getWidth());
  tabPane.setPrefHeight(scene.getHeight());
  tabPane.prefWidthProperty().bind(scene.widthProperty());
  tabPane.prefHeightProperty().bind(scene.heightProperty());
  // list view examples
  Tab listViewTab = new Tab("ListView");
  buildListViewTab(listViewTab);
  tabPane.getTabs().add(listViewTab);
  // tree view examples
  Tab treeViewTab = new Tab("TreeView");
  buildTreeViewTab(treeViewTab);
  tabPane.getTabs().add(treeViewTab);
  // table view examples
  Tab tableViewTab = new Tab("TableView");
  buildTableViewTab(tableViewTab);
  tabPane.getTabs().add(tableViewTab);
  return tabPane;
}

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

public void newTab() {
  Tab tab = new Tab("New tab");
  tab.setClosable(true);
  tabPane.getTabs().add(tab);
  selectionTab.selectLast();
  focusAddressBar();
}

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

FlowPane preContGraphic = new FlowPane(3, 3, new Label(RESOURCE_BUNDLE.getString("PreContingency")), preContBadge);
preContGraphic.setPrefWrapLength(150);
preContTab = new Tab("", preContResultPane);
preContTab.setGraphic(preContGraphic);
preContTab.setClosable(false);
postContTab = new Tab("", postContResultPane);
postContTab.setGraphic(postContGraphic);
postContTab.setClosable(false);

相关文章