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: * @(#)ExtChartComponent.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package org.openesb.tools.extchart.jsf;
030:
031: import org.openesb.tools.extchart.jfchart.JFChartRenderer;
032: import org.openesb.tools.extchart.jfchart.data.DataAccess;
033: import org.openesb.tools.extpropertysheet.IExtPropertyGroupsBean;
034: import java.io.IOException;
035: import java.util.logging.Logger;
036: import javax.faces.component.UIComponentBase;
037: import javax.faces.context.FacesContext;
038: import javax.faces.el.ValueBinding;
039:
040: /**
041: *
042: * @author rdwivedi
043: */
044: public class ExtChartComponent extends UIComponentBase {
045:
046: private static Logger mLogger = Logger
047: .getLogger(ExtChartComponent.class.getName());
048: public static final String COMPONENT_TYPE = "org.openesb.tools.extchart.jsf.ExtChartComponent";
049:
050: public static final String COMPONENT_FAMILY = "org.openesb.tools.extchart.jsf";
051: private IExtPropertyGroupsBean mPropGroups = null;
052: private DataAccess mDA = null;
053:
054: /** Creates a new instance of ExtChartComponent */
055: public ExtChartComponent() {
056: }
057:
058: public String getFamily() {
059: return COMPONENT_FAMILY;
060: }
061:
062: JFChartRenderer rend = null;
063:
064: public void encodeBegin(FacesContext context) throws IOException {
065: rend = new JFChartRenderer();
066: rend.encodeBegin(context, this );
067:
068: }
069:
070: public void encodeEnd(FacesContext context) throws IOException {
071: rend.encodeEnd(context);
072: }
073:
074: public Object getPropertyGroups() {
075: if (mPropGroups != null)
076: return mPropGroups;
077:
078: ValueBinding vb = getValueBinding("propertyGroups");
079: Object v = vb != null ? vb.getValue(getFacesContext()) : null;
080: mLogger.info("obje" + v);
081: return v != null ? v : null;
082: }
083:
084: public void setPropertyGroups(Object pGs) {
085: mLogger.info("Se>>>>>" + pGs.getClass().getName());
086: this .mPropGroups = (IExtPropertyGroupsBean) pGs;
087: }
088:
089: public Object getDataAccess() {
090: if (mDA != null)
091: return mDA;
092:
093: ValueBinding vb = getValueBinding("dataAccess");
094: Object v = vb != null ? vb.getValue(getFacesContext()) : null;
095: mLogger.info("obje" + v);
096: return v != null ? v : null;
097: }
098:
099: public void setDataAccess(Object da) {
100: mLogger.info("Se>>>>>" + da.getClass().getName());
101: this .mDA = (DataAccess) da;
102: }
103:
104: public void decode(FacesContext context) {
105: mLogger.info("Decoding begins");
106: super .decode(context);
107: mLogger.info("Decoding ends");
108: }
109:
110: public void restoreState(FacesContext context, Object state) {
111: super .restoreState(context, state);
112: mLogger.info("restoreState begins state for some state"
113: + state.getClass().getName());
114:
115: }
116:
117: public void processDecodes(FacesContext context) {
118: super .processDecodes(context);
119: mLogger.info("process Decoding begins");
120: }
121:
122: }
|