001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS <http://nuxeo.com> and others
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Jean-Marc Orliaguet, Chalmers
011 *
012 * $Id$
013 */
014
015package org.nuxeo.theme.jsf.taglib;
016
017import javax.faces.component.UIComponent;
018import javax.faces.webapp.UIComponentELTag;
019
020public class PanelTag extends UIComponentELTag {
021
022    private String identifier;
023
024    private String url;
025
026    private String loading;
027
028    private String stylesheet;
029
030    private String javascript;
031
032    private String subviews;
033
034    private String controlledBy;
035
036    private String filter;
037
038    private String visibleInPerspectives;
039
040    @Override
041    public String getComponentType() {
042        return "nxthemes.panel";
043    }
044
045    @Override
046    public String getRendererType() {
047        return null;
048    }
049
050    @Override
051    protected void setProperties(UIComponent component) {
052        super.setProperties(component);
053
054        // the panel's identifier
055        component.getAttributes().put("identifier", identifier);
056
057        // the panel's URL
058        component.getAttributes().put("url", url);
059
060        // the element to show while loading
061        if (null != loading) {
062            component.getAttributes().put("loading", loading);
063        }
064
065        // stylesheet
066        if (null != stylesheet) {
067            component.getAttributes().put("stylesheet", stylesheet);
068        }
069
070        // script
071        if (null != javascript) {
072            component.getAttributes().put("javascript", javascript);
073        }
074
075        // the sub-views
076        if (null != subviews) {
077            component.getAttributes().put("subviews", subviews);
078        }
079
080        // the perspective controller(s)
081        component.getAttributes().put("controlledBy", controlledBy);
082
083        // the panel's perspectives
084        component.getAttributes().put("visibleInPerspectives", visibleInPerspectives);
085
086        // Filter
087        if (null != filter) {
088            component.getAttributes().put("filter", filter);
089        }
090    }
091
092    @Override
093    public void release() {
094        super.release();
095        identifier = null;
096        url = null;
097        loading = null;
098        stylesheet = null;
099        javascript = null;
100        subviews = null;
101        controlledBy = null;
102        visibleInPerspectives = null;
103        filter = null;
104    }
105
106    public String getControlledBy() {
107        return controlledBy;
108    }
109
110    public void setControlledBy(String controlledBy) {
111        this.controlledBy = controlledBy;
112    }
113
114    public String getIdentifier() {
115        return identifier;
116    }
117
118    public void setIdentifier(String identifier) {
119        this.identifier = identifier;
120    }
121
122    public String getUrl() {
123        return url;
124    }
125
126    public void setUrl(String url) {
127        this.url = url;
128    }
129
130    public String getVisibleInPerspectives() {
131        return visibleInPerspectives;
132    }
133
134    public void setVisibleInPerspectives(String visibleInPerspectives) {
135        this.visibleInPerspectives = visibleInPerspectives;
136    }
137
138    public String getStylesheet() {
139        return stylesheet;
140    }
141
142    public void setStylesheet(String stylesheet) {
143        this.stylesheet = stylesheet;
144    }
145
146    public String getJavascript() {
147        return javascript;
148    }
149
150    public void setJavascript(String javascript) {
151        this.javascript = javascript;
152    }
153
154    public String getSubviews() {
155        return subviews;
156    }
157
158    public void setSubviews(String subviews) {
159        this.subviews = subviews;
160    }
161
162    public String getLoading() {
163        return loading;
164    }
165
166    public void setLoading(String loading) {
167        this.loading = loading;
168    }
169
170}