001 package nl.cwi.sen1.error.model;
002
003 import nl.cwi.sen1.error.viewer.ErrorViewerBridge;
004 import nl.cwi.sen1.gui.Studio;
005 import errorapi.types.Subject;
006
007 public class SubjectNode extends SelectableNode {
008 private Subject subject;
009
010 public SubjectNode(Subject subject) {
011 super(subject);
012 this.subject = subject;
013 }
014
015 public void selected(Studio studio, ErrorViewerBridge bridge) {
016 if (subject.hasLocation()) {
017 bridge.postEvent(studio.getATermFactory()
018 .make("location-selected(<term>)",
019 subject.getLocation().toTerm()));
020 }
021 }
022
023 public String toString() {
024 return subject.getDescription();
025 }
026 }