fixed tool tips not showing in ParameterSetupDialog
@@ -41,7 +41,6 @@ import javafx.scene.control.ButtonBar.ButtonData;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ComboBox;
-import javafx.scene.control.Control;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextField;
@@ -168,9 +167,7 @@ public class ParameterSetupDialog extends Stage {
UserParameter up = (UserParameter) p;
Node comp = up.createEditingComponent();
- if (comp instanceof Control) {
- ((Control) comp).setTooltip(new Tooltip(up.getDescription()));
- }
+ addToolTipToControls(comp, up.getDescription());
if (comp instanceof Region) {
double minWidth = ((Region) comp).getMinWidth();
// if (minWidth > column2.getMinWidth()) column2.setMinWidth(minWidth);
@@ -412,4 +409,31 @@ public class ParameterSetupDialog extends Stage {
return valueCheckRequired;
}
+ protected void addToolTipToControls(Node node, String toolTipText) {
+ if (node instanceof TextField) {
+ TextField textField = (TextField) node;
+ textField.setTooltip(new Tooltip(toolTipText));
+ }
+ if (node instanceof ComboBox) {
+ ComboBox<?> comboComp = (ComboBox<?>) node;
+ comboComp.setTooltip(new Tooltip(toolTipText));
+ }
+ if (node instanceof ChoiceBox) {
+ ChoiceBox<?> choiceBox = (ChoiceBox) node;
+ choiceBox.setTooltip(new Tooltip(toolTipText));
+ }
+ if (node instanceof CheckBox) {
+ CheckBox checkBox = (CheckBox) node;
+ checkBox.setTooltip(new Tooltip(toolTipText));
+ }
+ if (node instanceof Region) {
+ Region panelComp = (Region)
+ node;
+ for (int i = 0; i < panelComp.getChildrenUnmodifiable().size(); i++) {
+ Node child =
+ panelComp.getChildrenUnmodifiable().get(i);
+ addListenersToNode(child);
+ }
+ }
+ }
}
