Skip to content

Commit b64527a

Browse files
committed
Fix the add tag job to
1 parent fe43665 commit b64527a

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

app/channel/utility/src/main/java/org/phoebus/channelfinder/utility/ConnectionCheckJob.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public String getName() {
3838
public Runnable getRunnable() {
3939
return () -> {
4040
try {
41-
client.getAllTags();
41+
client.getAllTagNames();
4242
} catch (Exception e) {
4343
errorHandler.accept("Failed to connect to channelfinder ", e);
4444
}

app/channel/views/src/main/java/org/phoebus/channel/views/ui/AddTagDialog.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import java.io.IOException;
44
import java.util.Collection;
5+
import java.util.Map;
6+
import java.util.function.Function;
57
import java.util.logging.Level;
8+
import java.util.stream.Collectors;
69

710
import org.phoebus.channelfinder.Tag;
811

@@ -20,18 +23,19 @@
2023
*/
2124
public class AddTagDialog extends Dialog<Tag> {
2225

23-
public AddTagDialog(final Node parent, final Collection<String> tags) {
26+
public AddTagDialog(final Node parent, final Collection<Tag> tags) {
2427
getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
2528
setResizable(true);
2629
FXMLLoader loader = new FXMLLoader();
2730
loader.setLocation(this.getClass().getResource("SelectEntity.fxml"));
2831
try {
2932
getDialogPane().setContent(loader.load());
3033
SelectEntityController controller = loader.getController();
31-
controller.setAvaibleOptions(tags);
34+
Map<String, Tag> tagsMap = tags.stream().collect(Collectors.toMap(Tag::getName, Function.identity()));
35+
controller.setAvaibleOptions(tagsMap.keySet());
3236
setResultConverter(button -> {
3337
return button == ButtonType.OK
34-
? Tag.Builder.tag(controller.getSelectedOption()).build()
38+
? tagsMap.get(controller.getSelectedOption())
3539
: null;
3640
});
3741
DialogHelper.positionDialog(this, parent, -250, -400);

app/channel/views/src/main/java/org/phoebus/channel/views/ui/ChannelTableController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class ChannelTableController extends ChannelFinderController {
7171
Label count;
7272

7373
private Collection<Property> properties;
74-
private Collection<String> tags;
74+
private Collection<Tag> tags;
7575
private boolean isCBSelected = true;
7676
@Preference(name="show_active_cb") public static boolean showActiveCb;
7777

0 commit comments

Comments
 (0)