.getInstance(facesContext.getExternalContext()) .getBorderRenderersRegistry();
.getInstance(facesContext).getBorderRenderersRegistry();
    public void encodeBegin(IComponentWriter writer) throws WriterException {        IComponentRenderContext componentRenderContext = writer                .getComponentRenderContext();        FacesContext facesContext = componentRenderContext.getFacesContext();        CustomButtonComponent component = (CustomButtonComponent) componentRenderContext                .getComponent();        IHtmlBorderRenderer borderRenderer = null;        String borderType = null;        if (component.isBorder(facesContext)) {            borderType = component.getBorderType(facesContext);            IBorderRenderersRegistry borderRendererRegistry = RcfacesContext                    .getInstance(facesContext.getExternalContext())                    .getBorderRenderersRegistry();            borderRenderer = (IHtmlBorderRenderer) borderRendererRegistry                    .getBorderRenderer(facesContext,                            RenderKitFactory.HTML_BASIC_RENDER_KIT, component                                    .getFamily(), component.getRendererType(),                            borderType);        }        String className = getStyleClassName(componentRenderContext, component);        boolean disabled = component.isDisabled(facesContext);        String width = component.getWidth(facesContext);        String height = component.getHeight(facesContext);        boolean selected = false;        if (component instanceof ISelectedCapability) {            ISelectedCapability selectedCapability = (ISelectedCapability) component;            selected = selectedCapability.isSelected();        }        IHtmlWriter htmlWriter = (IHtmlWriter) writer;        htmlWriter.startElement("DIV");        if (borderRenderer != null) {            htmlWriter.writeAttribute("v:borderType", borderType);        }        String classSuffix = null;        if (disabled) {            classSuffix = "_disabled";        }        writeHtmlAttributes(htmlWriter);        writeJavaScriptAttributes(htmlWriter);        writeCssAttributes(htmlWriter, classSuffix);        if (classSuffix != null) {            htmlWriter.writeAttribute("v:className", className);        }        encodeAttributes(htmlWriter, component);        if (borderRenderer != null) {            borderRenderer.initialize(htmlWriter, width, height, 1, 1,                    disabled, selected);            borderRenderer.startComposite(htmlWriter);            componentRenderContext                    .setAttribute(BORDER_RENDERER, borderRenderer);        }        /*         * Le javascript s'occupe de ca ! if (button == false && imageJavascript ==         * false) { htmlWriter.writeAttribute("href", "javascript:void(0)"); }         */        htmlWriter.enableJavaScript();    }