001/*
002 * (C) Copyright 2006-2008 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     <a href="mailto:at@nuxeo.com">Anahide Tchertchian</a>
016 *
017 * $Id$
018 */
019
020package org.nuxeo.ecm.platform.ui.web.component;
021
022import java.io.IOException;
023
024import javax.faces.component.UIComponentBase;
025import javax.faces.context.FacesContext;
026import javax.faces.context.ResponseWriter;
027
028/**
029 * Component rendering a disabled message.
030 *
031 * @author Anahide Tchertchian
032 */
033public class DisabledComponent extends UIComponentBase {
034
035    public static final String COMPONENT_TYPE = "nuxeo.web.disabled";
036
037    public static final String COMPONENT_FAMILY = "nuxeo.web.disabled";
038
039    @Override
040    public String getFamily() {
041        return COMPONENT_FAMILY;
042    }
043
044    @Override
045    public String getRendererType() {
046        return null;
047    }
048
049    @Override
050    public void encodeBegin(FacesContext context) throws IOException {
051        ResponseWriter writer = context.getResponseWriter();
052        writer.write("This component is disabled. Please use another tag library");
053        writer.flush();
054    }
055
056}