Package org.richfaces.component

Examples of org.richfaces.component.AbstractSyntaxHighlighter


// --------------------- 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);
View Full Code Here


    @Override
    public void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
        if (!(component instanceof AbstractSyntaxHighlighter)) {
            return;
        }
        AbstractSyntaxHighlighter syntaxhighlighter = (AbstractSyntaxHighlighter) component;
        String clientId = component.getClientId(context);
        writer.endElement(HtmlConstants.DIV_ELEM);
        writer.startElement(HtmlConstants.SCRIPT_ELEM, null);
        writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/javascript", "type");
        final Map<String, Object> options = getOptions(syntaxhighlighter);
View Full Code Here

TOP

Related Classes of org.richfaces.component.AbstractSyntaxHighlighter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.