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); });
rgbTab.setContent(tabContent); Tab hsbTab = new Tab("HSB"); hsbTab.setContent(hsbField); Tab hexTab = new Tab("HEX"); hexTab.setContent(hexField);
public void populate(List<ShortcutCategoryDTO> categories) { Platform.runLater(() -> { this.categories.setAll(categories); closeDetailsView(); this.installedApplicationsTab.setContent(this.availableShortcuts); }); }
@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(); } });
tab.setContent(content); if (index > 0) tabPane.getTabs().add(index, tab);
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);
@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); } }
formTab = new Tab(); formTab.textProperty().bind(form.displayedTitleProperty()); formTab.setContent(form.getCachedContent()); component.getTabs().add(formTab);
this.installedApplicationsTab.setClosable(false); this.installedApplicationsTab.setText(tr("My applications")); this.installedApplicationsTab.setContent(this.availableShortcuts);
box.getChildren().add(b3); tabD.setContent(box);
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); }
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); }
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); }
/** * 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; }
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); }
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; }
GridPane.setHgrow(treeView1, Priority.ALWAYS); tab.setContent(grid);
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; }