Search in sources :

Example 66 with Tooltip

use of javafx.scene.control.Tooltip in project uPMT by coco35700.

the class TypeTreeViewControllerClass method initialize.

@Override
public void initialize(URL location, ResourceBundle resources) {
    nomType.setText(type.getType().getName());
    couleurType.setStyle("-fx-color-label-visible: false ;");
    setColor();
    Image icon = ResourceLoader.loadImage("class.gif");
    this.classIcon.setImage(icon);
    Node iconRename = new ImageView(ResourceLoader.loadImage("rename.png"));
    this.rename.setGraphic(iconRename);
    Node iconDelete = new ImageView(ResourceLoader.loadImage("delete.gif"));
    this.deleteClass.setGraphic(iconDelete);
    Node iconAddProp = new ImageView(ResourceLoader.loadImage("addProperty.gif"));
    this.addProperty.setGraphic(iconAddProp);
    Tooltip deleteClassTip = new Tooltip("Suppression de la classe");
    deleteClass.setTooltip(deleteClassTip);
    Tooltip addPropertyTip = new Tooltip("Ajout d'une propriet� a la classe");
    addProperty.setTooltip(addPropertyTip);
    Tooltip renameTip = new Tooltip("Renommer la classe");
    rename.setTooltip(renameTip);
}
Also used : Node(javafx.scene.Node) Tooltip(javafx.scene.control.Tooltip) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image)

Example 67 with Tooltip

use of javafx.scene.control.Tooltip in project uPMT by coco35700.

the class TypeTreeViewControllerRoot method initialize.

@Override
public void initialize(URL location, ResourceBundle resources) {
    nomType.setText(type.getType().getName());
    /*if(Main.activateBetaDesign)
			this.nomType.setTextFill(Color.BLACK);*/
    Image icon = ResourceLoader.loadImage("schema.gif");
    this.rootIcon.setImage(icon);
    Node iconRename = new ImageView(ResourceLoader.loadImage("rename.png"));
    this.rename.setGraphic(iconRename);
    Node iconAddClass = new ImageView(ResourceLoader.loadImage("addclass.gif"));
    this.addClass.setGraphic(iconAddClass);
    Node iconAddFold = new ImageView(ResourceLoader.loadImage("newfolder.gif"));
    this.addFolder.setGraphic(iconAddFold);
    Tooltip renameTip = new Tooltip("Renommer le sch�ma");
    rename.setTooltip(renameTip);
    Tooltip addClassTip = new Tooltip("Ajouter une Classe � la racine");
    addClass.setTooltip(addClassTip);
    Tooltip addFolderTip = new Tooltip("Ajouter un Dossier � la racine");
    addFolder.setTooltip(addFolderTip);
}
Also used : Node(javafx.scene.Node) Tooltip(javafx.scene.control.Tooltip) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image)

Example 68 with Tooltip

use of javafx.scene.control.Tooltip in project certmgr by hdecarne.

the class StoreController method setupStage.

@Override
protected void setupStage(Stage stage) {
    stage.getIcons().addAll(Images.STORE32, Images.STORE16);
    stage.setTitle(StoreI18N.formatSTR_STAGE_TITLE());
    this.cmdStorePreferences.disableProperty().bind(this.storeProperty.isNull());
    this.cmdCopyEntry.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
    this.cmdDeleteEntry.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
    this.cmdNewCert.disableProperty().bind(this.storeProperty.isNull());
    this.cmdRevokeCert.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
    this.cmdManageCRL.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
    this.cmdExportCert.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
    this.cmdImportCerts.disableProperty().bind(this.storeProperty.isNull());
    this.cmdStorePreferencesButton.disableProperty().bind(this.storeProperty.isNull());
    this.cmdCopyEntryButton.disableProperty().bind(this.cmdCopyEntry.disableProperty());
    this.cmdDeleteEntryButton.disableProperty().bind(this.cmdDeleteEntry.disableProperty());
    this.cmdNewCertButton.disableProperty().bind(this.cmdNewCert.disableProperty());
    this.cmdRevokeCertButton.disableProperty().bind(this.cmdRevokeCert.disableProperty());
    this.cmdManageCRLButton.disableProperty().bind(this.cmdManageCRL.disableProperty());
    this.cmdExportCertButton.disableProperty().bind(this.cmdExportCert.disableProperty());
    this.cmdImportCertsButton.disableProperty().bind(this.cmdImportCerts.disableProperty());
    ContextMenu storeEntryViewMenu = this.ctlStoreEntryView.getContextMenu();
    this.ctlStoreEntryView.setContextMenu(null);
    this.ctlStoreEntryView.setRowFactory(param -> {
        ContextMenu menu = storeEntryViewMenu;
        return new TreeTableRow<StoreEntryModel>() {

            @Override
            protected void updateItem(@Nullable StoreEntryModel item, boolean empty) {
                super.updateItem(item, empty);
                if (!empty) {
                    setContextMenu(menu);
                } else {
                    setContextMenu(null);
                }
            }
        };
    });
    Tooltip storeEntryViewTooltip = this.ctlStoreEntryView.getTooltip();
    this.ctlStoreEntryTooltipExternalCrt.managedProperty().bind(this.ctlStoreEntryTooltipExternalCrt.visibleProperty());
    this.ctlStoreEntryTooltipPublicCrt.managedProperty().bind(this.ctlStoreEntryTooltipPublicCrt.visibleProperty());
    this.ctlStoreEntryTooltipPrivateCrt.managedProperty().bind(this.ctlStoreEntryTooltipPrivateCrt.visibleProperty());
    this.ctlStoreEntryTooltipCsr.managedProperty().bind(this.ctlStoreEntryTooltipCsr.visibleProperty());
    this.ctlStoreEntryTooltipCrl.managedProperty().bind(this.ctlStoreEntryTooltipCrl.visibleProperty());
    this.ctlStoreEntryTooltipKey.managedProperty().bind(this.ctlStoreEntryTooltipKey.visibleProperty());
    this.ctlStoreEntryTooltipRevokedCrt.managedProperty().bind(this.ctlStoreEntryTooltipRevokedCrt.visibleProperty());
    this.ctlStoreEntryTooltipInvalidCrt.managedProperty().bind(this.ctlStoreEntryTooltipInvalidCrt.visibleProperty());
    this.ctlStoreEntryView.setTooltip(null);
    this.ctlStoreEntryViewId.setCellFactory(param -> {
        return new TreeTableCell<StoreEntryModel, String>() {

            Tooltip tooltip = storeEntryViewTooltip;

            @Override
            protected void updateItem(@Nullable String item, boolean empty) {
                if (!empty) {
                    setTooltip(this.tooltip);
                    setOnMouseEntered(StoreController.this::onStoreViewItemMouseEntered);
                    setText(item);
                } else {
                    setTooltip(null);
                    setOnMouseEntered(null);
                    setText(null);
                }
            }
        };
    });
    this.ctlStoreEntryViewId.setCellValueFactory(new TreeItemPropertyValueFactory<>("id"));
    this.ctlStoreEntryViewName.setCellValueFactory(new TreeItemPropertyValueFactory<>("name"));
    this.ctlStoreEntryViewSerial.setCellValueFactory(new TreeItemPropertyValueFactory<>("serial"));
    this.ctlStoreEntryViewExpires.setCellValueFactory(new TreeItemPropertyValueFactory<>("expires"));
    ContextMenu detailsViewMenu = this.ctlDetailsView.getContextMenu();
    this.ctlDetailsView.setContextMenu(null);
    this.ctlDetailsView.setRowFactory(param -> {
        ContextMenu menu = detailsViewMenu;
        return new TreeTableRow<AttributeModel>() {

            @Override
            protected void updateItem(@Nullable AttributeModel item, boolean empty) {
                super.updateItem(item, empty);
                if (!empty) {
                    setContextMenu(menu);
                } else {
                    setContextMenu(null);
                }
            }
        };
    });
    this.ctlDetailsViewName.setCellValueFactory(new TreeItemPropertyValueFactory<>("name"));
    this.ctlDetailsViewValue.setCellValueFactory(new TreeItemPropertyValueFactory<>("value"));
    this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().addListener((p, o, n) -> onStoreViewSelectionChanged(n));
    Windows.onHiding(stage, (ScheduledFuture<?> f) -> f.cancel(true), getExecutorService().scheduleAtFixedRate(PlatformHelper.runLaterRunnable(() -> onUpdateHeapStatus()), 0, 500, TimeUnit.MILLISECONDS));
}
Also used : TreeTableCell(javafx.scene.control.TreeTableCell) Tooltip(javafx.scene.control.Tooltip) ContextMenu(javafx.scene.control.ContextMenu) TreeTableRow(javafx.scene.control.TreeTableRow) Nullable(de.carne.check.Nullable) ScheduledFuture(java.util.concurrent.ScheduledFuture)

Example 69 with Tooltip

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

the class MainDesignerController method updateRecentFilesMenu.

private void updateRecentFilesMenu() {
    List<MenuItem> items = new ArrayList<>();
    List<File> filesToClear = new ArrayList<>();
    for (final File f : recentFiles) {
        if (f.exists() && f.isFile()) {
            CustomMenuItem item = new CustomMenuItem(new Label(f.getName()));
            item.setOnAction(e -> loadSourceFromFile(f));
            item.setMnemonicParsing(false);
            Tooltip.install(item.getContent(), new Tooltip(f.getAbsolutePath()));
            items.add(item);
        } else {
            filesToClear.add(f);
        }
    }
    recentFiles.removeAll(filesToClear);
    if (items.isEmpty()) {
        openRecentMenu.setDisable(true);
        return;
    }
    Collections.reverse(items);
    items.add(new SeparatorMenuItem());
    MenuItem clearItem = new MenuItem();
    clearItem.setText("Clear menu");
    clearItem.setOnAction(e -> {
        recentFiles.clear();
        openRecentMenu.setDisable(true);
    });
    items.add(clearItem);
    openRecentMenu.getItems().setAll(items);
}
Also used : Tooltip(javafx.scene.control.Tooltip) ArrayList(java.util.ArrayList) Label(javafx.scene.control.Label) CustomMenuItem(javafx.scene.control.CustomMenuItem) MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) CustomMenuItem(javafx.scene.control.CustomMenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) File(java.io.File)

Example 70 with Tooltip

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

the class KanonizoFrame method addParams.

private void addParams(Object alg, GridPane paramLayout, boolean runPrerequisites) {
    List<Field> params = Arrays.asList(alg.getClass().getFields()).stream().filter(f -> f.getAnnotation(Parameter.class) != null).collect(Collectors.toList());
    int row = 0;
    int col = -1;
    for (Field param : params) {
        if (col + 2 > ITEMS_PER_ROW * 2) {
            col = -1;
            row++;
        }
        Label paramLabel = new Label(Util.humanise(param.getName()) + ":");
        paramLabel.setAlignment(Pos.CENTER_LEFT);
        paramLabel.setTooltip(new Tooltip(Util.humanise(param.getName())));
        Control paramField = getParameterField(param, runPrerequisites);
        paramField.setTooltip(new Tooltip(param.getAnnotation(Parameter.class).description()));
        paramLayout.add(paramLabel, ++col, row, 1, 1);
        paramLayout.add(paramField, ++col, row, 1, 1);
        if (param.isAnnotationPresent(ConditionalParameter.class)) {
            String condition = param.getAnnotation(ConditionalParameter.class).condition();
            String[] listensTo = param.getAnnotation(ConditionalParameter.class).listensTo().split(",");
            for (String listen : listensTo) {
                Util.addPropertyChangeListener(listen, (e) -> {
                    ScriptEngineManager manager = new ScriptEngineManager();
                    ScriptEngine engine = manager.getEngineByName("nashorn");
                    try {
                        Class<?> container = param.getDeclaringClass();
                        engine.put("CallerClass", container);
                        engine.eval("var " + container.getSimpleName() + " = CallerClass.static");
                        boolean cond = (boolean) engine.eval(condition);
                        paramField.setDisable(!cond);
                        paramLabel.setDisable(!cond);
                    } catch (ScriptException ex) {
                        logger.error(ex);
                    }
                });
            }
        }
    }
}
Also used : Button(javafx.scene.control.Button) Pos(javafx.geometry.Pos) Arrays(java.util.Arrays) Initializable(javafx.fxml.Initializable) AlertUtils(org.kanonizo.gui.AlertUtils) TestSuite(org.kanonizo.framework.objects.TestSuite) URL(java.net.URL) Control(javafx.scene.control.Control) StackPane(javafx.scene.layout.StackPane) VBox(javafx.scene.layout.VBox) Application(javafx.application.Application) Task(javafx.concurrent.Task) AlertType(javafx.scene.control.Alert.AlertType) ComboBox(javafx.scene.control.ComboBox) ContextMenu(javafx.scene.control.ContextMenu) Method(java.lang.reflect.Method) ScriptException(javax.script.ScriptException) Rectangle2D(javafx.geometry.Rectangle2D) TextField(javafx.scene.control.TextField) SearchAlgorithm(org.kanonizo.algorithms.SearchAlgorithm) MenuItem(javafx.scene.control.MenuItem) Set(java.util.Set) ConditionalParameter(org.kanonizo.annotations.ConditionalParameter) Screen(javafx.stage.Screen) OptionProvider(org.kanonizo.annotations.OptionProvider) Collectors(java.util.stream.Collectors) TreeView(javafx.scene.control.TreeView) InvocationTargetException(java.lang.reflect.InvocationTargetException) Platform(javafx.application.Platform) FXML(javafx.fxml.FXML) List(java.util.List) Util(org.kanonizo.util.Util) Logger(org.apache.logging.log4j.Logger) PropertyChangeListener(java.beans.PropertyChangeListener) Modifier(java.lang.reflect.Modifier) Optional(java.util.Optional) Display(org.kanonizo.display.Display) ObservableList(javafx.collections.ObservableList) BorderPane(javafx.scene.layout.BorderPane) Scene(javafx.scene.Scene) MouseButton(javafx.scene.input.MouseButton) ListView(javafx.scene.control.ListView) MouseEvent(javafx.scene.input.MouseEvent) Framework(org.kanonizo.Framework) ReadableConverter(org.kanonizo.display.fx.converters.ReadableConverter) Parameter(com.scythe.instrumenter.InstrumentationProperties.Parameter) HashSet(java.util.HashSet) ResourceBundle(java.util.ResourceBundle) FXMLLoader(javafx.fxml.FXMLLoader) Prerequisite(org.kanonizo.annotations.Prerequisite) Tooltip(javafx.scene.control.Tooltip) GridPane(javafx.scene.layout.GridPane) DirectoryChooser(javafx.stage.DirectoryChooser) KanonizoFxApplication(org.kanonizo.gui.KanonizoFxApplication) ProgressIndicator(javafx.scene.control.ProgressIndicator) Label(javafx.scene.control.Label) Node(javafx.scene.Node) CheckBox(javafx.scene.control.CheckBox) ScriptEngineManager(javax.script.ScriptEngineManager) StringConverter(javafx.util.StringConverter) Field(java.lang.reflect.Field) File(java.io.File) GuiUtils(org.kanonizo.gui.GuiUtils) FileChooser(javafx.stage.FileChooser) Condition(java.util.concurrent.locks.Condition) ActionEvent(javafx.event.ActionEvent) ScriptEngine(javax.script.ScriptEngine) ExtensionFilter(javafx.stage.FileChooser.ExtensionFilter) LogManager(org.apache.logging.log4j.LogManager) Tooltip(javafx.scene.control.Tooltip) Label(javafx.scene.control.Label) ScriptEngineManager(javax.script.ScriptEngineManager) ScriptEngine(javax.script.ScriptEngine) TextField(javafx.scene.control.TextField) Field(java.lang.reflect.Field) ScriptException(javax.script.ScriptException) Control(javafx.scene.control.Control) ConditionalParameter(org.kanonizo.annotations.ConditionalParameter) ConditionalParameter(org.kanonizo.annotations.ConditionalParameter) Parameter(com.scythe.instrumenter.InstrumentationProperties.Parameter)

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