You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/06/04 05:15:05 UTC
svn commit: r662960 [1/2] - in
/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component:
./ html/
Author: lu4242
Date: Tue Jun 3 20:15:04 2008
New Revision: 662960
URL: http://svn.apache.org/viewvc?rev=662960&view=rev
Log:
Component generation for 1.2
Added:
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIData.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIGraphic.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIInput.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UINamingContainer.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIOutput.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIPanel.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UISelectBoolean.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UISelectMany.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UISelectOne.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIViewRoot.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/html/_HtmlPanelGrid.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/html/_HtmlPanelGroup.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/html/_HtmlSelectBooleanCheckbox.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/html/_HtmlSelectManyCheckbox.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/html/_HtmlSelectManyListbox.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/html/_HtmlSelectManyMenu.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/html/_HtmlSelectOneListbox.java (with props)
myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/html/_HtmlSelectOneMenu.java (with props)
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIData.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIData.java?rev=662960&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIData.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIData.java Tue Jun 3 20:15:04 2008
@@ -0,0 +1,1097 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package javax.faces.component;
+
+import java.io.IOException;
+import java.sql.ResultSet;
+import java.util.*;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+import javax.faces.event.PhaseId;
+import javax.faces.model.*;
+import javax.servlet.jsp.jstl.sql.Result;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
+/**
+ *
+ * UIData is a base abstraction for components that holds Data.
+ */
+@JSFComponent
+(defaultRendererType = "javax.faces.Table"
+)
+public class UIData extends UIComponentBase
+ implements NamingContainer
+{
+
+ static public final String COMPONENT_FAMILY =
+ "javax.faces.Data";
+ static public final String COMPONENT_TYPE =
+ "javax.faces.Data";
+
+ /**
+ * Construct an instance of the UIData.
+ */
+ public UIData()
+ {
+ setRendererType("javax.faces.Table");
+ }
+ private static final String FOOTER_FACET_NAME = "footer";
+ private static final String HEADER_FACET_NAME = "header";
+ private static final Class OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
+ private static final int PROCESS_DECODES = 1;
+ private static final int PROCESS_VALIDATORS = 2;
+ private static final int PROCESS_UPDATES = 3;
+
+
+ private int _rowIndex = -1;
+
+ // Holds for each row the states of the child components of this UIData.
+ // Note that only "partial" component state is saved: the component fields
+ // that are expected to vary between rows.
+ private Map _rowStates = new HashMap();
+
+ /**
+ * Handle case where this table is nested inside another table.
+ * See method getDataModel for more details.
+ * <p>
+ * Key: parentClientId (aka rowId when nested within a parent table)
+ * Value: DataModel
+ */
+ private Map _dataModelMap = new HashMap();
+
+ // will be set to false if the data should not be refreshed at the beginning of the encode phase
+ private boolean _isValidChilds = true;
+
+ private Object _initialDescendantComponentState = null;
+
+ @Override
+ public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
+ if (context == null || clientId == null || callback == null) {
+ throw new NullPointerException();
+ }
+
+ //searching for this component?
+ boolean returnValue = this.getClientId(context).equals(clientId);
+
+ if (returnValue) {
+ try {
+ callback.invokeContextCallback(context, this);
+ } catch (Exception e) {
+ throw new FacesException(e);
+ }
+ return returnValue;
+ }
+
+ //Now Look throught facets on this UIComponent
+ for (Iterator<UIComponent> it = this.getFacets().values().iterator(); !returnValue && it.hasNext();) {
+ returnValue = it.next().invokeOnComponent(context, clientId, callback);
+ }
+
+ if (returnValue == true)
+ return returnValue;
+
+ //Now we have to check if it is searching an inner component
+ String baseClientId = super.getClientId(context);
+
+ //First check if the clientId starts with the baseClientId of
+ //this component, to check if continue trying to find the component
+ //inside the children of this component.
+ if (clientId.matches(baseClientId + ":[0-9]+:.*")) {
+
+ String subId = clientId.substring(baseClientId.length() + 1);
+ String clientRow = subId.substring(0, subId.indexOf(':'));
+
+ //Now we save the current position
+ int oldRow = this.getRowIndex();
+
+ //The conversion is safe, because its already checked on the
+ //regular expresion
+ this.setRowIndex(Integer.parseInt(clientRow));
+
+ for (Iterator<UIComponent> it1 = getChildren().iterator(); !returnValue && it1.hasNext();) {
+ //recursive call to find the component
+ UIComponent child = it1.next();
+ returnValue = child.invokeOnComponent(context, clientId, callback);
+ }
+
+ //Restore the old position. Doing this prevent
+ //side effects.
+ this.setRowIndex(oldRow);
+ } else {
+ //The component that matches this clientId must be outside
+ //of this component
+ return false;
+ }
+
+ return returnValue;
+ }
+
+ public void setFooter(UIComponent footer)
+ {
+ getFacets().put(FOOTER_FACET_NAME, footer);
+ }
+
+ public UIComponent getFooter()
+ {
+ return (UIComponent) getFacets().get(FOOTER_FACET_NAME);
+ }
+
+ public void setHeader(UIComponent header)
+ {
+ getFacets().put(HEADER_FACET_NAME, header);
+ }
+
+ public UIComponent getHeader()
+ {
+ return (UIComponent) getFacets().get(HEADER_FACET_NAME);
+ }
+
+ public boolean isRowAvailable()
+ {
+ return getDataModel().isRowAvailable();
+ }
+
+ public int getRowCount()
+ {
+ return getDataModel().getRowCount();
+ }
+
+ public Object getRowData()
+ {
+ return getDataModel().getRowData();
+ }
+
+ public int getRowIndex()
+ {
+ return _rowIndex;
+ }
+
+ /**
+ * Set the current row index that methods like getRowData use.
+ * <p>
+ * Param rowIndex can be -1, meaning "no row".
+ * <p>
+ * @param rowIndex
+ */
+ public void setRowIndex(int rowIndex)
+ {
+ if (rowIndex < -1)
+ {
+ throw new IllegalArgumentException("rowIndex is less than -1");
+ }
+
+ if (_rowIndex == rowIndex)
+ {
+ return;
+ }
+
+ FacesContext facesContext = getFacesContext();
+
+ if (_rowIndex == -1)
+ {
+ if (_initialDescendantComponentState == null)
+ {
+ // Create a template that can be used to initialise any row
+ // that we haven't visited before, ie a "saved state" that can
+ // be pushed to the "restoreState" method of all the child
+ // components to set them up to represent a clean row.
+ _initialDescendantComponentState = saveDescendantComponentStates(
+ getChildren().iterator(), false);
+ }
+ }
+ else
+ {
+ // We are currently positioned on some row, and are about to
+ // move off it, so save the (partial) state of the components
+ // representing the current row. Later if this row is revisited
+ // then we can restore this state.
+ _rowStates.put(getClientId(facesContext),
+ saveDescendantComponentStates(getChildren().iterator(),
+ false));
+ }
+
+ _rowIndex = rowIndex;
+
+ DataModel dataModel = getDataModel();
+ dataModel.setRowIndex(rowIndex);
+
+ String var = _var;
+ if (rowIndex == -1)
+ {
+ if (var != null)
+ {
+ facesContext.getExternalContext().getRequestMap().remove(var);
+ }
+ }
+ else
+ {
+ if (var != null)
+ {
+ if (isRowAvailable())
+ {
+ Object rowData = dataModel.getRowData();
+ facesContext.getExternalContext().getRequestMap().put(var,
+ rowData);
+ }
+ else
+ {
+ facesContext.getExternalContext().getRequestMap().remove(
+ var);
+ }
+ }
+ }
+
+ if (_rowIndex == -1)
+ {
+ // reset components to initial state
+ restoreDescendantComponentStates(getChildren().iterator(),
+ _initialDescendantComponentState, false);
+ }
+ else
+ {
+ Object rowState = _rowStates.get(getClientId(facesContext));
+ if (rowState == null)
+ {
+ // We haven't been positioned on this row before, so just
+ // configure the child components of this component with
+ // the standard "initial" state
+ restoreDescendantComponentStates(getChildren().iterator(),
+ _initialDescendantComponentState, false);
+ }
+ else
+ {
+ // We have been positioned on this row before, so configure
+ // the child components of this component with the (partial)
+ // state that was previously saved. Fields not in the
+ // partial saved state are left with their original values.
+ restoreDescendantComponentStates(getChildren().iterator(),
+ rowState, false);
+ }
+ }
+ }
+
+ /**
+ * Overwrite the state of the child components of this component
+ * with data previously saved by method saveDescendantComponentStates.
+ * <p>
+ * The saved state info only covers those fields that are expected to
+ * vary between rows of a table. Other fields are not modified.
+ */
+ private void restoreDescendantComponentStates(Iterator childIterator,
+ Object state, boolean restoreChildFacets)
+ {
+ Iterator descendantStateIterator = null;
+ while (childIterator.hasNext())
+ {
+ if (descendantStateIterator == null && state != null)
+ {
+ descendantStateIterator = ((Collection) state).iterator();
+ }
+ UIComponent component = (UIComponent) childIterator.next();
+
+ // reset the client id (see spec 3.1.6)
+ component.setId(component.getId());
+ if(!component.isTransient())
+ {
+ Object childState = null;
+ Object descendantState = null;
+ if (descendantStateIterator != null
+ && descendantStateIterator.hasNext())
+ {
+ Object[] object = (Object[]) descendantStateIterator.next();
+ childState = object[0];
+ descendantState = object[1];
+ }
+ if (component instanceof EditableValueHolder)
+ {
+ ((EditableValueHolderState) childState)
+ .restoreState((EditableValueHolder) component);
+ }
+ Iterator childsIterator;
+ if (restoreChildFacets)
+ {
+ childsIterator = component.getFacetsAndChildren();
+ }
+ else
+ {
+ childsIterator = component.getChildren().iterator();
+ }
+ restoreDescendantComponentStates(childsIterator, descendantState,
+ true);
+ }
+ }
+ }
+
+ /**
+ * Walk the tree of child components of this UIData, saving the parts of
+ * their state that can vary between rows.
+ * <p>
+ * This is very similar to the process that occurs for normal components
+ * when the view is serialized. Transient components are skipped (no
+ * state is saved for them).
+ * <p>
+ * If there are no children then null is returned. If there are one or
+ * more children, and all children are transient then an empty collection
+ * is returned; this will happen whenever a table contains only read-only
+ * components.
+ * <p>
+ * Otherwise a collection is returned which contains an object for every
+ * non-transient child component; that object may itself contain a collection
+ * of the state of that child's child components.
+ */
+ private Object saveDescendantComponentStates(Iterator childIterator,
+ boolean saveChildFacets)
+ {
+ Collection childStates = null;
+ while (childIterator.hasNext())
+ {
+ if (childStates == null)
+ {
+ childStates = new ArrayList();
+ }
+ UIComponent child = (UIComponent) childIterator.next();
+ if(!child.isTransient())
+ {
+ // Add an entry to the collection, being an array of two
+ // elements. The first element is the state of the children
+ // of this component; the second is the state of the current
+ // child itself.
+
+ Iterator childsIterator;
+ if (saveChildFacets)
+ {
+ childsIterator = child.getFacetsAndChildren();
+ }
+ else
+ {
+ childsIterator = child.getChildren().iterator();
+ }
+ Object descendantState = saveDescendantComponentStates(
+ childsIterator, true);
+ Object state = null;
+ if (child instanceof EditableValueHolder)
+ {
+ state = new EditableValueHolderState(
+ (EditableValueHolder) child);
+ }
+ childStates.add(new Object[] { state, descendantState });
+ }
+ }
+ return childStates;
+ }
+
+ @Override
+ public void setValueExpression(String name, ValueExpression binding) {
+ if (name == null)
+ {
+ throw new NullPointerException("name");
+ }
+ else if (name.equals("value"))
+ {
+ _dataModelMap.clear();
+ }
+ else if (name.equals("rowIndex"))
+ {
+ throw new IllegalArgumentException("name " + name);
+ }
+ super.setValueExpression(name, binding);
+ }
+
+ @Override
+ public String getClientId(FacesContext context)
+ {
+ String clientId = super.getClientId(context);
+ int rowIndex = getRowIndex();
+ if (rowIndex == -1)
+ {
+ return clientId;
+ }
+
+ StringBuilder bld = __getSharedStringBuilder();
+ return bld.append(clientId).append(NamingContainer.SEPARATOR_CHAR).append(rowIndex).toString();
+ }
+
+ /**
+ * Modify events queued for any child components so that the
+ * UIData state will be correctly configured before the event's
+ * listeners are executed.
+ * <p>
+ * Child components or their renderers may register events against
+ * those child components. When the listener for that event is
+ * eventually invoked, it may expect the uidata's rowData and
+ * rowIndex to be referring to the same object that caused the
+ * event to fire.
+ * <p>
+ * The original queueEvent call against the child component has been
+ * forwarded up the chain of ancestors in the standard way, making
+ * it possible here to wrap the event in a new event whose source
+ * is <i>this</i> component, not the original one. When the event
+ * finally is executed, this component's broadcast method is invoked,
+ * which ensures that the UIData is set to be at the correct row
+ * before executing the original event.
+ */
+ @Override
+ public void queueEvent(FacesEvent event)
+ {
+ super.queueEvent(new FacesEventWrapper(event, getRowIndex(), this));
+ }
+
+ /**
+ * Ensure that before the event's listeners are invoked this UIData
+ * component's "current row" is set to the row associated with the event.
+ * <p>
+ * See queueEvent for more details.
+ */
+ @Override
+ public void broadcast(FacesEvent event) throws AbortProcessingException
+ {
+ if (event instanceof FacesEventWrapper)
+ {
+ FacesEvent originalEvent = ((FacesEventWrapper) event)
+ .getWrappedFacesEvent();
+ int eventRowIndex = ((FacesEventWrapper) event).getRowIndex();
+ int currentRowIndex = getRowIndex();
+ setRowIndex(eventRowIndex);
+ try
+ {
+ originalEvent.getComponent().broadcast(originalEvent);
+ }
+ finally
+ {
+ setRowIndex(currentRowIndex);
+ }
+ }
+ else
+ {
+ super.broadcast(event);
+ }
+ }
+
+ /**
+ * Perform necessary actions when rendering of this component starts,
+ * before delegating to the inherited implementation which calls the
+ * associated renderer's encodeBegin method.
+ */
+ @Override
+ public void encodeBegin(FacesContext context) throws IOException
+ {
+ _initialDescendantComponentState = null;
+ if (_isValidChilds && !hasErrorMessages(context))
+ {
+ // Clear the data model so that when rendering code calls
+ // getDataModel a fresh model is fetched from the backing
+ // bean via the value-binding.
+ _dataModelMap.clear();
+
+ // When the data model is cleared it is also necessary to
+ // clear the saved row state, as there is an implicit 1:1
+ // relation between objects in the _rowStates and the
+ // corresponding DataModel element.
+ _rowStates.clear();
+ }
+ super.encodeBegin(context);
+ }
+
+ private boolean hasErrorMessages(FacesContext context)
+ {
+ for(Iterator iter = context.getMessages(); iter.hasNext();)
+ {
+ FacesMessage message = (FacesMessage) iter.next();
+ if(FacesMessage.SEVERITY_ERROR.compareTo(message.getSeverity()) <= 0)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @see javax.faces.component.UIComponentBase#encodeEnd(javax.faces.context.FacesContext)
+ */
+ @Override
+ public void encodeEnd(FacesContext context) throws IOException
+ {
+ setRowIndex(-1);
+ super.encodeEnd(context);
+ }
+
+ @Override
+ public void processDecodes(FacesContext context)
+ {
+ if (context == null)
+ throw new NullPointerException("context");
+ if (!isRendered())
+ return;
+ setRowIndex(-1);
+ processFacets(context, PROCESS_DECODES);
+ processColumnFacets(context, PROCESS_DECODES);
+ processColumnChildren(context, PROCESS_DECODES);
+ setRowIndex(-1);
+ try
+ {
+ decode(context);
+ }
+ catch (RuntimeException e)
+ {
+ context.renderResponse();
+ throw e;
+ }
+ }
+
+ @Override
+ public void processValidators(FacesContext context)
+ {
+ if (context == null)
+ throw new NullPointerException("context");
+ if (!isRendered())
+ return;
+ setRowIndex(-1);
+ processFacets(context, PROCESS_VALIDATORS);
+ processColumnFacets(context, PROCESS_VALIDATORS);
+ processColumnChildren(context, PROCESS_VALIDATORS);
+ setRowIndex(-1);
+
+ // check if an validation error forces the render response for our data
+ if (context.getRenderResponse())
+ {
+ _isValidChilds = false;
+ }
+ }
+
+ @Override
+ public void processUpdates(FacesContext context)
+ {
+ if (context == null)
+ throw new NullPointerException("context");
+ if (!isRendered())
+ return;
+ setRowIndex(-1);
+ processFacets(context, PROCESS_UPDATES);
+ processColumnFacets(context, PROCESS_UPDATES);
+ processColumnChildren(context, PROCESS_UPDATES);
+ setRowIndex(-1);
+
+ if (context.getRenderResponse())
+ {
+ _isValidChilds = false;
+ }
+ }
+
+ private void processFacets(FacesContext context, int processAction)
+ {
+ for (Iterator it = getFacets().values().iterator(); it.hasNext();)
+ {
+ UIComponent facet = (UIComponent) it.next();
+ process(context, facet, processAction);
+ }
+ }
+
+ /**
+ * Invoke the specified phase on all facets of all UIColumn children
+ * of this component. Note that no methods are called on the UIColumn
+ * child objects themselves.
+ *
+ * @param context is the current faces context.
+ * @param processAction specifies a JSF phase: decode, validate or update.
+ */
+ private void processColumnFacets(FacesContext context, int processAction)
+ {
+ for (Iterator childIter = getChildren().iterator(); childIter.hasNext();)
+ {
+ UIComponent child = (UIComponent) childIter.next();
+ if (child instanceof UIColumn)
+ {
+ if (!child.isRendered())
+ {
+ //Column is not visible
+ continue;
+ }
+ for (Iterator facetsIter = child.getFacets().values()
+ .iterator(); facetsIter.hasNext();)
+ {
+ UIComponent facet = (UIComponent) facetsIter.next();
+ process(context, facet, processAction);
+ }
+ }
+ }
+ }
+
+ /**
+ * Invoke the specified phase on all non-facet children of all UIColumn
+ * children of this component. Note that no methods are called on the
+ * UIColumn child objects themselves.
+ *
+ * @param context is the current faces context.
+ * @param processAction specifies a JSF phase: decode, validate or update.
+ */
+ private void processColumnChildren(FacesContext context, int processAction)
+ {
+ int first = getFirst();
+ int rows = getRows();
+ int last;
+ if (rows == 0)
+ {
+ last = getRowCount();
+ }
+ else
+ {
+ last = first + rows;
+ }
+ for (int rowIndex = first; last==-1 || rowIndex < last; rowIndex++)
+ {
+ setRowIndex(rowIndex);
+
+ //scrolled past the last row
+ if (!isRowAvailable())
+ break;
+
+ for (Iterator it = getChildren().iterator(); it.hasNext();)
+ {
+ UIComponent child = (UIComponent) it.next();
+ if (child instanceof UIColumn)
+ {
+ if (!child.isRendered())
+ {
+ //Column is not visible
+ continue;
+ }
+ for (Iterator columnChildIter = child.getChildren()
+ .iterator(); columnChildIter.hasNext();)
+ {
+ UIComponent columnChild = (UIComponent) columnChildIter
+ .next();
+ process(context, columnChild, processAction);
+ }
+ }
+ }
+ }
+ }
+
+ private void process(FacesContext context, UIComponent component,
+ int processAction)
+ {
+ switch (processAction)
+ {
+ case PROCESS_DECODES:
+ component.processDecodes(context);
+ break;
+ case PROCESS_VALIDATORS:
+ component.processValidators(context);
+ break;
+ case PROCESS_UPDATES:
+ component.processUpdates(context);
+ break;
+ }
+ }
+
+ /**
+ * Return the datamodel for this table, potentially fetching the data from
+ * a backing bean via a value-binding if this is the first time this method
+ * has been called.
+ * <p>
+ * This is complicated by the fact that this table may be nested within
+ * another table. In this case a different datamodel should be fetched
+ * for each row. When nested within a parent table, the parent reference
+ * won't change but parent.getClientId() will, as the suffix changes
+ * depending upon the current row index. A map object on this component
+ * is therefore used to cache the datamodel for each row of the table.
+ * In the normal case where this table is not nested inside a component
+ * that changes its id (like a table does) then this map only ever has
+ * one entry.
+ */
+ protected DataModel getDataModel()
+ {
+ DataModel dataModel;
+ String clientID = "";
+
+ UIComponent parent = getParent();
+ if (parent != null) {
+ clientID = parent.getClientId(getFacesContext());
+ }
+ dataModel = (DataModel) _dataModelMap.get(clientID);
+ if (dataModel == null)
+ {
+ dataModel = createDataModel();
+ _dataModelMap.put(clientID, dataModel);
+ }
+ return dataModel;
+ }
+
+ protected void setDataModel(DataModel dataModel)
+ {
+ throw new UnsupportedOperationException(
+ "this method is here only to maintain binary compatibility w/ the RI");
+ }
+
+ /**
+ * Evaluate this object's value property and convert the result into a
+ * DataModel. Normally this object's value property will be a value-binding
+ * which will cause the value to be fetched from some backing bean.
+ * <p>
+ * The result of fetching the value may be a DataModel object, in which
+ * case that object is returned directly. If the value is of type
+ * List, Array, ResultSet, Result, other object or null then an appropriate
+ * wrapper is created and returned.
+ * <p>
+ * Null is never returned by this method.
+ */
+ private DataModel createDataModel()
+ {
+ Object value = getValue();
+
+ if (value == null)
+ {
+ return EMPTY_DATA_MODEL;
+ }
+ else if (value instanceof DataModel)
+ {
+ return (DataModel) value;
+ }
+ else if (value instanceof List)
+ {
+ return new ListDataModel((List) value);
+ }
+ else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass()))
+ {
+ return new ArrayDataModel((Object[]) value);
+ }
+ else if (value instanceof ResultSet)
+ {
+ return new ResultSetDataModel((ResultSet) value);
+ }
+ else if (value instanceof Result)
+ {
+ return new ResultDataModel((Result) value);
+ }
+ else
+ {
+ return new ScalarDataModel(value);
+ }
+ }
+
+ private static class FacesEventWrapper extends FacesEvent
+ {
+ private static final long serialVersionUID = 6648047974065628773L;
+ private FacesEvent _wrappedFacesEvent;
+ private int _rowIndex;
+
+ public FacesEventWrapper(FacesEvent facesEvent, int rowIndex,
+ UIData redirectComponent)
+ {
+ super(redirectComponent);
+ _wrappedFacesEvent = facesEvent;
+ _rowIndex = rowIndex;
+ }
+
+ @Override
+ public PhaseId getPhaseId()
+ {
+ return _wrappedFacesEvent.getPhaseId();
+ }
+
+ @Override
+ public void setPhaseId(PhaseId phaseId)
+ {
+ _wrappedFacesEvent.setPhaseId(phaseId);
+ }
+
+ @Override
+ public void queue()
+ {
+ _wrappedFacesEvent.queue();
+ }
+
+ @Override
+ public String toString()
+ {
+ return _wrappedFacesEvent.toString();
+ }
+
+ @Override
+ public boolean isAppropriateListener(FacesListener faceslistener)
+ {
+ return _wrappedFacesEvent.isAppropriateListener(faceslistener);
+ }
+
+ @Override
+ public void processListener(FacesListener faceslistener)
+ {
+ _wrappedFacesEvent.processListener(faceslistener);
+ }
+
+ public FacesEvent getWrappedFacesEvent()
+ {
+ return _wrappedFacesEvent;
+ }
+
+ public int getRowIndex()
+ {
+ return _rowIndex;
+ }
+ }
+
+ public void setValue(Object value)
+ {
+ _value = value;
+ _dataModelMap.clear();
+ _rowStates.clear();
+ _isValidChilds = true;
+ }
+
+ /**
+ * Set the maximum number of rows displayed in the table.
+ */
+ public void setRows(int rows)
+ {
+ if (rows < 0){
+ throw new IllegalArgumentException("rows: " + rows);
+ }
+ _rows = rows;
+ _rowsSet = true;
+ }
+
+ /**
+ * Set the index of the first row to be displayed, where 0 is the first row.
+ */
+ public void setFirst(int first)
+ {
+ if (first < 0) {
+ throw new IllegalArgumentException("Illegal value for first row: " + first);
+ }
+ _first = first;
+ _firstSet=true;
+ }
+
+ private static final DataModel EMPTY_DATA_MODEL = new DataModel()
+ {
+ @Override
+ public boolean isRowAvailable()
+ {
+ return false;
+ }
+
+ @Override
+ public int getRowCount()
+ {
+ return 0;
+ }
+
+ @Override
+ public Object getRowData()
+ {
+ throw new IllegalArgumentException();
+ }
+
+ @Override
+ public int getRowIndex()
+ {
+ return -1;
+ }
+
+ @Override
+ public void setRowIndex(int i)
+ {
+ if (i < -1)
+ throw new IllegalArgumentException();
+ }
+
+ @Override
+ public Object getWrappedData()
+ {
+ return null;
+ }
+
+ @Override
+ public void setWrappedData(Object obj)
+ {
+ if (obj == null)
+ return; //Clearing is allowed
+ throw new UnsupportedOperationException(this.getClass().getName()
+ + " UnsupportedOperationException");
+ }
+ };
+
+ private class EditableValueHolderState
+ {
+ private final Object _value;
+ private final boolean _localValueSet;
+ private final boolean _valid;
+ private final Object _submittedValue;
+
+ public EditableValueHolderState(EditableValueHolder evh)
+ {
+ _value = evh.getLocalValue();
+ _localValueSet = evh.isLocalValueSet();
+ _valid = evh.isValid();
+ _submittedValue = evh.getSubmittedValue();
+ }
+
+ public void restoreState(EditableValueHolder evh)
+ {
+ evh.setValue(_value);
+ evh.setLocalValueSet(_localValueSet);
+ evh.setValid(_valid);
+ evh.setSubmittedValue(_submittedValue);
+ }
+ }
+
+ // Property: value
+ private Object _value;
+
+ /**
+ * Gets An EL expression that specifies the data model that backs this table. The value can be of any type.
+ *
+ * A value of type DataModel is used directly. Array-like parameters of type java.util.List, array of Object,
+ * java.sql.ResultSet, or javax.servlet.jsp.jstl.sql.Result are wrapped in a DataModel.
+ *
+ * Other values are wrapped in a DataModel as a single row.
+ *
+ * @return the new value value
+ */
+ @JSFProperty
+ public Object getValue()
+ {
+ if (_value != null)
+ {
+ return _value;
+ }
+ ValueExpression expression = getValueExpression("value");
+ if (expression != null)
+ {
+ return expression.getValue(getFacesContext().getELContext());
+ }
+ return null;
+ }
+
+ // Property: var
+ private String _var;
+
+ /**
+ * Gets Defines the name of the request-scope variable that will hold the current row during iteration. This value must be a static value.
+ *
+ * @return the new var value
+ */
+ @JSFProperty
+ (literalOnly = true)
+ public String getVar()
+ {
+ return _var;
+ }
+
+ /**
+ * Sets Defines the name of the request-scope variable that will hold the current row during iteration. This value must be a static value.
+ *
+ * @param var the new var value
+ */
+ public void setVar(String var)
+ {
+ this._var = var;
+ }
+
+ // Property: rows
+ private int _rows;
+ private boolean _rowsSet;
+
+ /**
+ * Gets The number of rows to be displayed. Specify zero for all remaining rows in the table.
+ *
+ * @return the new rows value
+ */
+ @JSFProperty
+ public int getRows()
+ {
+ if (_rowsSet)
+ {
+ return _rows;
+ }
+ ValueExpression expression = getValueExpression("rows");
+ if (expression != null)
+ {
+ return (Integer)expression.getValue(getFacesContext().getELContext());
+ }
+ return 0;
+ }
+
+ // Property: first
+ private int _first;
+ private boolean _firstSet;
+
+ /**
+ * Gets The index of the first row to be displayed, where 0 is the first row.
+ *
+ * @return the new first value
+ */
+ @JSFProperty
+ public int getFirst()
+ {
+ if (_firstSet)
+ {
+ return _first;
+ }
+ ValueExpression expression = getValueExpression("first");
+ if (expression != null)
+ {
+ return (Integer)expression.getValue(getFacesContext().getELContext());
+ }
+ return 0;
+ }
+
+ @Override
+ public Object saveState(FacesContext facesContext)
+ {
+ Object[] values = new Object[7];
+ values[0] = super.saveState(facesContext);
+ values[1] = _value;
+ values[2] = _var;
+ values[3] = _rows;
+ values[4] = _rowsSet;
+ values[5] = _first;
+ values[6] = _firstSet;
+
+ return values;
+ }
+
+ @Override
+ public void restoreState(FacesContext facesContext, Object state)
+ {
+ Object[] values = (Object[])state;
+ super.restoreState(facesContext,values[0]);
+ _value = values[1];
+ _var = (String)values[2];
+ _rows = (Integer)values[3];
+ _rowsSet = (Boolean)values[4];
+ _first = (Integer)values[5];
+ _firstSet = (Boolean)values[6];
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIData.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIGraphic.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIGraphic.java?rev=662960&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIGraphic.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIGraphic.java Tue Jun 3 20:15:04 2008
@@ -0,0 +1,155 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package javax.faces.component;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
+/**
+ *
+ * Displays a graphical image.
+ */
+@JSFComponent
+(defaultRendererType = "javax.faces.Image"
+)
+public class UIGraphic extends UIComponentBase
+{
+
+ static public final String COMPONENT_FAMILY =
+ "javax.faces.Graphic";
+ static public final String COMPONENT_TYPE =
+ "javax.faces.Graphic";
+
+ /**
+ * Construct an instance of the UIGraphic.
+ */
+ public UIGraphic()
+ {
+ setRendererType("javax.faces.Image");
+ }
+ private static final String URL_PROPERTY = "url";
+ private static final String VALUE_PROPERTY = "value";
+
+
+ public void setUrl(String url)
+ {
+ setValue(url);
+ }
+
+ @JSFProperty
+ public String getUrl()
+ {
+ return (String)getValue();
+ }
+
+ @Override
+ public ValueExpression getValueExpression(String name)
+ {
+ if (URL_PROPERTY.equals(name))
+ {
+ return super.getValueExpression(VALUE_PROPERTY);
+ }
+ else
+ {
+ return super.getValueExpression(name);
+ }
+ }
+
+ @Override
+ public void setValueExpression(String name,
+ ValueExpression binding)
+ {
+ if (URL_PROPERTY.equals(name))
+ {
+ super.setValueExpression(VALUE_PROPERTY, binding);
+ }
+ else
+ {
+ super.setValueExpression(name, binding);
+ }
+ }
+
+ // Property: value
+ private Object _value;
+
+ /**
+ * Gets The value property of the UIGraphic
+ *
+ * @return the new value value
+ */
+ @JSFProperty
+ public Object getValue()
+ {
+ if (_value != null)
+ {
+ return _value;
+ }
+ ValueExpression expression = getValueExpression("value");
+ if (expression != null)
+ {
+ return expression.getValue(getFacesContext().getELContext());
+ }
+ return null;
+ }
+
+ /**
+ * Sets The value property of the UIGraphic
+ *
+ * @param value the new value value
+ */
+ public void setValue(Object value)
+ {
+ this._value = value;
+ }
+
+ // Property: url
+ private String _url;
+
+ @Override
+ public Object saveState(FacesContext facesContext)
+ {
+ Object[] values = new Object[3];
+ values[0] = super.saveState(facesContext);
+ values[1] = _value;
+ values[2] = _url;
+
+ return values;
+ }
+
+ @Override
+ public void restoreState(FacesContext facesContext, Object state)
+ {
+ Object[] values = (Object[])state;
+ super.restoreState(facesContext,values[0]);
+ _value = values[1];
+ _url = (String)values[2];
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIGraphic.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIInput.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIInput.java?rev=662960&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIInput.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIInput.java Tue Jun 3 20:15:04 2008
@@ -0,0 +1,912 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package javax.faces.component;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.el.EvaluationException;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.event.ValueChangeListener;
+import javax.faces.render.Renderer;
+import javax.faces.validator.Validator;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
+/**
+ *
+ * UICommand is a base abstraction for components that implement ActionSource.
+ *
+ * <h4>Events:</h4>
+ * <table border="1" width="100%" cellpadding="3" summary="">
+ * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
+ * <th align="left">Type</th>
+ * <th align="left">Phases</th>
+ * <th align="left">Description</th>
+ * </tr>
+ * <tr class="TableRowColor">
+ * <td valign="top"><code>javax.faces.event.ValueChangeEvent</code></td>
+ * <td valign="top" nowrap></td>
+ * <td valign="top">The valueChange event is delivered when the value
+ attribute is changed.</td>
+ * </tr>
+ * </table>
+ */
+@JSFComponent
+(defaultRendererType = "javax.faces.Text"
+)
+public class UIInput extends UIOutput
+ implements EditableValueHolder
+{
+
+ static public final String COMPONENT_FAMILY =
+ "javax.faces.Input";
+ static public final String COMPONENT_TYPE =
+ "javax.faces.Input";
+
+ /**
+ * Construct an instance of the UIInput.
+ */
+ public UIInput()
+ {
+ setRendererType("javax.faces.Text");
+ }
+ public static final String CONVERSION_MESSAGE_ID = "javax.faces.component.UIInput.CONVERSION";
+ public static final String REQUIRED_MESSAGE_ID = "javax.faces.component.UIInput.REQUIRED";
+ public static final String UPDATE_MESSAGE_ID = "javax.faces.component.UIInput.UPDATE";
+ private static final String ERROR_HANDLING_EXCEPTION_LIST = "org.apache.myfaces.errorHandling.exceptionList";
+
+ /**
+ * Store the specified object as the "local value" of this component.
+ * The value-binding named "value" (if any) is ignored; the object is
+ * only stored locally on this component. During the "update model"
+ * phase, if there is a value-binding named "value" then this local
+ * value will be stored via that value-binding and the "local value"
+ * reset to null.
+ */
+ public void setValue(Object value)
+ {
+ setLocalValueSet(true);
+ super.setValue(value);
+ }
+
+ /**
+ * Set the "submitted value" of this component from the relevant data
+ * in the current servet request object.
+ * <p>
+ * If this component is not rendered, then do nothing; no output would
+ * have been sent to the client so no input is expected.
+ * <p>
+ * Invoke the inherited functionality, which typically invokes the
+ * renderer associated with this component to extract and set this
+ * component's "submitted value".
+ * <p>
+ * If this component is marked "immediate", then immediately apply
+ * validation to the submitted value found. On error, call context
+ * method "renderResponse" which will force processing to leap to
+ * the "render response" phase as soon as the "decode" step has
+ * completed for all other components.
+ */
+ public void processDecodes(FacesContext context)
+ {
+ if (context == null) throw new NullPointerException("context");
+ if (!isRendered()) return;
+ super.processDecodes(context);
+ if (isImmediate())
+ {
+ try
+ {
+ validate(context);
+ }
+ catch (RuntimeException e)
+ {
+ context.renderResponse();
+ throw e;
+ }
+ if (!isValid())
+ {
+ context.renderResponse();
+ }
+ }
+ }
+
+ public void processValidators(FacesContext context)
+ {
+ if (context == null) throw new NullPointerException("context");
+ if (!isRendered()) return;
+
+ super.processValidators(context);
+
+ if (!isImmediate())
+ {
+ try
+ {
+ validate(context);
+ }
+ catch (RuntimeException e)
+ {
+ context.renderResponse();
+ throw e;
+ }
+ if (!isValid())
+ {
+ context.renderResponse();
+ }
+ }
+ }
+
+ public void processUpdates(FacesContext context)
+ {
+ if (context == null) throw new NullPointerException("context");
+ if (!isRendered()) return;
+
+ super.processUpdates(context);
+
+ try
+ {
+ updateModel(context);
+ }
+ catch (RuntimeException e)
+ {
+ context.renderResponse();
+ throw e;
+ }
+ if (!isValid())
+ {
+ context.renderResponse();
+ }
+ }
+
+ public void decode(FacesContext context)
+ {
+ //We (re)set to valid, so that component automatically gets (re)validated
+ setValid(true);
+ super.decode(context);
+ }
+
+ public void broadcast(FacesEvent event)
+ throws AbortProcessingException
+ {
+ if (!(event instanceof ValueChangeEvent))
+ {
+ throw new IllegalArgumentException("FacesEvent of class " + event.getClass().getName() + " not supported by UIInput");
+ }
+
+ // invoke standard listeners attached to this component first
+ super.broadcast(event);
+
+ // invoke the single listener defined directly on the component
+ MethodBinding valueChangeListenerBinding = getValueChangeListener();
+ if (valueChangeListenerBinding != null)
+ {
+ try
+ {
+ valueChangeListenerBinding.invoke(getFacesContext(),
+ new Object[]{event});
+ }
+ catch (EvaluationException e)
+ {
+ Throwable cause = e.getCause();
+ if (cause != null && cause instanceof AbortProcessingException)
+ {
+ throw (AbortProcessingException)cause;
+ }
+ else
+ {
+ throw e;
+ }
+ }
+ }
+ }
+
+ public void updateModel(FacesContext context)
+ {
+ if (!isValid()) return;
+ if (!isLocalValueSet()) return;
+ ValueExpression expression = getValueExpression("value");
+ if (expression == null) return;
+ try
+ {
+ expression.setValue(context.getELContext(), getLocalValue());
+ setValue(null);
+ setLocalValueSet(false);
+ }
+ catch (Exception e)
+ {
+ context.getExternalContext().log(e.getMessage(), e);
+ _MessageUtils.addErrorMessage(context, this, UPDATE_MESSAGE_ID, new Object[]{_MessageUtils.getLabel(context,this)});
+ setValid(false);
+
+ /* we are not allowed to throw exceptions here - we still need the full stack-trace later on
+ * to process it later in our error-handler
+ */
+ queueExceptionInRequest(context, expression, e);
+ }
+ }
+
+ /**
+ * For development and production, we want to offer a single point
+ * to which error-handlers can attach. So we queue up all ocurring
+ * exceptions and later pass them to the configured error-handler.
+ *
+ * @param context
+ * @param expression
+ * @param e
+ */
+ private void queueExceptionInRequest(FacesContext context, ValueExpression expression, Exception e) {
+ List li = (List) context.getExternalContext().getRequestMap().get(ERROR_HANDLING_EXCEPTION_LIST);
+ if(null==li) {
+ li = new ArrayList();
+ context.getExternalContext().getRequestMap().put(ERROR_HANDLING_EXCEPTION_LIST, li);
+
+ li.add(new FacesException("Exception while setting value for expression : "+
+ expression.getExpressionString()+" of component with path : "
+ + _ComponentUtils.getPathToComponent(this),e));
+ }
+ }
+
+ protected void validateValue(FacesContext context,Object convertedValue)
+ {
+ boolean empty = convertedValue == null ||
+ (convertedValue instanceof String
+ && ((String)convertedValue).length() == 0);
+
+ if (isRequired() && empty)
+ {
+ if(getRequiredMessage() != null) {
+ String requiredMessage = getRequiredMessage();
+ context.addMessage(this.getClientId(context),new FacesMessage(FacesMessage.SEVERITY_ERROR,requiredMessage,requiredMessage));
+ } else {
+ _MessageUtils.addErrorMessage(context, this, REQUIRED_MESSAGE_ID,new Object[]{_MessageUtils.getLabel(context,this)});
+ }
+ setValid(false);
+ return;
+ }
+
+ if (!empty)
+ {
+ _ComponentUtils.callValidators(context, this, convertedValue);
+ }
+
+ }
+
+ /**
+ * Determine whether the new value is valid, and queue a ValueChangeEvent
+ * if necessary.
+ * <p>
+ * The "submitted value" is converted to the necessary type; conversion
+ * failure is reported as an error and validation processing terminates
+ * for this component. See documentation for method getConvertedValue
+ * for details on the conversion process.
+ * <p>
+ * Any validators attached to this component are then run, passing
+ * the converted value.
+ * <p>
+ * The old value of this component is then fetched (possibly involving
+ * the evaluation of a value-binding expression, ie invoking a method
+ * on a user object). The old value is compared to the new validated
+ * value, and if they are different then a ValueChangeEvent is queued
+ * for later processing.
+ * <p>
+ * On successful completion of this method:
+ * <ul>
+ * <li> isValid() is true
+ * <li> isLocalValueSet() is true
+ * <li> submittedValue is reset to null
+ * <li> a ValueChangeEvent is queued if the new value != old value
+ * </ul>
+ */
+ public void validate(FacesContext context)
+ {
+ if (context == null) throw new NullPointerException("context");
+
+ try {
+
+ Object submittedValue = getSubmittedValue();
+ if (submittedValue == null) return;
+
+ Object convertedValue = getConvertedValue(context, submittedValue);
+
+ if (!isValid()) return;
+
+ validateValue(context, convertedValue);
+
+ if (!isValid()) return;
+
+ Object previousValue = getValue();
+ setValue(convertedValue);
+ setSubmittedValue(null);
+ if (compareValues(previousValue, convertedValue))
+ {
+ queueEvent(new ValueChangeEvent(this, previousValue, convertedValue));
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new FacesException("Exception while validating component with path : "+_ComponentUtils.getPathToComponent(this),ex);
+ }
+
+ }
+
+ /**
+ * Convert the provided object to the desired value.
+ * <p>
+ * If there is a renderer for this component, then call the renderer's
+ * getConvertedValue method. While this can of course be implemented in
+ * any way the renderer desires, it typically performs exactly the same
+ * processing that this method would have done anyway (ie that described
+ * below for the no-renderer case).
+ * <p>
+ * Otherwise:
+ * <ul>
+ * <li>If the submittedValue is not a String then just return the
+ * submittedValue unconverted.
+ * <li>If there is no "value" value-binding then just return the
+ * submittedValue unconverted.
+ * <li>Use introspection to determine the type of the target
+ * property specified by the value-binding, and then use
+ * Application.createConverter to find a converter that can
+ * map from String to the required type. Apply the converter
+ * to the submittedValue and return the result.
+ * </ul>
+ */
+ protected Object getConvertedValue(FacesContext context, Object submittedValue)
+ {
+ try
+ {
+ Renderer renderer = getRenderer(context);
+ if (renderer != null)
+ {
+ return renderer.getConvertedValue(context, this, submittedValue);
+ }
+ else if (submittedValue instanceof String)
+ {
+ Converter converter = _SharedRendererUtils.findUIOutputConverter(context, this);
+ if (converter != null)
+ {
+ return converter.getAsObject(context, this, (String)submittedValue);
+ }
+ }
+ }
+ catch (ConverterException e)
+ {
+ String converterMessage = getConverterMessage();
+ if(converterMessage != null) {
+ context.addMessage(getClientId(context),new FacesMessage(FacesMessage.SEVERITY_ERROR,converterMessage,converterMessage));
+ } else {
+ FacesMessage facesMessage = e.getFacesMessage();
+ if (facesMessage != null)
+ {
+ context.addMessage(getClientId(context), facesMessage);
+ }
+ else
+ {
+ _MessageUtils.addErrorMessage(context, this, CONVERSION_MESSAGE_ID,new Object[]{_MessageUtils.getLabel(context,this)});
+ }
+ }
+ setValid(false);
+ }
+ return submittedValue;
+ }
+
+
+
+ protected boolean compareValues(Object previous,
+ Object value)
+ {
+ return previous==null?(value!=null):(!previous.equals(value));
+ }
+
+
+ /**
+ * @since 1.2
+ */
+ public void resetValue()
+ {
+ setSubmittedValue(null);
+ setValue(null);
+ setLocalValueSet(false);
+ setValid(true);
+ }
+
+ // Property: immediate
+ private boolean _immediate;
+ private boolean _immediateSet;
+
+ /**
+ * Gets A boolean value that identifies the phase during which action events
+ * should fire. During normal event processing, action methods and
+ * action listener methods are fired during the "invoke application"
+ * phase of request processing. If this attribute is set to "true",
+ * these methods are fired instead at the end of the "apply request
+ * values" phase.
+ *
+ * @return the new immediate value
+ */
+ @JSFProperty
+ public boolean isImmediate()
+ {
+ if (_immediateSet)
+ {
+ return _immediate;
+ }
+ ValueExpression expression = getValueExpression("immediate");
+ if (expression != null)
+ {
+ return (Boolean)expression.getValue(getFacesContext().getELContext());
+ }
+ return false;
+ }
+
+ /**
+ * Sets A boolean value that identifies the phase during which action events
+ * should fire. During normal event processing, action methods and
+ * action listener methods are fired during the "invoke application"
+ * phase of request processing. If this attribute is set to "true",
+ * these methods are fired instead at the end of the "apply request
+ * values" phase.
+ *
+ * @param immediate the new immediate value
+ */
+ public void setImmediate(boolean immediate)
+ {
+ this._immediate = immediate;
+ this._immediateSet = true;
+ }
+
+ // Property: required
+ private boolean _required;
+ private boolean _requiredSet;
+
+ /**
+ * Gets A boolean value that indicates whether a value is required. Default value: false.
+ *
+ * @return the new required value
+ */
+ @JSFProperty
+ (defaultValue = "false")
+ public boolean isRequired()
+ {
+ if (_requiredSet)
+ {
+ return _required;
+ }
+ ValueExpression expression = getValueExpression("required");
+ if (expression != null)
+ {
+ return (Boolean)expression.getValue(getFacesContext().getELContext());
+ }
+ return false;
+ }
+
+ /**
+ * Sets A boolean value that indicates whether a value is required. Default value: false.
+ *
+ * @param required the new required value
+ */
+ public void setRequired(boolean required)
+ {
+ this._required = required;
+ this._requiredSet = true;
+ }
+
+ // Property: converterMessage
+ private String _converterMessage;
+
+ /**
+ * Gets Text of the converter message.
+ *
+ * @return the new converterMessage value
+ */
+ @JSFProperty
+ public String getConverterMessage()
+ {
+ if (_converterMessage != null)
+ {
+ return _converterMessage;
+ }
+ ValueExpression expression = getValueExpression("converterMessage");
+ if (expression != null)
+ {
+ return (String)expression.getValue(getFacesContext().getELContext());
+ }
+ return null;
+ }
+
+ /**
+ * Sets Text of the converter message.
+ *
+ * @param converterMessage the new converterMessage value
+ */
+ public void setConverterMessage(String converterMessage)
+ {
+ this._converterMessage = converterMessage;
+ }
+
+ // Property: requiredMessage
+ private String _requiredMessage;
+
+ /**
+ * Gets Text which will be shown if a required value is not submitted.
+ *
+ * @return the new requiredMessage value
+ */
+ @JSFProperty
+ public String getRequiredMessage()
+ {
+ if (_requiredMessage != null)
+ {
+ return _requiredMessage;
+ }
+ ValueExpression expression = getValueExpression("requiredMessage");
+ if (expression != null)
+ {
+ return (String)expression.getValue(getFacesContext().getELContext());
+ }
+ return null;
+ }
+
+ /**
+ * Sets Text which will be shown if a required value is not submitted.
+ *
+ * @param requiredMessage the new requiredMessage value
+ */
+ public void setRequiredMessage(String requiredMessage)
+ {
+ this._requiredMessage = requiredMessage;
+ }
+
+ // Property: validator
+ private MethodBinding _validator;
+
+ /**
+ * Gets A method which is invoked during the validation phase for this component. It is
+ * expected to check the submitted value for this component, and if not acceptable
+ * then report a validation error for the component.
+ *
+ * @return the new validator value
+ * @deprecated
+ */
+ @JSFProperty
+ (stateHolder = true,
+ returnSignature = "void",
+ methodSignature = "javax.faces.context.FacesContext,javax.faces.component.UIComponent,java.lang.Object")
+ public MethodBinding getValidator()
+ {
+ if (_validator != null)
+ {
+ return _validator;
+ }
+ ValueExpression expression = getValueExpression("validator");
+ if (expression != null)
+ {
+ return (MethodBinding)expression.getValue(getFacesContext().getELContext());
+ }
+ return null;
+ }
+
+ /**
+ * Sets A method which is invoked during the validation phase for this component. It is
+ * expected to check the submitted value for this component, and if not acceptable
+ * then report a validation error for the component.
+ *
+ * @param validator the new validator value
+ * @deprecated
+ */
+ public void setValidator(MethodBinding validator)
+ {
+ this._validator = validator;
+ }
+
+ // Property: validator
+ private List<Validator> _validatorList;
+
+ /**
+ * Adds a A method which is invoked during the validation phase for this component. It is
+ * expected to check the submitted value for this component, and if not acceptable
+ * then report a validation error for the component.
+ */
+ public void addValidator( Validator validator)
+ {
+ if (validator == null) throw new NullPointerException("validator");
+ if (_validatorList == null)
+ _validatorList = new ArrayList<Validator>();
+
+ _validatorList.add(validator);
+ }
+
+ /**
+ * Removes a A method which is invoked during the validation phase for this component. It is
+ * expected to check the submitted value for this component, and if not acceptable
+ * then report a validation error for the component.
+ */
+ public void removeValidator( Validator validator)
+ {
+ if (validator == null || _validatorList == null)
+ return;
+
+ _validatorList.remove(validator);
+ }
+ private static final Validator[] EMPTY_VALIDATOR_ARRAY = new Validator[0];
+
+ /**
+ * Gets all A method which is invoked during the validation phase for this component. It is
+ * expected to check the submitted value for this component, and if not acceptable
+ * then report a validation error for the component.
+ */
+ public Validator[] getValidators()
+ {
+ return _validatorList== null? EMPTY_VALIDATOR_ARRAY : _validatorList.toArray(new Validator[_validatorList.size()]);
+ }
+
+ // Property: validatorMessage
+ private String _validatorMessage;
+
+ /**
+ * Gets Text which will be shown, if validation fails.
+ *
+ * @return the new validatorMessage value
+ */
+ @JSFProperty
+ public String getValidatorMessage()
+ {
+ if (_validatorMessage != null)
+ {
+ return _validatorMessage;
+ }
+ ValueExpression expression = getValueExpression("validatorMessage");
+ if (expression != null)
+ {
+ return (String)expression.getValue(getFacesContext().getELContext());
+ }
+ return null;
+ }
+
+ /**
+ * Sets Text which will be shown, if validation fails.
+ *
+ * @param validatorMessage the new validatorMessage value
+ */
+ public void setValidatorMessage(String validatorMessage)
+ {
+ this._validatorMessage = validatorMessage;
+ }
+
+ // Property: valueChangeListener
+ private MethodBinding _valueChangeListener;
+
+ /**
+ * Gets A method which is invoked during postback processing for the current view if the
+ * submitted value for this component is not equal to the value which the "value" expression
+ * for this component returns. The phase in which this method is invoked can be controlled
+ * via the immediate attribute.
+ *
+ * @return the new valueChangeListener value
+ * @deprecated
+ */
+ @JSFProperty
+ (stateHolder = true,
+ returnSignature = "void",
+ methodSignature = "javax.faces.event.ValueChangeEvent")
+ public MethodBinding getValueChangeListener()
+ {
+ if (_valueChangeListener != null)
+ {
+ return _valueChangeListener;
+ }
+ ValueExpression expression = getValueExpression("valueChangeListener");
+ if (expression != null)
+ {
+ return (MethodBinding)expression.getValue(getFacesContext().getELContext());
+ }
+ return null;
+ }
+
+ /**
+ * Sets A method which is invoked during postback processing for the current view if the
+ * submitted value for this component is not equal to the value which the "value" expression
+ * for this component returns. The phase in which this method is invoked can be controlled
+ * via the immediate attribute.
+ *
+ * @param valueChangeListener the new valueChangeListener value
+ * @deprecated
+ */
+ public void setValueChangeListener(MethodBinding valueChangeListener)
+ {
+ this._valueChangeListener = valueChangeListener;
+ }
+
+ // Property: valid
+ private boolean _valid = true;
+
+ /**
+ * Gets whether the component's value is currently valid
+ *
+ * @return the new valid value
+ */
+ @JSFProperty
+ (defaultValue = "true",
+ tagExcluded = true)
+ public boolean isValid()
+ {
+ return _valid;
+ }
+
+ /**
+ * Sets whether the component's value is currently valid
+ *
+ * @param valid the new valid value
+ */
+ public void setValid(boolean valid)
+ {
+ this._valid = valid;
+ }
+
+ // Property: localValueSet
+ private boolean _localValueSet = false;
+
+ /**
+ * Gets whether a local value is currently set. If false, values are being retrieved from any attached ValueBinding
+ *
+ * @return the new localValueSet value
+ */
+ @JSFProperty
+ (defaultValue = "false",
+ tagExcluded = true)
+ public boolean isLocalValueSet()
+ {
+ return _localValueSet;
+ }
+
+ /**
+ * Sets whether a local value is currently set. If false, values are being retrieved from any attached ValueBinding
+ *
+ * @param localValueSet the new localValueSet value
+ */
+ public void setLocalValueSet(boolean localValueSet)
+ {
+ this._localValueSet = localValueSet;
+ }
+
+ // Property: submittedValue
+ private Object _submittedValue;
+
+ /**
+ * Gets the current submitted value. This value,
+ * if non-null, is set by the Renderer to store a possibly invalid value
+ * for later conversion or redisplay, and has not yet been converted
+ * into the proper type for this component instance. This method
+ * should only be used by the decode() and validate() method
+ * of this component, or its corresponding Renderer; however, user code
+ * may manually set it to null to erase any submitted value.
+ *
+ * @return the new submittedValue value
+ */
+ @JSFProperty
+ (tagExcluded = true)
+ public Object getSubmittedValue()
+ {
+ return _submittedValue;
+ }
+
+ /**
+ * Sets the current submitted value. This value,
+ * if non-null, is set by the Renderer to store a possibly invalid value
+ * for later conversion or redisplay, and has not yet been converted
+ * into the proper type for this component instance. This method
+ * should only be used by the decode() and validate() method
+ * of this component, or its corresponding Renderer; however, user code
+ * may manually set it to null to erase any submitted value.
+ *
+ * @param submittedValue the new submittedValue value
+ */
+ public void setSubmittedValue(Object submittedValue)
+ {
+ this._submittedValue = submittedValue;
+ }
+
+ /**
+ * Adds a valueChange listener.
+ *
+ * @param listener the valueChange listener to add
+ */
+ public void addValueChangeListener(
+ ValueChangeListener listener)
+ {
+ addFacesListener(listener);
+ }
+
+ /**
+ * Removes a valueChange listener.
+ *
+ * @param listener the valueChange listener to remove
+ */
+ public void removeValueChangeListener(
+ ValueChangeListener listener)
+ {
+ removeFacesListener(listener);
+ }
+
+ /**
+ * Returns an array of attached valueChange listeners.
+ *
+ * @return an array of attached valueChange listeners.
+ */
+ public ValueChangeListener[] getValueChangeListeners()
+ {
+ return (ValueChangeListener[])getFacesListeners(ValueChangeListener.class);
+ }
+
+ @Override
+ public Object saveState(FacesContext facesContext)
+ {
+ Object[] values = new Object[15];
+ values[0] = super.saveState(facesContext);
+ values[1] = _immediate;
+ values[2] = _immediateSet;
+ values[3] = _required;
+ values[4] = _requiredSet;
+ values[5] = _converterMessage;
+ values[6] = _requiredMessage;
+ values[8] = saveAttachedState(facesContext, _validatorList);
+ values[9] = _validatorMessage;
+ values[10] = saveAttachedState(facesContext, _valueChangeListener);
+ values[11] = _valid;
+ values[12] = _localValueSet;
+ values[13] = _submittedValue;
+
+ return values;
+ }
+
+ @Override
+ public void restoreState(FacesContext facesContext, Object state)
+ {
+ Object[] values = (Object[])state;
+ super.restoreState(facesContext,values[0]);
+ _immediate = (Boolean)values[1];
+ _immediateSet = (Boolean)values[2];
+ _required = (Boolean)values[3];
+ _requiredSet = (Boolean)values[4];
+ _converterMessage = (String)values[5];
+ _requiredMessage = (String)values[6];
+ _validatorList = (List<Validator>) restoreAttachedState(facesContext, values[8]);
+ _validatorMessage = (String)values[9];
+ _valueChangeListener = (MethodBinding)restoreAttachedState(facesContext, values[10]);
+ _valid = (Boolean)values[11];
+ _localValueSet = (Boolean)values[12];
+ _submittedValue = values[13];
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIInput.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UINamingContainer.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UINamingContainer.java?rev=662960&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UINamingContainer.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UINamingContainer.java Tue Jun 3 20:15:04 2008
@@ -0,0 +1,54 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package javax.faces.component;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
+/**
+ */
+@JSFComponent
+public class UINamingContainer extends UIComponentBase
+ implements NamingContainer
+{
+
+ static public final String COMPONENT_FAMILY =
+ "javax.faces.NamingContainer";
+ static public final String COMPONENT_TYPE =
+ "javax.faces.NamingContainer";
+
+ /**
+ * Construct an instance of the UINamingContainer.
+ */
+ public UINamingContainer()
+ {
+ setRendererType(null);
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UINamingContainer.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIOutput.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIOutput.java?rev=662960&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIOutput.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIOutput.java Tue Jun 3 20:15:04 2008
@@ -0,0 +1,159 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package javax.faces.component;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
+/**
+ *
+ * UIOutput displays a value to the user
+ */
+@JSFComponent
+(defaultRendererType = "javax.faces.Text"
+)
+public class UIOutput extends UIComponentBase
+ implements ValueHolder
+{
+
+ static public final String COMPONENT_FAMILY =
+ "javax.faces.Output";
+ static public final String COMPONENT_TYPE =
+ "javax.faces.Output";
+
+ /**
+ * Construct an instance of the UIOutput.
+ */
+ public UIOutput()
+ {
+ setRendererType("javax.faces.Text");
+ }
+ public Object getLocalValue()
+ {
+ return _value;
+ }
+
+ // Property: value
+ private Object _value;
+
+ /**
+ * Gets The initial value of this component.
+ *
+ * @return the new value value
+ */
+ @JSFProperty
+ public Object getValue()
+ {
+ if (_value != null)
+ {
+ return _value;
+ }
+ ValueExpression expression = getValueExpression("value");
+ if (expression != null)
+ {
+ return expression.getValue(getFacesContext().getELContext());
+ }
+ return null;
+ }
+
+ /**
+ * Sets The initial value of this component.
+ *
+ * @param value the new value value
+ */
+ public void setValue(Object value)
+ {
+ this._value = value;
+ }
+
+ // Property: converter
+ private Converter _converter;
+
+ /**
+ * Gets An expression that specifies the Converter for this component.
+ * The value can either be a static value (ID) or an EL expression.
+ * When a static id is specified, an instance of the converter type
+ * registered with that id is used. When this is an EL expression,
+ * the result of evaluating the expression must be an object that
+ * implements the Converter interface.
+ *
+ * @return the new converter value
+ */
+ @JSFProperty
+ public Converter getConverter()
+ {
+ if (_converter != null)
+ {
+ return _converter;
+ }
+ ValueExpression expression = getValueExpression("converter");
+ if (expression != null)
+ {
+ return (Converter)expression.getValue(getFacesContext().getELContext());
+ }
+ return null;
+ }
+
+ /**
+ * Sets An expression that specifies the Converter for this component.
+ * The value can either be a static value (ID) or an EL expression.
+ * When a static id is specified, an instance of the converter type
+ * registered with that id is used. When this is an EL expression,
+ * the result of evaluating the expression must be an object that
+ * implements the Converter interface.
+ *
+ * @param converter the new converter value
+ */
+ public void setConverter(Converter converter)
+ {
+ this._converter = converter;
+ }
+
+ @Override
+ public Object saveState(FacesContext facesContext)
+ {
+ Object[] values = new Object[3];
+ values[0] = super.saveState(facesContext);
+ values[1] = _value;
+ values[2] = saveAttachedState(facesContext, _converter);
+
+ return values;
+ }
+
+ @Override
+ public void restoreState(FacesContext facesContext, Object state)
+ {
+ Object[] values = (Object[])state;
+ super.restoreState(facesContext,values[0]);
+ _value = values[1];
+ _converter = (Converter) restoreAttachedState(facesContext, values[2]);
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIOutput.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIPanel.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIPanel.java?rev=662960&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIPanel.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIPanel.java Tue Jun 3 20:15:04 2008
@@ -0,0 +1,53 @@
+// WARNING: This file was automatically generated. Do not edit it directly,
+// or you will lose your changes.
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package javax.faces.component;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
+/**
+ */
+@JSFComponent
+public class UIPanel extends UIComponentBase
+{
+
+ static public final String COMPONENT_FAMILY =
+ "javax.faces.Panel";
+ static public final String COMPONENT_TYPE =
+ "javax.faces.Panel";
+
+ /**
+ * Construct an instance of the UIPanel.
+ */
+ public UIPanel()
+ {
+ setRendererType(null);
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/core_trunk_1.2.x/api/src/main/java/javax/faces/component/UIPanel.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL