javafx.util.Callback Java Examples

The following examples show how to use javafx.util.Callback. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClosedTradesView.java    From bisq with GNU Affero General Public License v3.0 8 votes vote down vote up
private void setPriceColumnCellFactory() {
    priceColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
    priceColumn.setCellFactory(
            new Callback<>() {
                @Override
                public TableCell<ClosedTradableListItem, ClosedTradableListItem> call(
                        TableColumn<ClosedTradableListItem, ClosedTradableListItem> column) {
                    return new TableCell<>() {
                        @Override
                        public void updateItem(final ClosedTradableListItem item, boolean empty) {
                            super.updateItem(item, empty);
                            setGraphic(new AutoTooltipLabel(model.getPrice(item)));
                        }
                    };
                }
            });
}
 
Example #2
Source File: ClosedTradesView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setSellerSecurityDepositColumnCellFactory() {
	sellerSecurityDepositColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
	sellerSecurityDepositColumn.setCellFactory(
               new Callback<>() {
                   @Override
                   public TableCell<ClosedTradableListItem, ClosedTradableListItem> call(
                           TableColumn<ClosedTradableListItem, ClosedTradableListItem> column) {
                       return new TableCell<>() {
                           @Override
                           public void updateItem(final ClosedTradableListItem item, boolean empty) {
                               super.updateItem(item, empty);
                               setGraphic(new AutoTooltipLabel(model.getSellerSecurityDeposit(item)));
                           }
                       };
                   }
               });
}
 
Example #3
Source File: DepositView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setConfidenceColumnCellFactory() {
    confirmationsColumn.setCellValueFactory((addressListItem) ->
            new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    confirmationsColumn.setCellFactory(
            new Callback<>() {

                @Override
                public TableCell<DepositListItem, DepositListItem> call(TableColumn<DepositListItem,
                        DepositListItem> column) {
                    return new TableCell<>() {

                        @Override
                        public void updateItem(final DepositListItem item, boolean empty) {
                            super.updateItem(item, empty);

                            if (item != null && !empty) {
                                setGraphic(item.getTxConfidenceIndicator());
                            } else {
                                setGraphic(null);
                            }
                        }
                    };
                }
            });
}
 
Example #4
Source File: PendingTradesView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setAmountColumnCellFactory() {
    amountColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
    amountColumn.setCellFactory(
            new Callback<>() {
                @Override
                public TableCell<PendingTradesListItem, PendingTradesListItem> call(
                        TableColumn<PendingTradesListItem, PendingTradesListItem> column) {
                    return new TableCell<>() {
                        @Override
                        public void updateItem(final PendingTradesListItem item, boolean empty) {
                            super.updateItem(item, empty);
                            if (item != null && !empty)
                                setGraphic(new AutoTooltipLabel(formatter.formatCoin(item.getTrade().getTradeAmount())));
                            else
                                setGraphic(null);
                        }
                    };
                }
            });
}
 
Example #5
Source File: CompositeLayout.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
private void initComponents() {
    optionBox.setItems(model);
    optionBox.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
        if (newValue != null) {
            updateTabPane();
        }
    });
    optionBox.setCellFactory(new Callback<ListView<PlugInModelInfo>, ListCell<PlugInModelInfo>>() {
        @Override
        public ListCell<PlugInModelInfo> call(ListView<PlugInModelInfo> param) {
            return new LauncherCell();
        }
    });
    optionTabpane.setId("CompositeTabPane");
    optionTabpane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
    optionTabpane.getStyleClass().add(TabPane.STYLE_CLASS_FLOATING);
    VBox.setVgrow(optionTabpane, Priority.ALWAYS);
}
 
Example #6
Source File: FunctionStage.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
private Node createTree() {
    VBox treeContentBox = new VBox();
    tree.setRoot(functionInfo.getRoot(true));
    tree.setShowRoot(false);
    tree.getSelectionModel().selectedItemProperty().addListener(new TreeViewSelectionChangeListener());
    tree.setCellFactory(new Callback<TreeView<Object>, TreeCell<Object>>() {
        @Override
        public TreeCell<Object> call(TreeView<Object> param) {
            return new FunctionTreeCell();
        }
    });
    filterByName.setOnAction((e) -> {
        tree.setRoot(functionInfo.refreshNode(filterByName.isSelected()));
        expandAll();
    });
    filterByName.setSelected(true);
    expandAll();
    treeContentBox.getChildren().addAll(topButtonBar, tree, filterByName);
    VBox.setVgrow(tree, Priority.ALWAYS);
    return treeContentBox;
}
 
Example #7
Source File: ReservedView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setDateColumnCellFactory() {
    dateColumn.getStyleClass().add("first-column");
    dateColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    dateColumn.setCellFactory(new Callback<>() {

        @Override
        public TableCell<ReservedListItem, ReservedListItem> call(TableColumn<ReservedListItem,
                ReservedListItem> column) {
            return new TableCell<>() {

                @Override
                public void updateItem(final ReservedListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        if (getTradable(item).isPresent())
                            setGraphic(new AutoTooltipLabel(DisplayUtils.formatDateTime(getTradable(item).get().getDate())));
                        else
                            setGraphic(new AutoTooltipLabel(Res.get("shared.noDateAvailable")));
                    } else {
                        setGraphic(null);
                    }
                }
            };
        }
    });
}
 
Example #8
Source File: SeriesController.java    From houdoku with MIT License 6 votes vote down vote up
/**
 * Creates a Callback of a standard cell factory for a table cell.
 * 
 * <p>The cell factory represents the String content as a JavaFX Text object using the
 * "tableText" style class. The cell is given a click handler from newCellClickHandler().
 *
 * @param widthProperty the widthProperty of this cell's column
 * @param contextMenu   the context menu shown when right clicking
 * @return a Callback of a standard cell factory for a table cell
 */
private Callback<TableColumn<Chapter, String>, TableCell<Chapter, String>> newStringCellFactory(
        ReadOnlyDoubleProperty widthProperty, ContextMenu contextMenu) {
    return tc -> {
        TableCell<Chapter, String> cell = new TableCell<>();
        cell.getStyleClass().add("tableCell");
        Text text = new Text();
        text.getStyleClass().add("tableText");
        text.setTextAlignment(TextAlignment.LEFT);
        cell.setGraphic(text);
        text.wrappingWidthProperty().bind(widthProperty);
        text.textProperty().bind(cell.itemProperty());
        cell.setOnMouseClicked(newCellClickHandler(contextMenu));
        return cell;
    };
}
 
Example #9
Source File: FailedTradesView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setDateColumnCellFactory() {
    dateColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
    dateColumn.setCellFactory(
            new Callback<>() {
                @Override
                public TableCell<FailedTradesListItem, FailedTradesListItem> call(
                        TableColumn<FailedTradesListItem, FailedTradesListItem> column) {
                    return new TableCell<>() {
                        @Override
                        public void updateItem(final FailedTradesListItem item, boolean empty) {
                            super.updateItem(item, empty);
                            if (item != null)
                                setGraphic(new AutoTooltipLabel(model.getDate(item)));
                            else
                                setGraphic(null);
                        }
                    };
                }
            });
}
 
Example #10
Source File: ImageManufacturePaneController.java    From MyBox with Apache License 2.0 6 votes vote down vote up
public void initScopesBox() {
    try {

        scopeSelector.setButtonCell(new ImageScopeCell());
        scopeSelector.setCellFactory(new Callback<ListView<ImageScope>, ListCell<ImageScope>>() {
            @Override
            public ListCell<ImageScope> call(ListView<ImageScope> param) {
                return new ImageScopeCell();
            }
        });
        scopeSelector.setVisibleRowCount(15);

        scopeDeleteButton.disableProperty().bind(
                scopeSelector.getSelectionModel().selectedItemProperty().isNull()
        );
        scopeUseButton.disableProperty().bind(
                scopeSelector.getSelectionModel().selectedItemProperty().isNull()
        );
    } catch (Exception e) {
        logger.error(e.toString());
    }
}
 
Example #11
Source File: DisplayableListCell.java    From Quelea with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Provide a callback that sets the given context menu on each cell, if and
 * only if the constraint given passes. If the constraint is null, it will
 * always pass.
 * <p/>
 * @param <T> the generic type of the cell.
 * @param contextMenu the context menu to show.
 * @param cellFactory the cell factory to use.
 * @param constraint the constraint placed on showing the context menu - it
 * will only be shown if this constraint passes, or it is null.
 * @return a callback that sets the given context menu on each cell.
 */
public static <T> Callback<ListView<T>, ListCell<T>> forListView(final ContextMenu contextMenu, final Callback<ListView<T>, ListCell<T>> cellFactory,
        final Constraint<T> constraint) {
    return new Callback<ListView<T>, ListCell<T>>() {
        @Override
        public ListCell<T> call(ListView<T> listView) {
            final ListCell<T> cell = cellFactory == null ? new DefaultListCell<T>() : cellFactory.call(listView);
            cell.itemProperty().addListener(new ChangeListener<T>() {
                @Override
                public void changed(ObservableValue<? extends T> ov, T oldVal, T newVal) {
                    if(newVal == null || (constraint != null && !constraint.isTrue(newVal))) {
                        cell.setContextMenu(null);
                    }
                    else {
                        cell.setContextMenu(contextMenu);
                    }
                }
            });
            return cell;
        }
    };
}
 
Example #12
Source File: PendingTradesView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setDateColumnCellFactory() {
    dateColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
    dateColumn.setCellFactory(
            new Callback<>() {
                @Override
                public TableCell<PendingTradesListItem, PendingTradesListItem> call(
                        TableColumn<PendingTradesListItem, PendingTradesListItem> column) {
                    return new TableCell<>() {
                        @Override
                        public void updateItem(final PendingTradesListItem item, boolean empty) {
                            super.updateItem(item, empty);
                            if (item != null && !empty) {
                                setGraphic(new AutoTooltipLabel(DisplayUtils.formatDateTime(item.getTrade().getDate())));
                            } else {
                                setGraphic(null);
                            }
                        }
                    };
                }
            });
}
 
Example #13
Source File: TransactionsView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setMemoColumnCellFactory() {
    memoColumn.setCellValueFactory((addressListItem) ->
            new ReadOnlyObjectWrapper<>(addressListItem.getValue()));

    memoColumn.setCellFactory(
            new Callback<>() {

                @Override
                public TableCell<TransactionsListItem, TransactionsListItem> call(TableColumn<TransactionsListItem,
                        TransactionsListItem> column) {
                    return new TableCell<>() {

                        @Override
                        public void updateItem(final TransactionsListItem item, boolean empty) {
                            super.updateItem(item, empty);

                            if (item != null && !empty) {
                                setGraphic(new AutoTooltipLabel(item.getMemo()));
                            } else {
                                setGraphic(null);
                            }
                        }
                    };
                }
            });
}
 
Example #14
Source File: HomeScreenController.java    From examples-javafx-repos1 with Apache License 2.0 6 votes vote down vote up
private Stage createStage( String fxmlFile, Callback<Class<?>, Object> gcf, String stageTitle, Class<?> sa ) throws IOException {

        if( logger.isDebugEnabled() ) {
            logger.debug("[CREATE STAGE] fxmlFile=" + fxmlFile + ", using loader from class=" + sa.getName());
        }

        String path = StringUtils.replace(DEFAULT_PACKAGE_TO_SCAN, ".", "/");

        FXMLLoader aScreenLoader = new FXMLLoader(
                sa.getResource( "/" + path + "/" + fxmlFile ),
                null,
                builderFactory,
                gcf);

        Parent someScreen = (Parent) aScreenLoader.load();

        Stage stage = new Stage();
        stage.setTitle( stageTitle );
        Scene someScene = new Scene(someScreen);
        stage.setScene(someScene);

        return stage;
    }
 
Example #15
Source File: ClosedTradesView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setTradeFeeColumnCellFactory() {
	tradeFeeColumn.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
	tradeFeeColumn.setCellFactory(
               new Callback<>() {
                   @Override
                   public TableCell<ClosedTradableListItem, ClosedTradableListItem> call(
                           TableColumn<ClosedTradableListItem, ClosedTradableListItem> column) {
                       return new TableCell<>() {
                           @Override
                           public void updateItem(final ClosedTradableListItem item, boolean empty) {
                               super.updateItem(item, empty);
                               setGraphic(new AutoTooltipLabel(model.getMakerFee(item)));
                           }
                       };
                   }
               });
}
 
Example #16
Source File: JavaFXCheckBoxTableCellElement.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public String _getValue() {
    CheckBoxTableCell cell = (CheckBoxTableCell) node;
    Callback selectedStateCallback = cell.getSelectedStateCallback();
    String cbText;
    if (selectedStateCallback != null) {
        ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
        int selection = call.getValue() ? 2 : 0;
        cbText = JavaFXCheckBoxElement.states[selection];
    } else {
        Node cb = cell.getGraphic();
        JavaFXElement comp = (JavaFXElement) JavaFXElementFactory.createElement(cb, driver, window);
        cbText = comp._getValue();

    }
    String cellText = cell.getText();
    if (cellText == null) {
        cellText = "";
    }
    String text = cellText + ":" + cbText;
    return text;
}
 
Example #17
Source File: EditableTreeTable.java    From Open-Lowcode with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * generates the root column showing label of line elements
 */
private void generateRootColumn() {

	TreeTableColumn<
			EditableTreeTableLineItem<Wrapper<E>>,
			String> rootcolumn = new TreeTableColumn<EditableTreeTableLineItem<Wrapper<E>>, String>("Item");
	rootcolumn.setCellValueFactory(new Callback<
			CellDataFeatures<EditableTreeTableLineItem<Wrapper<E>>, String>, ObservableValue<String>>() {

		@Override
		public ObservableValue<String> call(CellDataFeatures<EditableTreeTableLineItem<Wrapper<E>>, String> param) {
			return new SimpleStringProperty(param.getValue().getValue().getLabel());
		}
	});

	treetableview.getColumns().add(rootcolumn);
}
 
Example #18
Source File: DepositView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setUsageColumnCellFactory() {
    usageColumn.getStyleClass().add("last-column");
    usageColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    usageColumn.setCellFactory(new Callback<>() {

        @Override
        public TableCell<DepositListItem, DepositListItem> call(TableColumn<DepositListItem,
                DepositListItem> column) {
            return new TableCell<>() {

                @Override
                public void updateItem(final DepositListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        setGraphic(new AutoTooltipLabel(item.getUsage()));
                    } else {
                        setGraphic(null);
                    }
                }
            };
        }
    });
}
 
Example #19
Source File: ListCellLabelTest.java    From oim-fx with MIT License 6 votes vote down vote up
@Override
public void start(Stage primaryStage) throws Exception {
    StackPane pane = new StackPane();
    Scene scene = new Scene(pane, 300, 150);
    primaryStage.setScene(scene);
    ObservableList<String> list = FXCollections.observableArrayList(
            "Item 1", "Item 2", "Item 3", "Item 4");
    ListView<String> lv = new ListView<>(list);
    lv.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {
        @Override
        public ListCell<String> call(ListView<String> param) {
            return new XCell();
        }
    });
    pane.getChildren().add(lv);
    primaryStage.show();
}
 
Example #20
Source File: DesignerUtil.java    From pmd-designer with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public static <T> Callback<ListView<T>, ListCell<T>> simpleListCellFactory(Function<T, String> converter, Function<T, String> toolTipMaker) {
    return collection -> new ListCell<T>() {
        @Override
        protected void updateItem(T item, boolean empty) {
            super.updateItem(item, empty);

            if (empty || item == null) {
                setText(null);
                setGraphic(null);
                Tooltip.uninstall(this, getTooltip());
            } else {
                setText(converter.apply(item));
                Tooltip.install(this, new Tooltip(toolTipMaker.apply(item)));
            }
        }
    };
}
 
Example #21
Source File: OpenOffersView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private void setDateColumnCellFactory() {
    dateColumn.setCellValueFactory((openOfferListItem) -> new ReadOnlyObjectWrapper<>(openOfferListItem.getValue()));
    dateColumn.setCellFactory(
            new Callback<>() {
                @Override
                public TableCell<OpenOfferListItem, OpenOfferListItem> call(
                        TableColumn<OpenOfferListItem, OpenOfferListItem> column) {
                    return new TableCell<>() {
                        @Override
                        public void updateItem(final OpenOfferListItem item, boolean empty) {
                            super.updateItem(item, empty);
                            getStyleClass().removeAll("offer-disabled");
                            if (item != null) {
                                if (model.isDeactivated(item)) getStyleClass().add("offer-disabled");
                                setGraphic(new AutoTooltipLabel(model.getDate(item)));
                            } else {
                                setGraphic(null);
                            }
                        }
                    };
                }
            });
}
 
Example #22
Source File: RFXCheckBoxTreeTableCell.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public String _getValue() {
    CheckBoxTreeTableCell cell = (CheckBoxTreeTableCell) node;
    Callback selectedStateCallback = cell.getSelectedStateCallback();
    String cbText;
    if (selectedStateCallback != null) {
        ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
        int selection = call.getValue() ? 2 : 0;
        cbText = JavaFXCheckBoxElement.states[selection];
    } else {
        Node cb = cell.getGraphic();
        RFXComponent comp = getFinder().findRawRComponent(cb, null, null);
        cbText = comp._getValue();

    }
    return cbText;
}
 
Example #23
Source File: PageRangesColumn.java    From pdfsam with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public Callback<TableColumn<SelectionTableRowData, String>, TableCell<SelectionTableRowData, String>> cellFactory() {
    return new Callback<>() {
        @Override
        public TableCell<SelectionTableRowData, String> call(TableColumn<SelectionTableRowData, String> param) {
            return new TooltippedTextFieldTableCell(tooltipMessage);
        }
    };
}
 
Example #24
Source File: ImageValueEditor.java    From arma-dialog-creator with MIT License 5 votes vote down vote up
private void convertImage(File chosenFile) {
	ConvertImageTask task = new ConvertImageTask(chosenFile, new Callback<KeyValue<File, File>, Void>() {
		@Override
		public Void call(KeyValue<File, File> result) {
			setValue(new SVImage(
							result.getKey(), result.getValue()
					)
			);

			return null;
		}
	});
	task.start();
}
 
Example #25
Source File: AddModulePresenterTest.java    From WorkbenchFX with Apache License 2.0 5 votes vote down vote up
@BeforeEach
void setup() {
  mockCall = mock(Callback.class);
  when(mockCall.call(any())).thenReturn(null);

  mockBench = mock(Workbench.class);
  when(mockBench.getAmountOfPages()).thenReturn(1);
  when(mockBench.amountOfPagesProperty()).thenReturn(amountOfPages);
  when(mockBench.getPageFactory()).thenReturn(mockCall);

  mockView = mock(AddModuleView.class);
}
 
Example #26
Source File: PaginationSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public PaginationSample() {
    VBox outerBox = new VBox();
    outerBox.setAlignment(Pos.CENTER);
    //Images for our pages
    for (int i = 0; i < 7; i++) {
        images[i] = new Image(PaginationSample.class.getResource("animal" + (i + 1) + ".jpg").toExternalForm(), false);
    }

    pagination = PaginationBuilder.create().pageCount(7).pageFactory(new Callback<Integer, Node>() {           
        @Override public Node call(Integer pageIndex) {
            return createAnimalPage(pageIndex);
        }
    }).build();
    //Style can be numeric page indicators or bullet indicators
    Button styleButton = ButtonBuilder.create().text("Toggle pagination style").onAction(new EventHandler<ActionEvent>() {
        public void handle(ActionEvent me) {
            if (!pagination.getStyleClass().contains(Pagination.STYLE_CLASS_BULLET)) {
                pagination.getStyleClass().add(Pagination.STYLE_CLASS_BULLET);
            } else {
                pagination.getStyleClass().remove(Pagination.STYLE_CLASS_BULLET);
            }
        }
    }).build();

    outerBox.getChildren().addAll(pagination, styleButton);
    getChildren().add(outerBox);
}
 
Example #27
Source File: TransactionsView.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
private void setDateColumnCellFactory() {
    dateColumn.getStyleClass().add("first-column");
    dateColumn.setCellValueFactory((addressListItem) ->
            new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    dateColumn.setMaxWidth(200);
    dateColumn.setMinWidth(dateColumn.getMaxWidth());
    dateColumn.setCellFactory(
            new Callback<>() {

                @Override
                public TableCell<TransactionsListItem, TransactionsListItem> call(TableColumn<TransactionsListItem,
                        TransactionsListItem> column) {
                    return new TableCell<>() {

                        @Override
                        public void updateItem(final TransactionsListItem item, boolean empty) {
                            super.updateItem(item, empty);

                            if (item != null && !empty) {
                                setGraphic(new AutoTooltipLabel(item.getDateString()));
                            } else {
                                setGraphic(null);
                            }
                        }
                    };
                }
            });
}
 
Example #28
Source File: PropertyPanel.java    From phoebus with Eclipse Public License 1.0 5 votes vote down vote up
/** Add a tool tip to table column
 *
 *  <p>Needs to add the tool tip to each table cell in that column,
 *  which is done by wrapping the cell factory.
 *  This means that the table cell factory must be set before
 *  calling this method.
 *
 *  @param col {@link TableColumn}. Table cell factory must be set!
 *  @param text Text to show in tooltip
 */
static <S, T> void addTooltip(final TableColumn<S, T> col, final String text)
{
    final Callback<TableColumn<S,T>, TableCell<S,T>>  orig = col.getCellFactory();
    col.setCellFactory(c ->
    {
        final TableCell<S, T> cell = orig.call(c);
        cell.setTooltip(new Tooltip(text));
        return cell;
    });
}
 
Example #29
Source File: ListImageCheckBoxCell.java    From MyBox with Apache License 2.0 5 votes vote down vote up
private void init() {
    view = new ImageView();
    view.setPreserveRatio(true);
    view.setFitHeight(imageSize);
    rect = new Rectangle();
    rect.setWidth(40);
    rect.setHeight(40);
    Callback<ImageItem, ObservableValue<Boolean>> itemToBoolean
            = (ImageItem item) -> item.getSelected();
    setSelectedStateCallback(itemToBoolean);
}
 
Example #30
Source File: PaginationFrame.java    From oim-fx with MIT License 5 votes vote down vote up
private void initEvent() {
	p.setPageFactory(new Callback<Integer, Node>() {

		@Override
		public Node call(Integer index) {
			System.out.println(index);
			return new Label("第" + index + "页");
		}
	});
}