public void newTab() { Tab tab = new Tab("New tab"); tab.setClosable(true); tabPane.getTabs().add(tab); selectionTab.selectLast(); focusAddressBar(); }
/** * 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; }
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); }
Tab tab = new Tab(); tab.setId(tabId); if (glyphName != null) {
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; }
containerEngineToolsPanel.setEngineToolsManager(engineToolsManager); final Tab engineToolsTab = new Tab(tr("Engine tools"), containerEngineToolsPanel);
engineSubCategoryPanel -> new Tab(engineSubCategoryPanel.getEngineSubCategory().getDescription(), engineSubCategoryPanel));
@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); } } }
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); } }
/** * 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()); }
this.libraryTabs.getStyleClass().add("rightPane"); this.installedApplicationsTab = new Tab(); this.installedApplicationsTab.setClosable(false); this.installedApplicationsTab.setText(tr("My applications"));
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); }
/** * 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; }
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; }
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; }
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; }