javafx.scene.control.Tab.setContent()方法的使用及代码示例

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

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

Tab.setContent介绍

暂无

代码示例

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

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

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

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

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

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

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

@Override
  public void handle(Event event) {
    // workaround for javafx memeoryleaks RT-25652, RT-32087
    formTabFinal.setContent(null);
    formTabFinal.textProperty().unbind();
    formTabFinal.setOnClosed(null);
    form.close();
  }
});

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

tab.setContent(content);
if (index > 0)
 tabPane.getTabs().add(index, tab);

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

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: 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: 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: org.copper-engine/copper-monitoring-client

formTab = new Tab();
formTab.textProperty().bind(form.displayedTitleProperty());
formTab.setContent(form.getCachedContent());
component.getTabs().add(formTab);

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

this.installedApplicationsTab.setClosable(false);
this.installedApplicationsTab.setText(tr("My applications"));
this.installedApplicationsTab.setContent(this.availableShortcuts);

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

box.getChildren().add(b3);
tabD.setContent(box);

代码示例来源: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: com.bitplan.radolan/com.bitplan.radolan

private void addTab(String tabId, MapView mapView) {
 Tab mapViewTab = xyTabPane.getTab(tabId);
 mapViewTab.setContent(mapView.getStackPane());
 NumberBinding heightAdjust = getScene().heightProperty()
   .subtract(xyTabPane.getTabSize()); // getMenuBar().heightProperty().add(
 NumberBinding widthAdjust = getScene().widthProperty()
   .subtract(xyTabPane.getTabSize());
 // mapView.addSizeListener(widthAdjust, heightAdjust);
 // NumberBinding
 // heightAdjust=rainTabPane.heightProperty().add(getMenuBar().heightProperty());
 mapView.getImageView().fitHeightProperty().bind(heightAdjust);
 mapView.getImageView().fitWidthProperty().bind(widthAdjust);
}

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

private void buildListViewTab(Tab tab) {
  GridPane grid = new GridPane();
  grid.setPadding(new Insets(5, 5, 5, 5));
  grid.setHgap(5);
  grid.setVgap(5);
  // create the listview
  final ListView<TestPerson> listView = new ListView<TestPerson>();
  listView.setItems(data);
  // set the cell factory
  Callback<TestPerson, ObservableValue<Boolean>> getProperty = new Callback<TestPerson, ObservableValue<Boolean>>() {
    @Override public BooleanProperty call(TestPerson person) {
      // given a person, we return the property that represents
      // whether or not they are invited. We can then bind to this
      // bidirectionally.
      return person.telecommuterProperty();
    }
  };
  listView.setCellFactory(CheckBoxListCell.forListView(getProperty));
  grid.add(listView, 0, 0);
  GridPane.setVgrow(listView, Priority.ALWAYS);
  GridPane.setHgrow(listView, Priority.ALWAYS);
  tab.setContent(grid);
}

代码示例来源: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

private void buildTableViewTab(Tab tab) {
  GridPane grid = new GridPane();
  grid.setPadding(new Insets(5, 5, 5, 5));
  grid.setHgap(5);
  grid.setVgap(5);
  // create the tableview
  TableColumn<TestPerson, Boolean> invitedColumn = new TableColumn<TestPerson, Boolean>("Invited");
  invitedColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, Boolean>("invited"));
  TableColumn<TestPerson, String> nameColumn = new TableColumn<TestPerson, String>("First Name");
  nameColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, String>("firstName"));
  TableView<TestPerson> tableView = new TableView<TestPerson>(data);
  tableView.getColumns().setAll(invitedColumn, nameColumn);
  // set the cell factory in the invited TableColumn
  invitedColumn.setCellFactory(CheckBoxTableCell.forTableColumn(invitedColumn));
  grid.add(tableView, 0, 0);
  GridPane.setVgrow(tableView, Priority.ALWAYS);
  GridPane.setHgrow(tableView, Priority.ALWAYS);
  tab.setContent(grid);
}

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

public <T extends Node> Tab startInTab(FlowContainer<T> container) throws FlowException {
  Tab tab = new Tab();
  getCurrentViewMetadata().addListener((e) -> {
    tab.textProperty().unbind();
    tab.graphicProperty().unbind();
    tab.textProperty().bind(getCurrentViewMetadata().get().titleProperty());
    tab.graphicProperty().bind(getCurrentViewMetadata().get().graphicsProperty());
  });
  tab.setOnClosed(e -> {
    try {
      destroy();
    } catch (Exception exception) {
      exceptionHandler.setException(exception);
    }
  });
  tab.setContent(start(container));
  return tab;
}

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

GridPane.setHgrow(treeView1, Priority.ALWAYS);
tab.setContent(grid);

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

private Tab createColorTab() {
  Tab t = new Tab();
  t.setText(Messages.getString("PaintEditor.Color")); //$NON-NLS-1$
  GridLayoutPane p = new GridLayoutPane();
  p.setNumColumns(3);
  Rectangle solidPreview = new Rectangle(PREVIEW_SIZE, PREVIEW_SIZE);
  this.solidPreview = solidPreview;
  GridLayoutPane dataPane = new GridLayoutPane();
  dataPane.setNumColumns(2);
  ColorPicker picker = new ColorPicker();
  picker.valueProperty().addListener((o) -> {
    solidPreview.setFill(picker.getValue());
    this.paint.set(picker.getValue());
  });
  dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.Color")), picker); //$NON-NLS-1$
  Color color = (Color) this.paint.get();
  if (color instanceof Color) {
    picker.setValue(color);
  }
  TitledPane dtp = new TitledPane(Messages.getString("PaintEditor.Data"), dataPane); //$NON-NLS-1$
  dtp.setCollapsible(false);
  TitledPane pane = new TitledPane(Messages.getString("PaintEditor.Preview"), solidPreview); //$NON-NLS-1$
  pane.setCollapsible(false);
  GridLayoutPane.setConstraint(dtp, new GridData(Alignment.FILL, Alignment.FILL, true, true));
  GridLayoutPane.setConstraint(pane, new GridData(Alignment.BEGINNING, Alignment.BEGINNING, false, false));
  p.getChildren().addAll(pane, dtp);
  t.setContent(p);
  return t;
}

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls

private Tab createColorTab() {
  Tab t = new Tab();
  t.setText(Messages.getString("PaintEditor.Color")); //$NON-NLS-1$
  GridLayoutPane p = new GridLayoutPane();
  p.setNumColumns(3);
  Rectangle solidPreview = new Rectangle(PREVIEW_SIZE, PREVIEW_SIZE);
  this.solidPreview = solidPreview;
  GridLayoutPane dataPane = new GridLayoutPane();
  dataPane.setNumColumns(2);
  ColorPicker picker = new ColorPicker();
  picker.valueProperty().addListener((o) -> {
    solidPreview.setFill(picker.getValue());
    this.paint.set(picker.getValue());
  });
  dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.Color")), picker); //$NON-NLS-1$
  Color color = (Color) this.paint.get();
  if (color instanceof Color) {
    picker.setValue(color);
  }
  TitledPane dtp = new TitledPane(Messages.getString("PaintEditor.Data"), dataPane); //$NON-NLS-1$
  dtp.setCollapsible(false);
  TitledPane pane = new TitledPane(Messages.getString("PaintEditor.Preview"), solidPreview); //$NON-NLS-1$
  pane.setCollapsible(false);
  GridLayoutPane.setConstraint(dtp, new GridData(Alignment.FILL, Alignment.FILL, true, true));
  GridLayoutPane.setConstraint(pane, new GridData(Alignment.BEGINNING, Alignment.BEGINNING, false, false));
  p.getChildren().addAll(pane, dtp);
  t.setContent(p);
  return t;
}

相关文章