use of pcgen.facade.core.SpellSupportFacade.RootNode in project pcgen by PCGen.
the class SpellInfoHandler method valueChanged.
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
Object obj;
if (e.getSource() == availableTable.getSelectionModel()) {
obj = availableTable.getSelectedObject();
} else {
obj = selectedTable.getSelectedObject();
}
if (obj instanceof SpellNode) {
SpellNode node = (SpellNode) obj;
String text = character.getInfoFactory().getHTMLInfo(node.getSpell());
currText = text;
spellsPane.setText(text);
} else if (obj instanceof RootNode) {
RootNode node = (RootNode) obj;
String text = character.getInfoFactory().getSpellBookInfo(node.getName());
if (!StringUtils.isEmpty(text)) {
currText = text;
spellsPane.setText(text);
}
}
}
}