// --------------------- Interface ComponentSystemEventListener ---------------------
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
UIComponent component = event.getComponent();
AbstractSyntaxHighlighter syntaxhighlighter = (AbstractSyntaxHighlighter) component;
if (event instanceof PostAddToViewEvent) {
syntaxhighlighter.subscribeToPreRenderViewEvent();
} else if (event instanceof PreRenderComponentEvent) {
FacesContext context = FacesContext.getCurrentInstance();
String language = syntaxhighlighter.getLanguage();
if (language != null) {
language = language.toLowerCase();
}
if (SUPPORTED_LANGUAGES.containsKey(language)) {
String resourceName = SUPPORTED_LANGUAGES.get(language);
context.getViewRoot().addComponentResource(context, createComponentResource(context, resourceName));
}
String theme = syntaxhighlighter.getTheme();
if (theme != null) {
theme = theme.toLowerCase();
}
if (SUPPORTED_THEMES.containsKey(theme)) {
Collection<String> resources = SUPPORTED_THEMES.get(theme);