Example usage for javafx.scene.control Tooltip Tooltip

List of usage examples for javafx.scene.control Tooltip Tooltip

Introduction

In this page you can find the example usage for javafx.scene.control Tooltip Tooltip.

Prototype

public Tooltip(String text) 

Source Link

Document

Creates a tooltip with the specified text.

Usage

From source file:org.apache.cayenne.modeler.layout.MainToolBarLayout.java

private void setToolTips() {
    newButton.setTooltip(new Tooltip("Create a new Cayenne Model project."));
    openButton.setTooltip(new Tooltip("Open an existing Cayenne Model project."));
    saveButton.setTooltip(new Tooltip("Save this Cayenne Model project."));

    removeButton.setTooltip(new Tooltip("Remove this item.")); // FIXME: Should be dynamic.

    cutButton.setTooltip(new Tooltip("Cut this item to the clipboard.")); // FIXME: Should be dynamic.
    copyButton.setTooltip(new Tooltip("Copy this item to the clipboard.")); // FIXME: Should be dynamic.
    pasteButton.setTooltip(new Tooltip("Paste this item from the clipboard.")); // FIXME: Should be dynamic.

    undoButton.setTooltip(new Tooltip("Undo.")); // FIXME: Should be dynamic.
    redoButton.setTooltip(new Tooltip("Redo.")); // FIXME: Should be dynamic.

    dataMapButton.setTooltip(new Tooltip("Create a new Data Map to hold Java and Database definitions."));
    dataNodeButton.setTooltip(new Tooltip("Create a new Data Node to hold database connection settings."));
}

From source file:org.beryx.viewreka.fxapp.ProjectLibs.java

@Override
public void initialize(URL location, ResourceBundle resources) {
    check("lstLib", lstLib);
    check("butBundleAdd", butBundleAdd);
    check("butUncatalogedLibAdd", butUncatalogedLibAdd);
    check("butLibRemove", butLibRemove);
    check("lstExistingLib", lstExistingLib);

    lstLib.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    BooleanBinding libRemoveBinding = Bindings.createBooleanBinding(() -> lstLib.getSelectionModel().isEmpty(),
            lstLib.getSelectionModel().selectedItemProperty());
    butLibRemove.disableProperty().bind(libRemoveBinding);

    lstLib.setCellFactory(new Callback<ListView<LibListEntry>, ListCell<LibListEntry>>() {
        @Override/*  w  w w  . j  a v a2s . com*/
        public ListCell<LibListEntry> call(ListView<LibListEntry> entry) {
            return new ListCell<LibListEntry>() {
                @Override
                public void updateItem(LibListEntry item, boolean empty) {
                    super.updateItem(item, empty);
                    if (empty || item == null) {
                        setText(null);
                        setGraphic(null);
                    } else {
                        setText(item.getCellText());
                        String tooltipText = item.getTooltipText();
                        if (tooltipText != null && !tooltipText.isEmpty()) {
                            setTooltip(new Tooltip(tooltipText));
                        }
                    }
                }
            };
        }
    });
}

From source file:org.jacp.demo.perspectives.ContactPerspective.java

@PostConstruct
/**/*from ww  w. ja  v  a  2  s. c o m*/
 * create buttons in tool bars; menu entries
 */
public void PostConstructPerspective(final FXComponentLayout layout, final ResourceBundle resourceBundle) {
    LOGGER.debug("PostConstructPerspective ressource:" + resourceBundle);
    // create button in toolbar; button should switch top and bottom id's
    final JACPToolBar north = layout.getRegisteredToolBar(NORTH);
    final JACPToolBar south = layout.getRegisteredToolBar(SOUTH);
    final JACPToolBar west = layout.getRegisteredToolBar(WEST);
    final JACPToolBar east = layout.getRegisteredToolBar(EAST);

    final Button custom = new Button("switch");
    custom.setTooltip(new Tooltip("Switch Components"));
    custom.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(final ActionEvent e) {
            context.send(SWITCH_MESSAGE);

        }
    });
    north.addOnEnd(context.getId(), custom);

    // TEST OPTIONBUTTON ON NORTH
    north.addOnEnd(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, BOTTOM, 10));
    north.addToCenter(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, BOTTOM, 10));
    north.add(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, BOTTOM, 10));
    west.add(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, RIGHT));
    west.addToCenter(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, RIGHT));
    west.addOnEnd(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("another Button", layout, RIGHT));
    east.addOnEnd(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("right Button", layout, LEFT));
    east.add(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("right Button", layout, LEFT));
    east.addToCenter(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("right Button", layout, LEFT));
    south.add(context.getId(), JACPOptionButtonCreator.createDefaultOptionButton("bottom Button", layout, TOP));
    south.addToCenter(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("bottom Button", layout, TOP));
    south.addOnEnd(context.getId(),
            JACPOptionButtonCreator.createDefaultOptionButton("bottom Button", layout, TOP));

    JACPHoverMenu menu = new JACPHoverMenu("Hovermenu", layout);

    VBox p = new VBox();
    p.setPadding(new Insets(10));
    Button b = new Button("HELLO");
    CheckBox check = new CheckBox("checkbox");

    p.getChildren().addAll(b, check);

    ColorPicker picker = new ColorPicker();
    menu.getContentPane().getChildren().add(p);

    north.addToCenter(context.getId(), menu);
    north.addToCenter(context.getId(), picker);

}

From source file:org.pdfsam.merge.MergeOptionsPane.java

MergeOptionsPane() {
    super(5);//from   w ww.  j  a  v a  2  s.  c  o m
    this.containsForms = new CheckBox(DefaultI18nContext.getInstance().i18n("Merge form fields"));
    this.containsForms.setId("containsFormCheck");
    this.containsForms.setTooltip(new Tooltip(DefaultI18nContext.getInstance()
            .i18n("Some of the selected PDF documents contain forms, merge them")));
    this.blankIfOdd = new CheckBox(
            DefaultI18nContext.getInstance().i18n("Add a blank page if page number is odd"));
    this.blankIfOdd.setId("blankIfOddCheck");
    this.blankIfOdd.setTooltip(new Tooltip(DefaultI18nContext.getInstance()
            .i18n("Adds a blank page after each merged document if the document has an odd number of pages")));

    outline.getItems()
            .add(keyValue(OutlinePolicy.RETAIN, DefaultI18nContext.getInstance().i18n("Retain bookmarks")));
    outline.getItems()
            .add(keyValue(OutlinePolicy.DISCARD, DefaultI18nContext.getInstance().i18n("Discard bookmarks")));
    outline.getItems().add(keyValue(OutlinePolicy.ONE_ENTRY_EACH_DOC,
            DefaultI18nContext.getInstance().i18n("Create one entry for each merged document")));
    outline.getSelectionModel().selectFirst();
    outline.setId("outlineCombo");

    HBox bookmarksPolicy = new HBox(new Label(DefaultI18nContext.getInstance().i18n("Bookmarks handling:")),
            outline);
    bookmarksPolicy.getStyleClass().addAll(Style.VITEM.css());
    bookmarksPolicy.getStyleClass().addAll(Style.HCONTAINER.css());

    getStyleClass().addAll(Style.CONTAINER.css());
    getChildren().addAll(this.containsForms, this.blankIfOdd, bookmarksPolicy);
}

From source file:org.pdfsam.split.SplitAfterPredefinedSetOfPagesRadioButton.java

public SplitAfterPredefinedSetOfPagesRadioButton(ComboBox<KeyStringValueItem<PredefinedSetOfPages>> combo) {
    super(DefaultI18nContext.getInstance().i18n("Split after"));
    this.combo = combo;
    combo.getSelectionModel().selectFirst();
    setTooltip(new Tooltip(
            DefaultI18nContext.getInstance().i18n("Split the document after the given page numbers")));
}

From source file:org.pdfsam.split.SplitAfterRadioButton.java

public SplitAfterRadioButton(ValidableTextField field) {
    super(DefaultI18nContext.getInstance().i18n("Split after the following page numbers"));
    this.field = field;
    this.field.setOnEnterValidation(true);
    this.field.setEnableInvalidStyle(true);
    this.field.setPromptText(DefaultI18nContext.getInstance().i18n("Page numbers to split at (n1,n2,n3..)"));
    setTooltip(new Tooltip(
            DefaultI18nContext.getInstance().i18n("Split the document after the given page numbers")));
    this.field.setValidator(Validators.newRegexMatchingString("^([0-9]+,?)+$"));
    this.field.setErrorMessage(DefaultI18nContext.getInstance().i18n("Invalid page numbers"));
}

From source file:org.pdfsam.split.SplitByEveryRadioButton.java

public SplitByEveryRadioButton(ValidableTextField field) {
    super(DefaultI18nContext.getInstance().i18n("Split by every \"n\" pages"));
    this.field = field;
    this.field.setOnEnterValidation(true);
    this.field.setEnableInvalidStyle(true);
    this.field.setPromptText(DefaultI18nContext.getInstance().i18n("Number of pages"));
    setTooltip(new Tooltip(DefaultI18nContext.getInstance()
            .i18n("Splits the pdf every \"n\" pages creating documents of \"n\" pages each")));
    this.field.setValidator(Validators.newRegexMatchingString("^(\\d)+$"));
    this.field.setErrorMessage(DefaultI18nContext.getInstance().i18n("Invalid number of pages"));
}

From source file:org.pdfsam.splitbybookmarks.BookmarksLevelComboBox.java

BookmarksLevelComboBox() {
    validationSupport.setValidator(Validators.newPositiveIntegerString());
    setEditable(true);//from w w w  .  ja v a  2 s . co m
    getSelectionModel().selectFirst();
    valueProperty().addListener((o, oldVal, newVal) -> validate());
    setTooltip(new Tooltip(DefaultI18nContext.getInstance().i18n("Set the bookmarks level to split at")));
    validationSupport.validationStateProperty().addListener(o -> {
        if (validationSupport.validationStateProperty().get() == ValidationState.INVALID) {
            getEditor().getStyleClass().addAll(Style.INVALID.css());
        } else {
            getEditor().getStyleClass().removeAll(Style.INVALID.css());
        }
    });
}

From source file:org.pdfsam.ui.io.PdfVersionCombo.java

public PdfVersionCombo(String ownerModule) {
    this.ownerModule = ownerModule;

    Arrays.stream(PdfVersion.values()).filter(v -> v.getVersion() > 2).map(PdfVersionComboItem::new)
            .forEach(unfilteredItems::add);

    setCellFactory(new Callback<ListView<PdfVersionComboItem>, ListCell<PdfVersionComboItem>>() {
        @Override// w w w. ja  va  2  s .  c om
        public ListCell<PdfVersionComboItem> call(ListView<PdfVersionComboItem> p) {
            ListCell<PdfVersionComboItem> cell = new ListCell<PdfVersionComboItem>() {
                @Override
                protected void updateItem(PdfVersionComboItem item, boolean bln) {
                    super.updateItem(item, bln);
                    if (item != null) {
                        setText(item.toString());
                        if (item.sourceVersion) {
                            setTooltip(new Tooltip(
                                    DefaultI18nContext.getInstance().i18n("Same as the input document")));
                        }
                    }
                }
            };
            return cell;
        }
    });
    versionsFilter.requiredProperty().addListener((observable, oldVal, newVal) -> {
        PdfVersionComboItem selected = getSelectionModel().getSelectedItem();
        setItems(unfilteredItems.filtered(t -> t.isHigherOrEqual(newVal.intValue())));
        int selecedIndex = getItems().indexOf(selected);
        if (selecedIndex != -1) {
            getSelectionModel().select(selecedIndex);
        } else {
            getSelectionModel().selectLast();
        }
    });
    versionsFilter.addFilter(-1);
    getSelectionModel().selectLast();
    eventStudio().addAnnotatedListeners(this);
}

From source file:org.pdfsam.ui.io.PdfVersionConstrainedCheckBox.java

public PdfVersionConstrainedCheckBox(PdfVersion constraint, String ownerModule) {
    requireNotNull(constraint, "PdfVersion cannot be null");
    this.ownerModule = defaultString(ownerModule);
    this.constraint = constraint;
    setTooltip(new Tooltip(DefaultI18nContext.getInstance().i18n("Pdf version required: {0}",
            Double.toString(this.constraint.getVersionAsDouble()))));

    selectedProperty().addListener((o, oldVal, newVal) -> {
        if (newVal) {
            eventStudio().broadcast(new AddPdfVersionConstraintEvent(constraint), ownerModule);
        } else {//from w w w  . j  ava2 s .  c o  m
            eventStudio().broadcast(new RemovePdfVersionConstraintEvent(constraint), ownerModule);
        }
    });

    getStyleClass().addAll(Style.VITEM.css());
}