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

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

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

Tab.<init>介绍

暂无

代码示例

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

代码示例来源: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: 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: org.gillius/jfxutils

  1. /**
  2. * Helper method to create a new tab with the given label and make it draggable with {@link #makeDraggable}.
  3. */
  4. public static Tab newDraggableTab( String label ) {
  5. Tab rr = new Tab();
  6. rr.setGraphic( new Label( label ) );
  7. makeDraggable( rr );
  8. return rr;
  9. }

代码示例来源:origin: Tristan971/Lyrebird

  1. private void createTabForPal(final User user) {
  2. if (loadedPals.contains(user)) return;
  3. LOG.debug("Creating a conversation tab for conversation with {}", user.getScreenName());
  4. easyFxml.loadNode(DIRECT_MESSAGE_CONVERSATION, Pane.class, DMConversationController.class)
  5. .afterControllerLoaded(dmc -> dmc.setPal(user))
  6. .getNode()
  7. .recover(ExceptionHandler::fromThrowable)
  8. .map(conversation -> new Tab(user.getName(), conversation))
  9. .onSuccess(tab -> Platform.runLater(() -> {
  10. LOG.debug("Adding [{}] as tab for user {}", tab.getText(), user.getScreenName());
  11. this.conversationsManaged.add(tab);
  12. }));
  13. loadedPals.add(user);
  14. }

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

  1. Tab tab = new Tab();
  2. tab.setId(tabId);
  3. if (glyphName != null) {

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

  1. containerEngineToolsPanel.setEngineToolsManager(engineToolsManager);
  2. final Tab engineToolsTab = new Tab(tr("Engine tools"), containerEngineToolsPanel);

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

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

  1. Tab tabD = new Tab();
  2. tabD.setText("tab 1");
  3. Tab tabE = new Tab();
  4. tabE.setText("tab 2");
  5. tabPane.getTabs().add(tabE);
  6. Tab tabF = new Tab();
  7. tabF.setText("tab 3");
  8. tabPane.getTabs().add(tabF);

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

  1. engineSubCategoryPanel -> new Tab(engineSubCategoryPanel.getEngineSubCategory().getDescription(),
  2. engineSubCategoryPanel));

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

  1. /**
  2. * create an XYTab Pane with the given iconSize
  3. *
  4. * @param iconSize
  5. * - e.g. 48
  6. */
  7. public XYTabPane(int iconSize) {
  8. super();
  9. this.iconSize = iconSize;
  10. this.currentTab = TabSelection.getInstance();
  11. setvTabPane(this.addTabPane("vTabPane"));
  12. getvTabPane().setSide(Side.LEFT);
  13. Tab filler = new Tab();
  14. topLeftButton = new Button();
  15. int tabSize = getTabSize();
  16. topLeftButton.setMinSize(tabSize, tabSize);
  17. topLeftButton.setMaxSize(tabSize, tabSize);
  18. topLeftButton.setDisable(true);
  19. filler.setGraphic(topLeftButton);
  20. filler.setDisable(true);
  21. getvTabPane().getTabs().add(filler);
  22. this.addToMaps(filler, vTabPane);
  23. fontAwesome = GlyphFontRegistry.font("FontAwesome");
  24. super.getChildren().add(getvTabPane());
  25. }

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

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

相关文章