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

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

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

Tab.setContent介绍

暂无

代码示例

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

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

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

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

代码示例来源: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: org.copper-engine/copper-monitoring-client

  1. @Override
  2. public void handle(Event event) {
  3. // workaround for javafx memeoryleaks RT-25652, RT-32087
  4. formTabFinal.setContent(null);
  5. formTabFinal.textProperty().unbind();
  6. formTabFinal.setOnClosed(null);
  7. form.close();
  8. }
  9. });

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

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

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

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

代码示例来源: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: 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: org.copper-engine/copper-monitoring-client

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

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

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

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

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

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

  1. private void addTab(String tabId, MapView mapView) {
  2. Tab mapViewTab = xyTabPane.getTab(tabId);
  3. mapViewTab.setContent(mapView.getStackPane());
  4. NumberBinding heightAdjust = getScene().heightProperty()
  5. .subtract(xyTabPane.getTabSize()); // getMenuBar().heightProperty().add(
  6. NumberBinding widthAdjust = getScene().widthProperty()
  7. .subtract(xyTabPane.getTabSize());
  8. // mapView.addSizeListener(widthAdjust, heightAdjust);
  9. // NumberBinding
  10. // heightAdjust=rainTabPane.heightProperty().add(getMenuBar().heightProperty());
  11. mapView.getImageView().fitHeightProperty().bind(heightAdjust);
  12. mapView.getImageView().fitWidthProperty().bind(widthAdjust);
  13. }

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

  1. private void buildListViewTab(Tab tab) {
  2. GridPane grid = new GridPane();
  3. grid.setPadding(new Insets(5, 5, 5, 5));
  4. grid.setHgap(5);
  5. grid.setVgap(5);
  6. // create the listview
  7. final ListView<TestPerson> listView = new ListView<TestPerson>();
  8. listView.setItems(data);
  9. // set the cell factory
  10. Callback<TestPerson, ObservableValue<Boolean>> getProperty = new Callback<TestPerson, ObservableValue<Boolean>>() {
  11. @Override public BooleanProperty call(TestPerson person) {
  12. // given a person, we return the property that represents
  13. // whether or not they are invited. We can then bind to this
  14. // bidirectionally.
  15. return person.telecommuterProperty();
  16. }
  17. };
  18. listView.setCellFactory(CheckBoxListCell.forListView(getProperty));
  19. grid.add(listView, 0, 0);
  20. GridPane.setVgrow(listView, Priority.ALWAYS);
  21. GridPane.setHgrow(listView, Priority.ALWAYS);
  22. tab.setContent(grid);
  23. }

代码示例来源: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. private void buildTableViewTab(Tab tab) {
  2. GridPane grid = new GridPane();
  3. grid.setPadding(new Insets(5, 5, 5, 5));
  4. grid.setHgap(5);
  5. grid.setVgap(5);
  6. // create the tableview
  7. TableColumn<TestPerson, Boolean> invitedColumn = new TableColumn<TestPerson, Boolean>("Invited");
  8. invitedColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, Boolean>("invited"));
  9. TableColumn<TestPerson, String> nameColumn = new TableColumn<TestPerson, String>("First Name");
  10. nameColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, String>("firstName"));
  11. TableView<TestPerson> tableView = new TableView<TestPerson>(data);
  12. tableView.getColumns().setAll(invitedColumn, nameColumn);
  13. // set the cell factory in the invited TableColumn
  14. invitedColumn.setCellFactory(CheckBoxTableCell.forTableColumn(invitedColumn));
  15. grid.add(tableView, 0, 0);
  16. GridPane.setVgrow(tableView, Priority.ALWAYS);
  17. GridPane.setHgrow(tableView, Priority.ALWAYS);
  18. tab.setContent(grid);
  19. }

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

  1. public <T extends Node> Tab startInTab(FlowContainer<T> container) throws FlowException {
  2. Tab tab = new Tab();
  3. getCurrentViewMetadata().addListener((e) -> {
  4. tab.textProperty().unbind();
  5. tab.graphicProperty().unbind();
  6. tab.textProperty().bind(getCurrentViewMetadata().get().titleProperty());
  7. tab.graphicProperty().bind(getCurrentViewMetadata().get().graphicsProperty());
  8. });
  9. tab.setOnClosed(e -> {
  10. try {
  11. destroy();
  12. } catch (Exception exception) {
  13. exceptionHandler.setException(exception);
  14. }
  15. });
  16. tab.setContent(start(container));
  17. return tab;
  18. }

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

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

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

  1. private Tab createColorTab() {
  2. Tab t = new Tab();
  3. t.setText(Messages.getString("PaintEditor.Color")); //$NON-NLS-1$
  4. GridLayoutPane p = new GridLayoutPane();
  5. p.setNumColumns(3);
  6. Rectangle solidPreview = new Rectangle(PREVIEW_SIZE, PREVIEW_SIZE);
  7. this.solidPreview = solidPreview;
  8. GridLayoutPane dataPane = new GridLayoutPane();
  9. dataPane.setNumColumns(2);
  10. ColorPicker picker = new ColorPicker();
  11. picker.valueProperty().addListener((o) -> {
  12. solidPreview.setFill(picker.getValue());
  13. this.paint.set(picker.getValue());
  14. });
  15. dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.Color")), picker); //$NON-NLS-1$
  16. Color color = (Color) this.paint.get();
  17. if (color instanceof Color) {
  18. picker.setValue(color);
  19. }
  20. TitledPane dtp = new TitledPane(Messages.getString("PaintEditor.Data"), dataPane); //$NON-NLS-1$
  21. dtp.setCollapsible(false);
  22. TitledPane pane = new TitledPane(Messages.getString("PaintEditor.Preview"), solidPreview); //$NON-NLS-1$
  23. pane.setCollapsible(false);
  24. GridLayoutPane.setConstraint(dtp, new GridData(Alignment.FILL, Alignment.FILL, true, true));
  25. GridLayoutPane.setConstraint(pane, new GridData(Alignment.BEGINNING, Alignment.BEGINNING, false, false));
  26. p.getChildren().addAll(pane, dtp);
  27. t.setContent(p);
  28. return t;
  29. }

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

  1. private Tab createColorTab() {
  2. Tab t = new Tab();
  3. t.setText(Messages.getString("PaintEditor.Color")); //$NON-NLS-1$
  4. GridLayoutPane p = new GridLayoutPane();
  5. p.setNumColumns(3);
  6. Rectangle solidPreview = new Rectangle(PREVIEW_SIZE, PREVIEW_SIZE);
  7. this.solidPreview = solidPreview;
  8. GridLayoutPane dataPane = new GridLayoutPane();
  9. dataPane.setNumColumns(2);
  10. ColorPicker picker = new ColorPicker();
  11. picker.valueProperty().addListener((o) -> {
  12. solidPreview.setFill(picker.getValue());
  13. this.paint.set(picker.getValue());
  14. });
  15. dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.Color")), picker); //$NON-NLS-1$
  16. Color color = (Color) this.paint.get();
  17. if (color instanceof Color) {
  18. picker.setValue(color);
  19. }
  20. TitledPane dtp = new TitledPane(Messages.getString("PaintEditor.Data"), dataPane); //$NON-NLS-1$
  21. dtp.setCollapsible(false);
  22. TitledPane pane = new TitledPane(Messages.getString("PaintEditor.Preview"), solidPreview); //$NON-NLS-1$
  23. pane.setCollapsible(false);
  24. GridLayoutPane.setConstraint(dtp, new GridData(Alignment.FILL, Alignment.FILL, true, true));
  25. GridLayoutPane.setConstraint(pane, new GridData(Alignment.BEGINNING, Alignment.BEGINNING, false, false));
  26. p.getChildren().addAll(pane, dtp);
  27. t.setContent(p);
  28. return t;
  29. }

相关文章