001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)ExtPropertySheetTag.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package org.openesb.tools.extpropertysheet.ui;
030:
031: import javax.faces.component.UIComponent;
032: import javax.faces.el.ValueBinding;
033: import javax.faces.webapp.UIComponentTag;
034: import java.util.logging.Logger;
035:
036: /**
037: *
038: * @author rdwivedi
039: */
040: public class ExtPropertySheetTag extends UIComponentTag {
041:
042: private static Logger mLogger = Logger
043: .getLogger(ExtPropertySheetTag.class.getName());
044: /** Creates a new instance of ExtPropertySheetTag */
045: private String mPropGroups = null;
046: private String mResBundle = null;
047:
048: public ExtPropertySheetTag() {
049: }
050:
051: public String getComponentType() {
052: return ExtPropertySheetComponent.COMPONENT_TYPE;
053: }
054:
055: public String getRendererType() {
056: return null;
057: }
058:
059: protected void setProperties(UIComponent component) {
060:
061: super .setProperties(component);
062: mLogger.info("set" + component.getClass().getName());
063: if (mPropGroups != null) {
064: if (isValueReference(mPropGroups)) {
065: ValueBinding vb = getFacesContext().getApplication()
066: .createValueBinding(mPropGroups);
067: component.setValueBinding("propertyGroups", vb);
068: } else {
069: component.getAttributes().put("propertyGroups",
070: mPropGroups);
071: }
072: }
073:
074: if (mResBundle != null) {
075: if (isValueReference(mResBundle)) {
076: ValueBinding vb = getFacesContext().getApplication()
077: .createValueBinding(mResBundle);
078: component.setValueBinding("resourceBundle", vb);
079: } else {
080: component.getAttributes().put("resourceBundle",
081: mResBundle);
082: }
083: }
084: ((ExtPropertySheetComponent) component)
085: .createSubComponent(getFacesContext());
086: }
087:
088: public void setPropertyGroups(String b) {
089: mPropGroups = b;
090:
091: }
092:
093: public String getPropertyGroups() {
094: return mPropGroups;
095: }
096:
097: public void setResourceBundle(String b) {
098: mResBundle = b;
099:
100: }
101:
102: public String getResourceBundle() {
103: return mResBundle;
104: }
105:
106: }
|