use of org.phoebus.ui.dialog.ListSelectionDialog in project phoebus by ControlSystemStudio.
the class LogbooksTagsView method formatLogbooks.
/**
* Format log books HBox
*/
private void formatLogbooks() {
Tooltip tooltip = new Tooltip(Messages.LogbooksTooltip);
addLogbook.setTooltip(tooltip);
logbookSelector.setTooltip(tooltip);
logbookLabel.setPrefWidth(LABEL_WIDTH);
logbookLabel.setTextFill(Color.RED);
logbookField.textProperty().addListener((changeListener, oldVal, newVal) -> {
if (model.getSelectedLogbooks().isEmpty())
logbookLabel.setTextFill(Color.RED);
else
logbookLabel.setTextFill(Color.BLACK);
});
logbookSelector.setOnAction(actionEvent -> {
if (logbookSelector.isSelected())
logbookDropDown.show(logbookField, Side.BOTTOM, 0, 0);
else
logbookDropDown.hide();
});
logbookDropDown.showingProperty().addListener((changeListener, oldVal, newVal) -> {
if (newVal && tagSelector.isSelected())
tagSelector.setSelected(false);
});
logbookSelector.focusedProperty().addListener((changeListener, oldVal, newVal) -> {
if (!newVal && !tagDropDown.isShowing() && !logbookDropDown.isShowing())
logbookSelector.setSelected(false);
});
logbookField.setEditable(false);
HBox.setHgrow(logbookField, Priority.ALWAYS);
addLogbook.setOnAction(event -> {
ListSelectionDialog select = new ListSelectionDialog(getScene().getRoot(), Messages.LogbooksTitle, model::getLogbooks, model::getSelectedLogbooks, model::addSelectedLogbook, model::removeSelectedLogbook);
Optional<Boolean> result = select.showAndWait();
if (result.isPresent() && result.get())
setFieldText(logbookDropDown, model.getSelectedLogbooks(), logbookField);
});
logbookBox.getChildren().addAll(logbookLabel, logbookField, logbookSelector, addLogbook);
logbookBox.setSpacing(5);
logbookBox.setAlignment(Pos.CENTER);
}
use of org.phoebus.ui.dialog.ListSelectionDialog in project phoebus by ControlSystemStudio.
the class FieldsViewController method addLogbooks.
@FXML
public void addLogbooks() {
ListSelectionDialog select = new ListSelectionDialog(root.getScene().getRoot(), Messages.LogbooksTitle, this::getAvailableLogbooksAsStringList, this::getSelectedLogbooksAsStringList, this::addSelectedLogbook, this::removeSelectedLogbook);
select.showAndWait();
}
use of org.phoebus.ui.dialog.ListSelectionDialog in project phoebus by ControlSystemStudio.
the class LogbooksTagsView method formatTags.
/**
* Format tags HBox
*/
private void formatTags() {
Tooltip tooltip = new Tooltip(Messages.TagsTooltip);
addTag.setTooltip(tooltip);
tagSelector.setTooltip(tooltip);
tagLabel.setPrefWidth(LABEL_WIDTH);
tagSelector.setOnAction(actionEvent -> {
if (tagSelector.isSelected())
tagDropDown.show(tagField, Side.BOTTOM, 0, 0);
else
tagDropDown.hide();
});
tagDropDown.showingProperty().addListener((changeListener, oldVal, newVal) -> {
if (newVal && logbookSelector.isSelected())
logbookSelector.setSelected(false);
});
tagSelector.focusedProperty().addListener((changeListener, oldVal, newVal) -> {
if (!newVal && !tagDropDown.isShowing() && !logbookDropDown.isShowing())
tagSelector.setSelected(false);
});
tagField.setEditable(false);
HBox.setHgrow(tagField, Priority.ALWAYS);
addTag.setOnAction(event -> {
ListSelectionDialog select = new ListSelectionDialog(getScene().getRoot(), Messages.TagsTitle, model::getTags, model::getSelectedTags, model::addSelectedTag, model::removeSelectedTag);
Optional<Boolean> result = select.showAndWait();
if (result.isPresent() && result.get())
setFieldText(tagDropDown, model.getSelectedTags(), tagField);
});
tagBox.getChildren().addAll(tagLabel, tagField, tagSelector, addTag);
tagBox.setSpacing(5);
tagBox.setAlignment(Pos.CENTER);
}
use of org.phoebus.ui.dialog.ListSelectionDialog in project phoebus by ControlSystemStudio.
the class FieldsViewController method addTags.
@FXML
public void addTags() {
ListSelectionDialog select = new ListSelectionDialog(root.getScene().getRoot(), Messages.TagsTitle, this::getTagsAsStringList, this::getSelectedTagsAsStringList, this::addSelectedTag, this::removeSelectedTag);
select.showAndWait();
}
Aggregations