use of gmgen.plugin.InfoCharacterDetails in project pcgen by PCGen.
the class Initiative method addTab.
/**
* <p>
* Adds a tab to the {@code tpaneInfo} member. All methods adding
* character tabs to {@code tpaneInfo} should call this method to do
* so, as it provides a standard setup for the text panes and installs
* hyperlink listeners.
* </p>
*
* @param cbt Combatant to add.
*/
void addTab(final Combatant cbt) {
javax.swing.JTextPane lp = new javax.swing.JTextPane();
lp.setContentType("text/html");
InfoCharacterDetails ic = new InfoCharacterDetails(cbt, lp);
tpaneInfo.addTab(cbt.getName(), ic.getScrollPane());
lp.setEditable(false);
lp.addHyperlinkListener(new HyperlinkListener() {
private final Combatant combatant = cbt;
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
hyperLinkSelected(e, combatant);
}
});
}
Aggregations