001/* 002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Jean-Marc Orliaguet, Chalmers 018 * 019 * $Id$ 020 */ 021 022package org.nuxeo.theme.jsf.taglib; 023 024import javax.faces.component.UIComponent; 025import javax.faces.webapp.UIComponentELTag; 026 027public class PanelTag extends UIComponentELTag { 028 029 private String identifier; 030 031 private String url; 032 033 private String loading; 034 035 private String stylesheet; 036 037 private String javascript; 038 039 private String subviews; 040 041 private String controlledBy; 042 043 private String filter; 044 045 private String visibleInPerspectives; 046 047 @Override 048 public String getComponentType() { 049 return "nxthemes.panel"; 050 } 051 052 @Override 053 public String getRendererType() { 054 return null; 055 } 056 057 @Override 058 protected void setProperties(UIComponent component) { 059 super.setProperties(component); 060 061 // the panel's identifier 062 component.getAttributes().put("identifier", identifier); 063 064 // the panel's URL 065 component.getAttributes().put("url", url); 066 067 // the element to show while loading 068 if (null != loading) { 069 component.getAttributes().put("loading", loading); 070 } 071 072 // stylesheet 073 if (null != stylesheet) { 074 component.getAttributes().put("stylesheet", stylesheet); 075 } 076 077 // script 078 if (null != javascript) { 079 component.getAttributes().put("javascript", javascript); 080 } 081 082 // the sub-views 083 if (null != subviews) { 084 component.getAttributes().put("subviews", subviews); 085 } 086 087 // the perspective controller(s) 088 component.getAttributes().put("controlledBy", controlledBy); 089 090 // the panel's perspectives 091 component.getAttributes().put("visibleInPerspectives", visibleInPerspectives); 092 093 // Filter 094 if (null != filter) { 095 component.getAttributes().put("filter", filter); 096 } 097 } 098 099 @Override 100 public void release() { 101 super.release(); 102 identifier = null; 103 url = null; 104 loading = null; 105 stylesheet = null; 106 javascript = null; 107 subviews = null; 108 controlledBy = null; 109 visibleInPerspectives = null; 110 filter = null; 111 } 112 113 public String getControlledBy() { 114 return controlledBy; 115 } 116 117 public void setControlledBy(String controlledBy) { 118 this.controlledBy = controlledBy; 119 } 120 121 public String getIdentifier() { 122 return identifier; 123 } 124 125 public void setIdentifier(String identifier) { 126 this.identifier = identifier; 127 } 128 129 public String getUrl() { 130 return url; 131 } 132 133 public void setUrl(String url) { 134 this.url = url; 135 } 136 137 public String getVisibleInPerspectives() { 138 return visibleInPerspectives; 139 } 140 141 public void setVisibleInPerspectives(String visibleInPerspectives) { 142 this.visibleInPerspectives = visibleInPerspectives; 143 } 144 145 public String getStylesheet() { 146 return stylesheet; 147 } 148 149 public void setStylesheet(String stylesheet) { 150 this.stylesheet = stylesheet; 151 } 152 153 public String getJavascript() { 154 return javascript; 155 } 156 157 public void setJavascript(String javascript) { 158 this.javascript = javascript; 159 } 160 161 public String getSubviews() { 162 return subviews; 163 } 164 165 public void setSubviews(String subviews) { 166 this.subviews = subviews; 167 } 168 169 public String getLoading() { 170 return loading; 171 } 172 173 public void setLoading(String loading) { 174 this.loading = loading; 175 } 176 177}