Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2019 European Spallation Source ERIC.
* Copyright (C) 2024 European Spallation Source ERIC.
* <p>
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -117,12 +117,22 @@ public void updateTabTitle(String name) {
Platform.runLater(() -> textProperty().set(name));
}

/**
* Set tab image based on node type, and optionally golden tag
* @param node A snapshot {@link Node}
*/
private void setTabImage(Node node) {
boolean golden = node.getTags() != null && node.getTags().stream().anyMatch(t -> t.getName().equals(Tag.GOLDEN));
if (golden) {
tabGraphicImageProperty.set(ImageRepository.GOLDEN_SNAPSHOT);
} else {
tabGraphicImageProperty.set(ImageRepository.SNAPSHOT);
if(node.getNodeType().equals(NodeType.COMPOSITE_SNAPSHOT)){
tabGraphicImageProperty.set(ImageRepository.COMPOSITE_SNAPSHOT);
}
else{
boolean golden = node.getTags() != null && node.getTags().stream().anyMatch(t -> t.getName().equals(Tag.GOLDEN));
if (golden) {
tabGraphicImageProperty.set(ImageRepository.GOLDEN_SNAPSHOT);
}
else {
tabGraphicImageProperty.set(ImageRepository.SNAPSHOT);
}
}
}

Expand Down