List of usage examples for javafx.scene.control Tooltip Tooltip
public Tooltip(String text)
From source file:gov.va.isaac.sync.view.SyncView.java
private void initGui() { root_ = new BorderPane(); root_.setPrefWidth(550);/*ww w.j ava 2s . com*/ VBox titleBox = new VBox(); Label title = new Label("Datastore Synchronization"); title.getStyleClass().add("titleLabel"); title.setAlignment(Pos.CENTER); title.setMaxWidth(Double.MAX_VALUE); title.setPadding(new Insets(10)); titleBox.getChildren().add(title); titleBox.getStyleClass().add("headerBackground"); url_ = AppContext.getAppConfiguration().getCurrentChangeSetUrl(); String urlType = AppContext.getAppConfiguration().getChangeSetUrlTypeName(); String syncUsername = ExtendedAppContext.getCurrentlyLoggedInUserProfile().getSyncUsername(); if (StringUtils.isBlank(syncUsername)) { syncUsername = ExtendedAppContext.getCurrentlyLoggedInUser(); } url_ = syncService_.substituteURL(url_, syncUsername); Label info = new CopyableLabel("Sync using " + urlType + ": " + url_); info.setTooltip(new Tooltip(url_)); titleBox.getChildren().add(info); titleBox.setPadding(new Insets(5, 5, 5, 5)); root_.setTop(titleBox); VBox centerContent = new VBox(); centerContent.setFillWidth(true); centerContent.setPrefWidth(Double.MAX_VALUE); centerContent.setPadding(new Insets(10)); centerContent.getStyleClass().add("itemBorder"); centerContent.setSpacing(10.0); centerContent.getChildren().add(new Label("Status:")); summary_ = new TextArea(); summary_.setWrapText(true); summary_.setEditable(false); summary_.setMaxWidth(Double.MAX_VALUE); summary_.setMaxHeight(Double.MAX_VALUE); summary_.setPrefHeight(150.0); centerContent.getChildren().add(summary_); VBox.setVgrow(summary_, Priority.ALWAYS); pb_ = new ProgressBar(0.0); pb_.setPrefHeight(20); pb_.setMaxWidth(Double.MAX_VALUE); centerContent.getChildren().add(pb_); root_.setCenter(centerContent); //Bottom buttons HBox buttons = new HBox(); buttons.setMaxWidth(Double.MAX_VALUE); buttons.setAlignment(Pos.CENTER); buttons.setPadding(new Insets(5)); buttons.setSpacing(30); Button cancel = new Button("Close"); cancel.setOnAction((action) -> { if (running_.get()) { addLine("Cancelling..."); cancel.setDisable(true); cancelRequested_ = true; } else { cancel.getScene().getWindow().hide(); root_ = null; } }); buttons.getChildren().add(cancel); Button action = new Button("Synchronize"); action.disableProperty().bind(running_); action.setOnAction((theAction) -> { summary_.setText(""); pb_.setProgress(-1.0); running_.set(true); Utility.execute(() -> sync()); }); buttons.getChildren().add(action); cancel.minWidthProperty().bind(action.widthProperty()); running_.addListener(change -> { if (running_.get()) { cancel.setText("Cancel"); } else { cancel.setText("Close"); } cancel.setDisable(false); }); root_.setBottom(buttons); }
From source file:org.pdfsam.ui.dashboard.preference.PreferenceConfig.java
@Bean(name = "checkForUpdates") public PreferenceCheckBox checkForUpdates() { PreferenceCheckBox checkForUpdates = new PreferenceCheckBox(BooleanUserPreference.CHECK_UPDATES, DefaultI18nContext.getInstance().i18n("Check for updates at startup"), userContext.isCheckForUpdates(), userContext); checkForUpdates.setId("checkForUpdates"); checkForUpdates.setTooltip(new Tooltip(DefaultI18nContext.getInstance() .i18n("Set whether new version availability should be checked on startup (restart needed)"))); checkForUpdates.getStyleClass().add("spaced-vitem"); return checkForUpdates; }
From source file:dsfixgui.view.DSFSavesPane.java
private void initialize() { //Basic layout this.setFitToWidth(true); spacerColumn = new ColumnConstraints(); spacerColumn.setFillWidth(true);// w ww . jav a 2s . co m spacerColumn.setPercentWidth(3.0); primaryColumn = new ColumnConstraints(); primaryColumn.setFillWidth(true); primaryColumn.setPercentWidth(95.0); primaryPane = new GridPane(); primaryPane.getColumnConstraints().addAll(spacerColumn, primaryColumn); primaryVBox = new VBox(); primaryVBox.getStyleClass().add("spacing_15"); primaryPane.add(primaryVBox, 1, 0); titleLabel = new Label(SAVE_BACKUP.toUpperCase() + " " + SETTINGS.toUpperCase()); titleLabel.getStyleClass().add("settings_title"); titleBar = new HBox(); titleBar.setAlignment(Pos.CENTER); titleBar.getChildren().add(titleLabel); restoreDefaultsBar = new HBox(); restoreDefaultsBar.setAlignment(Pos.CENTER); restoreDefaultsBar.setSpacing(5.0); applySettingsButton = new Button(APPLY_SETTINGS); restoreDefaultsButton = new Button(RESTORE_DEFAULTS); applySettingsButton.getStyleClass().add("translate_y_4"); restoreDefaultsButton.getStyleClass().add("translate_y_4"); restoreDefaultsBar.getChildren().addAll(applySettingsButton, restoreDefaultsButton); spacerHBox = new HBox(); spacerHBox.setMinHeight(10.0); bottomSpacerHBox = new HBox(); bottomSpacerHBox.setMinHeight(10.0); /////////////////////SETTINGS PANES///////////////////// // // //Toggle Save Backups saveBackupsPane = new FlowPane(); saveBackupsPane.getStyleClass().add("settings_pane"); saveBackupsLabel = new Label(SAVE_BACKUPS_LABEL + " "); saveBackupsLabel.getStyleClass().addAll("bold_text", "font_12_pt"); saveBackupsPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE)); if (config.enableBackups.get() == 0) { saveBackupsPicker.setValue(saveBackupsPicker.getItems().get(0)); } else { saveBackupsPicker.setValue(saveBackupsPicker.getItems().get(1)); } saveBackupsPane.getChildren().addAll(saveBackupsLabel, saveBackupsPicker); // //Save Backup Interval saveIntervalPane = new FlowPane(); saveIntervalPane.getStyleClass().add("settings_pane"); saveIntervalLabel = new Label(SAVE_BACKUPS_INTERVAL_LABEL + " "); saveIntervalLabel.getStyleClass().addAll("bold_text", "font_12_pt"); saveIntervalLabel.setTooltip(new Tooltip(SAVE_INTERVAL_TT)); saveIntervalField = new TextField("" + config.backupInterval.get()); saveIntervalField.getStyleClass().add("settings_text_field"); saveIntervalPane.getChildren().addAll(saveIntervalLabel, saveIntervalField); // //Max Save Backups maxSavesPane = new FlowPane(); maxSavesPane.getStyleClass().add("settings_pane"); maxSavesLabel = new Label(MAX_BACKUPS_LABEL + " "); maxSavesLabel.getStyleClass().addAll("bold_text", "font_12_pt"); maxSavesField = new TextField("" + config.maxBackups.get()); maxSavesField.getStyleClass().add("settings_text_field"); maxSavesPane.getChildren().addAll(maxSavesLabel, maxSavesField); if (config.enableBackups.get() == 0) { saveIntervalField.setDisable(true); maxSavesField.setDisable(true); } primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, saveBackupsPane, saveIntervalPane, maxSavesPane, bottomSpacerHBox); initializeEventHandlers(); this.setContent(primaryPane); }
From source file:Main.java
private static Node createLoginPanel() { final ToggleGroup toggleGroup = new ToggleGroup(); final TextField textField = new TextField(); textField.setPrefColumnCount(10);/*from ww w.j a v a2s . com*/ textField.setPromptText("Your name"); final PasswordField passwordField = new PasswordField(); passwordField.setPrefColumnCount(10); passwordField.setPromptText("Your password"); final ChoiceBox<String> choiceBox = new ChoiceBox<String>(FXCollections.observableArrayList("English", "\u0420\u0443\u0441\u0441\u043a\u0438\u0439", "Fran\u00E7ais")); choiceBox.setTooltip(new Tooltip("Your language")); choiceBox.getSelectionModel().select(0); final HBox panel = createHBox(6, createVBox(2, createRadioButton("High", toggleGroup, true), createRadioButton("Medium", toggleGroup, false), createRadioButton("Low", toggleGroup, false)), createVBox(2, textField, passwordField), choiceBox); panel.setAlignment(Pos.BOTTOM_LEFT); configureBorder(panel); return panel; }
From source file:com.esri.geoevent.test.performance.ui.OrchestratorController.java
@Override public void initialize(URL location, ResourceBundle resources) { titleLabel.setText(Mode.Orchestrator.toString()); fileMenu.setText(UIMessages.getMessage("UI_FILE_MENU_LABEL")); fileOpenMenuItem.setText(UIMessages.getMessage("UI_FILE_OPEN_MENU_ITEM_LABEL")); fileSaveMenuItem.setText(UIMessages.getMessage("UI_FILE_SAVE_MENU_ITEM_LABEL")); optionsMenu.setText(UIMessages.getMessage("UI_OPTIONS_MENU_LABEL")); optionsLoggerMenuItem.setText(UIMessages.getMessage("UI_OPTIONS_LOGGER_MENU_ITEM_LABEL")); optionsReportMenuItem.setText(UIMessages.getMessage("UI_OPTIONS_REPORT_MENU_ITEM_LABEL")); helpMenu.setText(UIMessages.getMessage("UI_HELP_MENU_LABEL")); helpAboutMenuItem.setText(UIMessages.getMessage("UI_HELP_ABOUT_MENU_ITEM_LABEL")); addFixtureBtn.setTooltip(new Tooltip(UIMessages.getMessage("UI_ADD_FIXTURE_DESC"))); startBtn.setText(UIMessages.getMessage("UI_START_BTN_LABEL")); startBtn.setTooltip(new Tooltip(UIMessages.getMessage("UI_START_BTN_DESC"))); //TODO: We need use this to show status messages statusLabel.setText("This is where the status changes will be placed."); // setup/*from ww w .jav a 2s . c om*/ setupTabs(); redirectSystemOutAndErrToTextArea(); }
From source file:org.pdfsam.ui.dashboard.preference.PreferenceConfig.java
@Bean(name = "playSounds") public PreferenceCheckBox playSounds() { PreferenceCheckBox playSounds = new PreferenceCheckBox(BooleanUserPreference.PLAY_SOUNDS, DefaultI18nContext.getInstance().i18n("Play alert sounds"), userContext.isPlaySounds(), userContext);/*ww w . j a v a2 s . c o m*/ playSounds.setId("playSounds"); playSounds.setTooltip(new Tooltip(DefaultI18nContext.getInstance().i18n("Turn on or off alert sounds"))); playSounds.getStyleClass().add("spaced-vitem"); return playSounds; }
From source file:dsfixgui.view.DSFHudPane.java
private void initialize() { //Basic layout this.setFitToWidth(true); spacerColumn = new ColumnConstraints(); spacerColumn.setFillWidth(true);/*www .j a v a 2 s .c o m*/ spacerColumn.setPercentWidth(3.0); primaryColumn = new ColumnConstraints(); primaryColumn.setFillWidth(true); primaryColumn.setPercentWidth(95.0); primaryPane = new GridPane(); primaryPane.getColumnConstraints().addAll(spacerColumn, primaryColumn); primaryVBox = new VBox(); primaryVBox.getStyleClass().add("spacing_15"); primaryPane.add(primaryVBox, 1, 0); titleLabel = new Label(HUD.toUpperCase() + " " + SETTINGS.toUpperCase()); titleLabel.getStyleClass().add("settings_title"); titleBar = new HBox(); titleBar.setAlignment(Pos.CENTER); titleBar.getChildren().add(titleLabel); restoreDefaultsBar = new HBox(); restoreDefaultsBar.setAlignment(Pos.CENTER); restoreDefaultsBar.setSpacing(5.0); applySettingsButton = new Button(APPLY_SETTINGS); restoreDefaultsButton = new Button(RESTORE_DEFAULTS); applySettingsButton.getStyleClass().add("translate_y_4"); restoreDefaultsButton.getStyleClass().add("translate_y_4"); restoreDefaultsBar.getChildren().addAll(applySettingsButton, restoreDefaultsButton); spacerHBox = new HBox(); spacerHBox.setMinHeight(10.0); bottomSpacerHBox = new HBox(); bottomSpacerHBox.setMinHeight(10.0); /////////////////////SETTINGS PANES///////////////////// // // //Toggle HUD Modifications hudModsPane = new FlowPane(); hudModsPane.getStyleClass().add("settings_pane"); hudModsLabel = new Label(HUD_MODS_LABEL + " "); hudModsLabel.getStyleClass().addAll("bold_text", "font_12_pt"); hudModsLabel.setTooltip(new Tooltip(HUD_MODS_TT)); hudModsPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE)); if (config.enableHudMod.get() == 0) { hudModsPicker.setValue(hudModsPicker.getItems().get(0)); } else { hudModsPicker.setValue(hudModsPicker.getItems().get(1)); } hudModsPane.getChildren().addAll(hudModsLabel, hudModsPicker); // //Minimal HUD minimalHUDPane = new FlowPane(); minimalHUDPane.getStyleClass().add("settings_pane"); minimalHUDLabel = new Label(MINIMAL_HUD_LABEL + " "); minimalHUDLabel.getStyleClass().addAll("bold_text", "font_12_pt"); minimalHUDLabel.setTooltip(new Tooltip(MIN_HUD_TT)); minimalHUDPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE)); if (config.enableMinimalHud.get() == 0) { minimalHUDPicker.setValue(minimalHUDPicker.getItems().get(0)); } else { minimalHUDPicker.setValue(minimalHUDPicker.getItems().get(1)); } minimalHUDPane.getChildren().addAll(minimalHUDLabel, minimalHUDPicker); // //HUD Scale hudScalePane = new FlowPane(); hudScalePane.getStyleClass().add("settings_pane"); hudScaleLabel = new Label(HUD_SCALE_LABEL + " "); hudScaleLabel.getStyleClass().addAll("bold_text", "font_12_pt"); hudScaleLabel.setTooltip(new Tooltip(HUD_SCALE_TT)); hudScaleField = new TextField(config.hudScaleFactor.toString()); hudScaleField.getStyleClass().add("settings_med_text_field"); hudScalePane.getChildren().addAll(hudScaleLabel, hudScaleField); // //HUD Opacities Parent Label hudOpacitiesPane = new FlowPane(); hudOpacitiesPane.getStyleClass().add("settings_pane"); hudOpacitiesLabel = new Label(HUD_OPACITIES_LABEL + " "); hudOpacitiesLabel.getStyleClass().addAll("bold_text", "font_14_pt"); hudOpacitiesLabel.setTooltip(new Tooltip(HUD_OPS_TT)); hudOpacitiesPane.getChildren().addAll(hudOpacitiesLabel); // //Top Left HUD Opacity topLeftHUDOpPane = new FlowPane(); topLeftHUDOpPane.getStyleClass().add("settings_pane"); topLeftHUDOpLabel = new Label(TOP_LEFT_HUD_OP_LABEL + " "); topLeftHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt"); topLeftHUDOpLabel.setTooltip(new Tooltip(TOP_LEFT_HUD_TT)); topLeftHUDOpField = new TextField( config.hudTopLeftOpacity.toString().substring(0, config.hudTopLeftOpacity.length() - 1)); topLeftHUDOpField.getStyleClass().add("settings_med_text_field"); topLeftHUDOpPane.getChildren().addAll(topLeftHUDOpLabel, topLeftHUDOpField); // //Bottom Left HUD Opacity bottomLeftHUDOpPane = new FlowPane(); bottomLeftHUDOpPane.getStyleClass().add("settings_pane"); bottomLeftHUDOpLabel = new Label(BOTTOM_LEFT_HUD_OP_LABEL + " "); bottomLeftHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt"); bottomLeftHUDOpLabel.setTooltip(new Tooltip(BOTTOM_LEFT_HUD_TT)); bottomLeftHUDOpField = new TextField( config.hudBottomLeftOpacity.toString().substring(0, config.hudBottomLeftOpacity.length() - 1)); bottomLeftHUDOpField.getStyleClass().add("settings_med_text_field"); bottomLeftHUDOpPane.getChildren().addAll(bottomLeftHUDOpLabel, bottomLeftHUDOpField); // //Bottom Riht HUD Opacity bottomRightHUDOpPane = new FlowPane(); bottomRightHUDOpPane.getStyleClass().add("settings_pane"); bottomRightHUDOpLabel = new Label(BOTTOM_RIGHT_HUD_OP_LABEL + " "); bottomRightHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt"); bottomRightHUDOpLabel.setTooltip(new Tooltip(BOTTOM_RIGHT_HUD_TT)); bottomRightHUDOpField = new TextField( config.hudBottomRightOpacity.toString().substring(0, config.hudBottomRightOpacity.length() - 1)); bottomRightHUDOpField.getStyleClass().add("settings_med_text_field"); bottomRightHUDOpPane.getChildren().addAll(bottomRightHUDOpLabel, bottomRightHUDOpField); if (config.enableHudMod.get() == 0) { minimalHUDPicker.setDisable(true); hudScaleField.setDisable(true); topLeftHUDOpField.setDisable(true); bottomLeftHUDOpField.setDisable(true); bottomRightHUDOpField.setDisable(true); } primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, hudModsPane, minimalHUDPane, hudScalePane, hudOpacitiesPane, topLeftHUDOpPane, bottomLeftHUDOpPane, bottomRightHUDOpPane, bottomSpacerHBox); initializeEventHandlers(); this.setContent(primaryPane); }
From source file:dpfmanager.shell.interfaces.gui.fragment.wizard.Wizard1Fragment.java
private void addCheckBox(String id, String name, String path, boolean selected, boolean delete) { HBox hbox = new HBox(); hbox.setAlignment(Pos.CENTER_LEFT);//from w ww . j av a 2 s .c o m CheckBox chk = new CheckBox(name); chk.setId(id); chk.getStyleClass().add("checkreport"); chk.setSelected(selected); chk.setEllipsisString(" ... "); chk.setTextOverrun(OverrunStyle.CENTER_ELLIPSIS); chk.setTooltip(new Tooltip(path)); hbox.getChildren().add(chk); // EDIT Button edit = new Button(); edit.getStyleClass().addAll("edit-img", "action-img-16"); edit.setCursor(Cursor.HAND); edit.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { String iso = chk.getId(); String path = null; if (iso.startsWith("external")) { iso = chk.getText(); path = iso; } else if (chk.getId().startsWith("config")) { iso = chk.getId().replace("config", ""); path = DPFManagerProperties.getIsosDir() + "/" + iso; } controller.editIso(iso, path); } }); hbox.getChildren().add(edit); HBox.setMargin(edit, new Insets(0, 0, 0, 10)); // DELETE if (delete) { Button icon = new Button(); icon.getStyleClass().addAll("delete-img", "action-img-16"); icon.setCursor(Cursor.HAND); icon.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { if (chk.getId().startsWith("external")) { // Only from gui vboxRadios.getChildren().remove(hbox); } else if (chk.getId().startsWith("config")) { // From system String name = chk.getId().replace("config", ""); File file = new File(DPFManagerProperties.getIsosDir() + "/" + name); if (file.exists() && file.isFile() && acceptDelete(file)) { file.delete(); vboxRadios.getChildren().remove(hbox); } } } }); hbox.getChildren().add(icon); HBox.setMargin(icon, new Insets(0, 0, 0, 10)); } vboxRadios.getChildren().add(hbox); }
From source file:cz.lbenda.gui.controls.TextAreaFrmController.java
/** Create button which can open text editor */ public static Button createOpenButton(String windowTitle, @Nonnull Supplier<String> oldValueSupplier, @Nonnull Consumer<String> newValueConsumer) { String title = windowTitle == null ? msgDefaultWindowTitle : windowTitle; Button result = new Button(null, new ImageView(BUTTON_IMAGE)); result.setTooltip(new Tooltip(msgBtnOpenInEditor_tooltip)); BorderPane.setAlignment(result, Pos.TOP_RIGHT); result.setOnAction(event -> {//from w ww. ja v a2 s. com Tuple2<Parent, TextAreaFrmController> tuple2 = TextAreaFrmController.createNewInstance(); tuple2.get2().textProperty().setValue(oldValueSupplier.get()); tuple2.get2().textProperty() .addListener((observable, oldValue, newValue) -> newValueConsumer.accept(newValue)); Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow(); DialogHelper.getInstance().openWindowInCenterOfStage(stage, tuple2.get2().getMainPane(), title); }); return result; }
From source file:com.wineshop.client.Home.java
@Override public void initialize(URL url, ResourceBundle bundle) { // Setup of the table view vineyards.setSortAdapter(new TableViewSortAdapter<Vineyard>(tableVineyards, Vineyard.class)); vineyards.getFilter().nameProperty().bindBidirectional(fieldSearch.textProperty()); // Setup of the creation/edit form labelFormVineyard.textProperty()//from w w w .ja v a2 s . c o m .bind(Bindings.when(vineyard.savedProperty()).then("Edit vineyard").otherwise("Create vineyard")); vineyard.instanceProperty().addListener(new ChangeListener<Vineyard>() { @Override public void changed(ObservableValue<? extends Vineyard> observable, Vineyard oldValue, Vineyard newValue) { if (oldValue != null) { fieldName.textProperty().unbindBidirectional(oldValue.nameProperty()); fieldAddress.textProperty().unbindBidirectional(oldValue.getAddress().addressProperty()); listWines.setItems(null); } if (newValue != null) { fieldName.textProperty().bindBidirectional(newValue.nameProperty()); fieldAddress.textProperty().bindBidirectional(newValue.getAddress().addressProperty()); listWines.setItems(newValue.getWines()); } } }); // Define the cell factory for the list of wines listWines.setCellFactory(new Callback<ListView<Wine>, ListCell<Wine>>() { public ListCell<Wine> call(ListView<Wine> listView) { return new WineListCell(); } }); buttonDelete.visibleProperty().bind(vineyard.savedProperty()); buttonDelete.disableProperty().bind(Bindings.not(identity.ifAllGranted("ROLE_ADMIN"))); buttonSave.disableProperty().bind(Bindings.not(vineyard.dirtyProperty())); buttonCancel.disableProperty() .bind(Bindings.not(Bindings.or(vineyard.savedProperty(), vineyard.dirtyProperty()))); // Link the table selection and the entity instance in the form select(null); tableVineyards.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Vineyard>() { @Override public void changed(ObservableValue<? extends Vineyard> property, Vineyard oldSelection, Vineyard newSelection) { select(newSelection); } }); formVineyard.addEventHandler(ValidationResultEvent.INVALID, new EventHandler<ValidationResultEvent>() { @Override public void handle(ValidationResultEvent event) { ((Node) event.getTarget()).setStyle("-fx-border-color: red"); if (event.getTarget() instanceof TextInputControl && event.getErrorResults() != null && event.getErrorResults().size() > 0) { Tooltip tooltip = new Tooltip(event.getErrorResults().get(0).getMessage()); tooltip.setAutoHide(true); ((TextInputControl) event.getTarget()).setTooltip(tooltip); } } }); formVineyard.addEventHandler(ValidationResultEvent.VALID, new EventHandler<ValidationResultEvent>() { @Override public void handle(ValidationResultEvent event) { ((Node) event.getTarget()).setStyle("-fx-border-color: null"); if (event.getTarget() instanceof TextInputControl) { Tooltip tooltip = ((TextInputControl) event.getTarget()).getTooltip(); if (tooltip != null && tooltip.isActivated()) tooltip.hide(); ((TextInputControl) event.getTarget()).setTooltip(null); } } }); }