/* * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package com.arsdigita.cms.ui; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.SimpleComponent; import com.arsdigita.xml.Element; /** * A solid, horizontal line. * * @author Michael Pih (pihman@arsdigita.com) * @version $Id: HorizontalLine.java 287 2005-02-22 00:29:02Z sskracic $ * @deprecated with no replacement */ // FIXME: Could this be done solely in XSL ? Or do some of these attributes // come from the DB/user preferences ? It would be cleaner if we could move // this completely to XSL. public class HorizontalLine extends SimpleComponent { private final static String CMS_XML_NS = "http://www.arsdigita.com/cms/1.0"; private String m_width; private String m_height; private String m_bgcolor; public HorizontalLine() { super(); } public String getWidth() { return m_width; } // TODO: should be renamed to setHeight() to make the correspondance // with XML more obvious public String getThickness() { return m_height; } public String getColor() { return m_bgcolor; } public void setWidth(String w) { m_width = w; } public void setThickness(String t) { m_height = t; } public void setColor(String c) { m_bgcolor = c; } // TODO: document the XML generated by this component public void generateXML(PageState state, Element parent) { if ( !isVisible(state) ) { return; } Element line = parent.newChildElement("cms:solidLine", CMS_XML_NS); line.addAttribute("width", m_width); line.addAttribute("height", m_height); line.addAttribute("bgcolor", m_bgcolor); exportAttributes(line); } }