return new EmptyPanel(wicketId);
} else {
// Default case: glossary type is MAIN, or we wanted a modal but have no place to put it
// (eg, we're in a popup window, or modal window)
GlossaryLink glossaryLink = new GlossaryLink(wicketId, wordModel);
ISIApplication.get().setLinkProperties(glossaryLink);
return glossaryLink;
}
// inline glossary: linked word
} else if (wicketId.startsWith("glossword")) {
WebMarkupContainer glossaryWord = new WebMarkupContainer(wicketId);
glossaryWord.setVisible(ISIApplication.get().glossaryLinkType.equals(ISIApplication.GLOSSARY_TYPE_INLINE));
return glossaryWord;
// inline glossary: definition
} else if (wicketId.startsWith("glossdef")) {
// Span element, to be filled in with the glossary short def.
String word = elt.getAttribute("word");
final String def = ISIApplication.get().getGlossary().getShortDefById(word);
WebMarkupContainer container;
container = new WebMarkupContainer(wicketId) {
private static final long serialVersionUID = 1L;
@Override
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, def);
}
};
container.add(new AttributeRemover("word"));
container.setVisible(ISIApplication.get().glossaryLinkType.equals(ISIApplication.GLOSSARY_TYPE_INLINE));
return container;
// inline glossary: "more" link to main glossary window
} else if (wicketId.startsWith("glosslink")) {
IModel<String> wordModel = new Model<String>(elt.getAttribute("word"));
GlossaryLink glossaryLink = new GlossaryLink(wicketId, wordModel);
ISIApplication.get().setLinkProperties(glossaryLink);
glossaryLink.setVisible(ISIApplication.get().glossaryLinkType.equals(ISIApplication.GLOSSARY_TYPE_INLINE));
return glossaryLink;
} else if (wicketId.startsWith("link_")) {
String href = elt.getAttribute("href");
// According to NIMAS, href should be in the form "filename.xml#ID" or just "#ID" for within-file link