Search in sources :

Example 86 with Tooltip

use of javafx.scene.control.Tooltip in project jabref by JabRef.

the class ViewModelListCellFactory method call.

@Override
public ListCell<T> call(ListView<T> param) {
    return new ListCell<T>() {

        @Override
        protected void updateItem(T item, boolean empty) {
            super.updateItem(item, empty);
            T viewModel = getItem();
            if (empty || viewModel == null) {
                setText(null);
                setGraphic(null);
                setOnMouseClicked(null);
                setTooltip(null);
            } else {
                if (toText != null) {
                    setText(toText.call(viewModel));
                }
                if (toGraphic != null) {
                    setGraphic(toGraphic.call(viewModel));
                }
                if (toOnMouseClickedEvent != null) {
                    setOnMouseClicked(toOnMouseClickedEvent.call(viewModel));
                }
                if (toStyleClass != null) {
                    getStyleClass().setAll(toStyleClass.call(viewModel));
                }
                if (toTooltip != null) {
                    String tooltipText = toTooltip.call(viewModel);
                    if (StringUtil.isNotBlank(tooltipText)) {
                        setTooltip(new Tooltip(tooltipText));
                    }
                }
            }
            getListView().refresh();
        }
    };
}
Also used : ListCell(javafx.scene.control.ListCell) Tooltip(javafx.scene.control.Tooltip)

Example 87 with Tooltip

use of javafx.scene.control.Tooltip in project Gargoyle by callakrsos.

the class SystemLayoutViewController method loadNewSystemTab.

/**
	 * 탭에 대해 로드함.
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2015. 11. 4.
	 * @param tabName
	 * @param fxmlName
	 */
@Override
public void loadNewSystemTab(String tabName, String fxmlName) {
    Platform.runLater(() -> {
        try {
            FXMLLoader loader = FxUtil.createNewFxmlLoader();
            loader.setLocation(getClass().getResource(fxmlName));
            Parent parent = loader.load();
            if (beforeParentLoad != null && beforeParentLoad.filter(parent)) {
                beforeParentLoad.beforeLoad(parent);
                if (beforeParentLoad.isUnloadParent()) {
                    return;
                }
            }
            DockTab tab = new DockTab(tabName, parent);
            // 툴팁 처리 (클래스위치)
            tab.setTooltip(new Tooltip(loader.getController().getClass().getName()));
            addTabItem(tab);
            tab.getTabPane().getSelectionModel().select(tab);
            // 리스너 호출.
            onParentloaded.forEach(v -> {
                v.onLoad(parent);
            });
        } catch (IOException e1) {
            DialogUtil.showExceptionDailog(e1);
        }
    });
}
Also used : DockTab(com.kyj.fx.voeditor.visual.component.dock.tab.DockTab) Parent(javafx.scene.Parent) Tooltip(javafx.scene.control.Tooltip) IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader)

Example 88 with Tooltip

use of javafx.scene.control.Tooltip in project Gargoyle by callakrsos.

the class SystemLayoutViewController method loadNewSystemTab.

/********************************
	 * 작성일 : 2016. 4. 26. 작성자 : KYJ
	 *
	 * 새로운 탭을 로드한다.
	 *
	 * @param tableName
	 * @param parent
	 ********************************/
public void loadNewSystemTab(String tableName, CloseableParent<?> parent) {
    Platform.runLater(() -> {
        try {
            Parent _parent = parent.getParent();
            if (beforeParentLoad != null && beforeParentLoad.filter(_parent)) {
                beforeParentLoad.beforeLoad(_parent);
                if (beforeParentLoad.isUnloadParent()) {
                    return;
                }
            }
            DockTab tab = new DockTab(tableName, _parent);
            // 툴팁 처리 (클래스위치)
            tab.setTooltip(new Tooltip(parent.getClass().getName()));
            addTabItem(tab);
            tabPanWorkspace.getSelectionModel().select(tab);
            tab.setOnCloseRequest(ev -> {
                try {
                    LOGGER.debug("closeable parent on close request , tabName : {} ", tableName);
                    parent.close();
                } catch (Exception e) {
                    LOGGER.error(ValueUtil.toString(e));
                }
            });
            // 리스너 호출.
            onParentloaded.forEach(v -> v.onLoad(parent.getParent()));
            // tab.getTabPane().getSelectionModel().select(tab);
            // _parent.getScene().getStylesheets().clear();
            List<Node> findAllByNodes = FxUtil.findAllByNodes(_parent, n -> n instanceof Button);
            findAllByNodes.forEach(btn -> {
                btn.getStyleClass().add("button-gargoyle");
            });
        } catch (Exception e1) {
            DialogUtil.showExceptionDailog(e1);
        }
    });
}
Also used : DockTab(com.kyj.fx.voeditor.visual.component.dock.tab.DockTab) Parent(javafx.scene.Parent) Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip) Node(javafx.scene.Node) IOException(java.io.IOException) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException)

Example 89 with Tooltip

use of javafx.scene.control.Tooltip in project bitsquare by bitsquare.

the class PeerInfoIcon method updatePeerInfoIcon.

private void updatePeerInfoIcon() {
    String tag;
    if (peerTagMap.containsKey(hostName)) {
        tag = peerTagMap.get(hostName);
        Tooltip.install(this, new Tooltip(tooltipText + "\nTag: " + tag));
    } else {
        tag = "";
        Tooltip.install(this, new Tooltip(tooltipText));
    }
    if (!tag.isEmpty())
        tagLabel.setText(tag.substring(0, 1));
    if (numTrades < 10)
        numTradesLabel.setText(String.valueOf(numTrades));
    else
        numTradesLabel.setText("★");
    numTradesPane.setVisible(numTrades > 0);
    tagPane.setVisible(!tag.isEmpty());
}
Also used : Tooltip(javafx.scene.control.Tooltip)

Example 90 with Tooltip

use of javafx.scene.control.Tooltip in project bitsquare by bitsquare.

the class OKPayForm method addCurrenciesGrid.

private void addCurrenciesGrid(boolean isEditable) {
    Label label = addLabel(gridPane, ++gridRow, "Supported currencies:", 0);
    GridPane.setValignment(label, VPos.TOP);
    FlowPane flowPane = new FlowPane();
    flowPane.setPadding(new Insets(10, 10, 10, 10));
    flowPane.setVgap(10);
    flowPane.setHgap(10);
    if (isEditable)
        flowPane.setId("flow-pane-checkboxes-bg");
    else
        flowPane.setId("flow-pane-checkboxes-non-editable-bg");
    CurrencyUtil.getAllOKPayCurrencies().stream().forEach(e -> {
        CheckBox checkBox = new CheckBox(e.getCode());
        checkBox.setMouseTransparent(!isEditable);
        checkBox.setSelected(okPayAccount.getTradeCurrencies().contains(e));
        checkBox.setMinWidth(60);
        checkBox.setMaxWidth(checkBox.getMinWidth());
        checkBox.setTooltip(new Tooltip(e.getName()));
        checkBox.setOnAction(event -> {
            if (checkBox.isSelected())
                okPayAccount.addCurrency(e);
            else
                okPayAccount.removeCurrency(e);
            updateAllInputsValid();
        });
        flowPane.getChildren().add(checkBox);
    });
    GridPane.setRowIndex(flowPane, gridRow);
    GridPane.setColumnIndex(flowPane, 1);
    gridPane.getChildren().add(flowPane);
}
Also used : Insets(javafx.geometry.Insets) CheckBox(javafx.scene.control.CheckBox) Tooltip(javafx.scene.control.Tooltip) Label(javafx.scene.control.Label) FlowPane(javafx.scene.layout.FlowPane)

Aggregations

Tooltip (javafx.scene.control.Tooltip)173 Button (javafx.scene.control.Button)61 Label (javafx.scene.control.Label)51 Insets (javafx.geometry.Insets)38 ImageView (javafx.scene.image.ImageView)34 VBox (javafx.scene.layout.VBox)32 List (java.util.List)31 TableColumn (javafx.scene.control.TableColumn)29 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)28 FXML (javafx.fxml.FXML)27 TableCell (javafx.scene.control.TableCell)27 ObservableList (javafx.collections.ObservableList)26 Node (javafx.scene.Node)26 TableView (javafx.scene.control.TableView)26 ArrayList (java.util.ArrayList)25 Inject (javax.inject.Inject)25 Res (bisq.core.locale.Res)24 FxmlView (bisq.desktop.common.view.FxmlView)23 HyperlinkWithIcon (bisq.desktop.components.HyperlinkWithIcon)23 Collectors (java.util.stream.Collectors)23