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

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

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

Tab.<init>介绍

暂无

代码示例

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

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

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

代码示例来源:origin: org.gillius/jfxutils

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

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

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

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

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

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

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

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

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

Tab tabD = new Tab();
tabD.setText("tab 1");
Tab tabE = new Tab();
tabE.setText("tab 2");
tabPane.getTabs().add(tabE);
Tab tabF = new Tab();
tabF.setText("tab 3");
tabPane.getTabs().add(tabF);

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

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

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

/**
 * create an XYTab Pane with the given iconSize
 * 
 * @param iconSize
 *          - e.g. 48
 */
public XYTabPane(int iconSize) {
 super();
 this.iconSize = iconSize;
 this.currentTab = TabSelection.getInstance();
 setvTabPane(this.addTabPane("vTabPane"));
 getvTabPane().setSide(Side.LEFT);
 Tab filler = new Tab();
 topLeftButton = new Button();
 int tabSize = getTabSize();
 topLeftButton.setMinSize(tabSize, tabSize);
 topLeftButton.setMaxSize(tabSize, tabSize);
 topLeftButton.setDisable(true);
 filler.setGraphic(topLeftButton);
 filler.setDisable(true);
 getvTabPane().getTabs().add(filler);
 this.addToMaps(filler, vTabPane);
 fontAwesome = GlyphFontRegistry.font("FontAwesome");
 super.getChildren().add(getvTabPane());
}

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

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

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

相关文章