You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2017/09/17 12:30:29 UTC
[myfaces-trinidad] 06/36: Implement JIRA-1668 by storing the id
attribute on the UIXComponentBase itself and modifying the UIXFacesBeanImpl
to delegate back to the UIXComponentBase for id access through the
AttributeMap. I also cleaned up the way that ids and clientIds are
generated so that getId() will never return a null id. In order to make the
UIXComponentBase change backwards compatible,
I moved the UIXFacesBeanImpl and UIXEditableFacesBeanImpl classes to api
where our customers can take advantage of them and [...]
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git
commit 6e06ca9a62a5fa31d7614afe44bcfaff335d3b6f
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Wed Jan 20 22:40:57 2010 +0000
Implement JIRA-1668 by storing the id attribute on the UIXComponentBase itself and modifying the UIXFacesBeanImpl to delegate back to the UIXComponentBase for id access through the AttributeMap. I also cleaned up the way that ids and clientIds are generated so that getId() will never return a null id. In order to make the UIXComponentBase change backwards compatible, I moved the UIXFacesBeanImpl and UIXEditableFacesBeanImpl classes to api where our customers can take advantage of the [...]
### DON'T KNOW WHY THE NEXT LINE SHOULD BE NECESSARY!
org.apache.myfaces.trinidad.component.UIXSelectRange|org.apache.myfaces.trinidad.ChoiceBar=org.apache.myfaces.trinidadinternal.bean.UIXEditableFacesBeanImpl
in the faces-bean.properties
---
.../myfaces/trinidad/bean/FacesBeanImpl.java | 2 +
.../trinidad/component/UIXComponentBase.java | 152 +++++++++++++--------
.../component}/UIXEditableFacesBeanImpl.java | 101 +++++++++-----
.../trinidad/component/UIXFacesBeanImpl.java | 144 +++++++++++++++++++
.../main/resources/META-INF/faces-bean.properties | 21 +++
.../trinidad/component/FindComponentTest.java | 5 +-
.../trinidad/component/UIXComponentBean.java | 41 ------
.../trinidad/component/UIXEditableValueBean.java | 37 -----
.../trinidad/util/FindRelativeComponentTest.java | 6 +-
.../test/resources/META-INF/faces-bean.properties | 19 ---
.../trinidadinternal/bean/UIXFacesBeanImpl.java | 45 ------
.../main/resources/META-INF/faces-bean.properties | 4 -
.../context/PartialTriggersTest.java | 5 +-
.../renderkit/RenderKitTestCase.java | 4 +-
14 files changed, 338 insertions(+), 248 deletions(-)
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
index 362538b..b03767c 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
@@ -330,6 +330,7 @@ abstract public class FacesBeanImpl implements FacesBean
_expressions.markInitialState();
}
+ @Override
public void restoreState(FacesContext context, Object state)
{
if (_LOG.isFiner())
@@ -359,6 +360,7 @@ abstract public class FacesBeanImpl implements FacesBean
_getPropertyMap().restoreState(context, getType(), state);
}
+ @Override
public Object saveState(FacesContext context)
{
if (_LOG.isFiner())
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
index e37d8fb..d886fe5 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
@@ -28,7 +28,6 @@ import java.net.URL;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.NoSuchElementException;
import java.util.Properties;
import javax.el.ELContext;
@@ -40,6 +39,7 @@ import javax.faces.FacesException;
import javax.faces.component.ContextCallback;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
import javax.faces.el.MethodBinding;
@@ -62,6 +62,7 @@ import org.apache.myfaces.trinidad.event.AttributeChangeListener;
import org.apache.myfaces.trinidad.logging.TrinidadLogger;
import org.apache.myfaces.trinidad.render.ExtendedRenderer;
import org.apache.myfaces.trinidad.render.LifecycleRenderer;
+import org.apache.myfaces.trinidad.util.CollectionUtils;
import org.apache.myfaces.trinidad.util.ThreadLocalUtils;
@@ -103,8 +104,6 @@ abstract public class UIXComponentBase extends UIXComponent
static public final FacesBean.Type TYPE = _createType();
static public final PropertyKey ID_KEY =
TYPE.registerKey("id", String.class, PropertyKey.CAP_NOT_BOUND);
- static private final PropertyKey _GENERATED_ID_KEY =
- TYPE.registerKey("_genId", String.class, PropertyKey.CAP_NOT_BOUND);
static public final PropertyKey RENDERED_KEY =
TYPE.registerKey("rendered", Boolean.class, Boolean.TRUE);
static public final PropertyKey BINDING_KEY =
@@ -310,20 +309,11 @@ abstract public class UIXComponentBase extends UIXComponent
@Override
public String getClientId(FacesContext context)
{
- // NOTE - client ids cannot be cached because the generated
- // value has to be dynamically calculated in some cases (UIData)
-
+ // the clientId is always at least the id of the current component
+ // our implementation of getId() guarantees that this always
+ // returns a non-null value
String clientId = getId();
- if (clientId == null)
- {
- clientId = (String) getProperty(_GENERATED_ID_KEY);
- if (clientId == null)
- {
- clientId = context.getViewRoot().createUniqueId();
- setProperty(_GENERATED_ID_KEY, clientId);
- }
- }
-
+
// Search for an ancestor that is a naming container
UIComponent containerComponent = getParent();
while (null != containerComponent)
@@ -356,12 +346,42 @@ abstract public class UIXComponentBase extends UIXComponent
/**
- * Gets the identifier for the component.
+ * Gets the identifier for the component. This implementation
+ * never returns a null id.
*/
@Override
public String getId()
- {
- return (String) getProperty(ID_KEY);
+ {
+ // determine whether we can use the optimized code path or not
+ if (_usesFacesBeanImpl)
+ {
+ // optimized path
+
+ // make sure that we always have an id
+ if (_id == null)
+ {
+ _id = FacesContext.getCurrentInstance().getViewRoot().createUniqueId();
+ }
+
+ return _id;
+ }
+ else
+ {
+ // unoptimized path
+ FacesBean facesBean = getFacesBean();
+
+ String id = (String)facesBean.getProperty(ID_KEY);
+
+ // make sure that we always have an id
+ if (id == null)
+ {
+ id = FacesContext.getCurrentInstance().getViewRoot().createUniqueId();
+
+ facesBean.setProperty(ID_KEY, id);
+ }
+
+ return id;
+ }
}
@@ -377,19 +397,28 @@ abstract public class UIXComponentBase extends UIXComponent
@Override
public void setId(String id)
{
- // =-=AEW Currently, setId() assumes that resetting to
- // the same value *is not* short-circuited.
- _validateId(id);
- // If we're setting the ID to null, don't discard
- // the _GENERATED_ID
- if (id != null)
- setProperty(_GENERATED_ID_KEY, null);
-
- setProperty(ID_KEY, id);
+ FacesBean facesBean = getFacesBean();
+
+ // if we are using a FacesBeanImpl, then the FacesBean will
+ // delegate all calls to set the id back to us and we can store
+ // the value localy. Otehrwise,w e need to store it in
+ // the FacesBean
+ if (_usesFacesBeanImpl)
+ {
+ // only validate if the id has actually changed
+ if ((_id == null) || !_id.equals(id))
+ {
+ _validateId(id);
+ _id = id;
+ }
+ }
+ else
+ {
+ _validateId(id);
+ facesBean.setProperty(ID_KEY, id);
+ }
}
-
-
@Override
abstract public String getFamily();
@@ -1589,11 +1618,39 @@ abstract public class UIXComponentBase extends UIXComponent
String rendererType)
{
FacesBean oldBean = _facesBean;
- _facesBean = createFacesBean(rendererType);
+ FacesBean newBean = createFacesBean(rendererType);;
+
if (oldBean != null)
- _facesBean.addAll(oldBean);
+ newBean.addAll(oldBean);
- _attributes = new ValueMap(_facesBean);
+ _attributes = new ValueMap(newBean);
+
+ _facesBean = newBean;
+
+ // determine whether it is ok to store the attributes locally. We cache the result since
+ // this can be a little involved
+ boolean usesFacesBeanImpl = false;
+
+ if (newBean instanceof UIXFacesBeanImpl)
+ usesFacesBeanImpl = true;
+ else
+ {
+ // handle the wrapped case
+ FacesBean currImpl = newBean;
+
+ while (currImpl instanceof FacesBeanWrapper)
+ {
+ currImpl = ((FacesBeanWrapper)currImpl).getWrappedBean();
+
+ if (currImpl instanceof UIXFacesBeanImpl)
+ {
+ usesFacesBeanImpl = true;
+ break;
+ }
+ }
+ }
+
+ _usesFacesBeanImpl = usesFacesBeanImpl;
}
private FacesBean _facesBean;
@@ -1601,7 +1658,9 @@ abstract public class UIXComponentBase extends UIXComponent
private Map<String, Object> _attributes;
private Map<String, UIComponent> _facets;
private UIComponent _parent;
-
+ private String _id;
+ private boolean _usesFacesBeanImpl;
+
// Cached instance of the Renderer for this component.
// The instance will be re-retrieved in encodeBegin()
private transient Renderer _cachedRenderer = _UNDEFINED_RENDERER;
@@ -1613,12 +1672,10 @@ abstract public class UIXComponentBase extends UIXComponent
// So commented out, is that ok? If so, this attribute should be deleted
//private transient boolean _initialStateMarked;
- private static final Iterator<String> _EMPTY_STRING_ITERATOR =
- new EmptyIterator<String>();
+ private static final Iterator<String> _EMPTY_STRING_ITERATOR = CollectionUtils.emptyIterator();
private static final Iterator<UIComponent> _EMPTY_UICOMPONENT_ITERATOR =
- new EmptyIterator<UIComponent>();
-
+ CollectionUtils.emptyIterator();
static private final ThreadLocal<StringBuilder> _STRING_BUILDER =
ThreadLocalUtils.newRequestThreadLocal();
@@ -1671,25 +1728,6 @@ abstract public class UIXComponentBase extends UIXComponent
{
}
- private static class EmptyIterator<T> implements Iterator<T>
- {
- public boolean hasNext()
- {
- return false;
- }
-
- public T next()
- {
- throw new NoSuchElementException();
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
-
- }
-
static private final LifecycleRenderer _UNDEFINED_LIFECYCLE_RENDERER =
new ExtendedRendererImpl();
static private final Renderer _UNDEFINED_RENDERER = new RendererImpl();
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXEditableFacesBeanImpl.java
similarity index 51%
rename from trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java
rename to trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXEditableFacesBeanImpl.java
index da5bfbd..22fee2f 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXEditableFacesBeanImpl.java
@@ -1,37 +1,64 @@
-/*
- * 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 org.apache.myfaces.trinidadinternal.bean;
-
-import org.apache.myfaces.trinidad.bean.PropertyKey;
-import org.apache.myfaces.trinidad.component.UIXEditableValue;
-
-public class UIXEditableFacesBeanImpl extends UIXFacesBeanImpl
-{
- public UIXEditableFacesBeanImpl()
- {
- }
-
- @Override
- public void setProperty(PropertyKey key, Object value)
- {
- super.setProperty(key, value);
- if (key == UIXEditableValue.VALUE_KEY)
- setProperty(UIXEditableValue.LOCAL_VALUE_SET_KEY, Boolean.TRUE);
- }
-}
+/*
+ * 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 org.apache.myfaces.trinidad.component;
+
+import org.apache.myfaces.trinidad.bean.PropertyKey;
+
+/**
+ * UIXFacesBeanImpl subclass that implements the local value contract needed for ValueHolders.
+ * UIXEditableValue subclasses that wish to modify their FacesBean behavior should subclass
+ * this class.
+ * @see org.apache.myfaces.trinidad.bean.FacesBeanImpl
+ * @see org.apache.myfaces.trinidad.component.UIXEditableValue
+ */
+public class UIXEditableFacesBeanImpl extends UIXFacesBeanImpl
+{
+ public UIXEditableFacesBeanImpl()
+ {
+ }
+
+ /**
+ * Subclassers most call super with the component and type
+ * @param component UIXEditableValue to bind to this UIXFacesBean
+ * @param type
+ * @throws IllegalStateException if init() called more than once
+ * @throws IllegalArgumentException if component is not a UIXEditableValue
+ * @throws NullPointerException of component or type is null
+ */
+ @Override
+ public void init(
+ UIXComponent component,
+ Type type)
+ {
+ // UIXFacesBeanImpl only works with UIXComponentBase
+ if (!(component instanceof UIXEditableValue))
+ throw new IllegalArgumentException(component.getClass() +" is not a UIXEditableValue");
+
+ super.init(component, type);
+ }
+
+
+ @Override
+ public void setProperty(PropertyKey key, Object value)
+ {
+ super.setProperty(key, value);
+ if (key == UIXEditableValue.VALUE_KEY)
+ setProperty(UIXEditableValue.LOCAL_VALUE_SET_KEY, Boolean.TRUE);
+ }
+}
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java
new file mode 100644
index 0000000..f27540b
--- /dev/null
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java
@@ -0,0 +1,144 @@
+/*
+ * 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 org.apache.myfaces.trinidad.component;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.trinidad.bean.FacesBeanImpl;
+import org.apache.myfaces.trinidad.bean.PropertyKey;
+
+/**
+ * FacesBeanImpl subclass that implements UIXFacesBean. UIXComponentBase subclasses that want to
+ * change the behavior of their associated FacesBean are encouraged to subclass this class in preference
+ * to implementing the FacesBean and UIXFaceBean contracts directly. In addition, while
+ * UIXComponentBase will work with any UIXFacesBean, it is optimized to work with
+ * UIXFacesBeanImpl.
+ * @see org.apache.myfaces.trinidad.bean.FacesBean
+ * @see org.apache.myfaces.trinidad.bean.FacesBeanImpl
+ * @see org.apache.myfaces.trinidad.component.UIXFacesBean
+ * @see org.apache.myfaces.trinidad.component.UIXComponentBase
+ */
+public class UIXFacesBeanImpl extends FacesBeanImpl implements UIXFacesBean
+{
+ public UIXFacesBeanImpl()
+ {
+ }
+
+ @Override
+ public final Type getType()
+ {
+ return _type;
+ }
+
+ /**
+ * @return the UIXComponent that this UIXFacesBean as initialized with
+ */
+ public final UIXComponent getComponent()
+ {
+ return _component;
+ }
+
+ /**
+ * Subclassers most call super with the component and type
+ * @param component UIXComponentBase to bind to this UIXFacesBean
+ * @param type
+ * @throws IllegalStateException if init() called a second time with a different component or if
+ * the Type changes for one non-null Type to another
+ * @throws IllegalArgumentException if component is not a UIXComponentBase
+ * @throws NullPointerException of component is null
+ */
+ @Override
+ public void init(
+ UIXComponent component,
+ Type type)
+ {
+ // component can only be specified once
+ if ((_component != null) && (_component != component))
+ throw new IllegalStateException("FacesBean Component Changed");
+
+ // type can only be specified once
+ if ((_type != null) && (_type != type))
+ throw new IllegalStateException("FacesBean Type Changed");
+
+ // UIXFacesBeanImpl only works with UIXComponentBase
+ if (!(component instanceof UIXComponentBase))
+ throw new IllegalArgumentException(component.getClass() +" is not a UIXComponentBase");
+
+ if (component == null)
+ throw new NullPointerException("UIXFacesBean must have a component");
+
+ _type = type;
+ _component = component;
+ }
+
+
+ @Override
+ public void setPropertyImpl(PropertyKey key, Object value)
+ {
+ // delegate sets of the id back to the UIXComponent
+ if (key == UIXComponentBase.ID_KEY)
+ {
+ _component.setId((String)value);
+ }
+ else
+ {
+ super.setPropertyImpl(key, value);
+ }
+ }
+
+ @Override
+ protected Object getLocalPropertyImpl(PropertyKey key)
+ {
+ if (key == UIXComponentBase.ID_KEY)
+ {
+ return _component.getId();
+ }
+ else
+ {
+ return super.getLocalPropertyImpl(key);
+ }
+ }
+
+ @Override
+ public Object saveState(FacesContext context)
+ {
+ // save the id in addition to the rest of the FacesBean state
+ Object[] addIdState = new Object[2];
+
+ addIdState[0] = _component.getId();
+ addIdState[1] = super.saveState(context);
+
+ return addIdState;
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object state)
+ {
+ // restore the id in addition to the rest of the FacesBean state
+ Object[] addIdState = (Object[])state;
+ assert addIdState.length == 2;
+
+ _component.setId((String)addIdState[0]);
+ super.restoreState(context, addIdState[1]);
+ }
+
+
+ private Type _type;
+ private UIXComponent _component;
+}
diff --git a/trinidad-api/src/main/resources/META-INF/faces-bean.properties b/trinidad-api/src/main/resources/META-INF/faces-bean.properties
new file mode 100644
index 0000000..9db3ad5
--- /dev/null
+++ b/trinidad-api/src/main/resources/META-INF/faces-bean.properties
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+#### <component-package-qualified-class-name>[|<renderer-type>]=<facesbean-package-qualified-class-name> ###
+org.apache.myfaces.trinidad.component.UIXComponentBase=org.apache.myfaces.trinidad.component.UIXFacesBeanImpl
+org.apache.myfaces.trinidad.component.UIXEditableValue=org.apache.myfaces.trinidad.component.UIXEditableFacesBeanImpl
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/FindComponentTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/FindComponentTest.java
index eda3aac..0da275f 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/FindComponentTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/FindComponentTest.java
@@ -24,12 +24,13 @@ import javax.faces.component.UIForm;
import javax.faces.component.UIViewRoot;
import junit.framework.Test;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
import org.apache.myfaces.trinidad.component.UIXPanel;
-public class FindComponentTest extends TestCase
+public class FindComponentTest extends FacesTestCase
{
public static final Test suite()
{
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXComponentBean.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXComponentBean.java
deleted file mode 100644
index af1b70d..0000000
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXComponentBean.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 org.apache.myfaces.trinidad.component;
-
-import org.apache.myfaces.trinidad.bean.FacesBeanImpl;
-import org.apache.myfaces.trinidad.component.UIXComponent;
-import org.apache.myfaces.trinidad.component.UIXFacesBean;
-
-public class UIXComponentBean extends FacesBeanImpl implements UIXFacesBean
-{
- @Override
- public Type getType()
- {
- return _type;
- }
-
- public void init(
- UIXComponent component,
- Type type)
- {
- _type = type;
- }
-
- private Type _type;
-}
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXEditableValueBean.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXEditableValueBean.java
deleted file mode 100644
index e2790d9..0000000
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXEditableValueBean.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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 org.apache.myfaces.trinidad.component;
-
-import org.apache.myfaces.trinidad.bean.PropertyKey;
-
-public class UIXEditableValueBean extends UIXComponentBean
-{
- /**
- * Subclass for editable components; beans here have an
- * additional responsibility, which is to automatically
- * set "localValueSet" any time the value is set.
- */
- @Override
- public void setProperty(PropertyKey key, Object value)
- {
- super.setProperty(key, value);
- if (key == UIXEditableValue.VALUE_KEY)
- setProperty(UIXEditableValue.LOCAL_VALUE_SET_KEY, Boolean.TRUE);
- }
-}
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/FindRelativeComponentTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/FindRelativeComponentTest.java
index 12f80a5..7bfa840 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/FindRelativeComponentTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/FindRelativeComponentTest.java
@@ -18,8 +18,6 @@
*/
package org.apache.myfaces.trinidad.util;
-import junit.framework.TestCase;
-
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
@@ -32,7 +30,9 @@ import org.apache.myfaces.trinidad.component.UIXInput;
import org.apache.myfaces.trinidad.component.UIXPanel;
import org.apache.myfaces.trinidad.component.UIXTable;
-public class FindRelativeComponentTest extends TestCase
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
+public class FindRelativeComponentTest extends FacesTestCase
{
public static final Test suite()
{
diff --git a/trinidad-api/src/test/resources/META-INF/faces-bean.properties b/trinidad-api/src/test/resources/META-INF/faces-bean.properties
deleted file mode 100644
index 22c424f..0000000
--- a/trinidad-api/src/test/resources/META-INF/faces-bean.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-org.apache.myfaces.trinidad.component.UIXComponentBase=org.apache.myfaces.trinidad.component.UIXComponentBean
-org.apache.myfaces.trinidad.component.UIXEditableValue=org.apache.myfaces.trinidad.component.UIXEditableValueBean
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java
deleted file mode 100644
index e248928..0000000
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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 org.apache.myfaces.trinidadinternal.bean;
-
-import org.apache.myfaces.trinidad.bean.FacesBeanImpl;
-import org.apache.myfaces.trinidad.component.UIXComponent;
-import org.apache.myfaces.trinidad.component.UIXFacesBean;
-
-public class UIXFacesBeanImpl extends FacesBeanImpl implements UIXFacesBean
-{
- public UIXFacesBeanImpl()
- {
- }
-
- @Override
- public Type getType()
- {
- return _type;
- }
-
- public void init(
- UIXComponent component,
- Type type)
- {
- _type = type;
- }
-
- private Type _type;
-}
diff --git a/trinidad-impl/src/main/resources/META-INF/faces-bean.properties b/trinidad-impl/src/main/resources/META-INF/faces-bean.properties
index e201cd3..fc90cd3 100644
--- a/trinidad-impl/src/main/resources/META-INF/faces-bean.properties
+++ b/trinidad-impl/src/main/resources/META-INF/faces-bean.properties
@@ -17,10 +17,6 @@
# under the License.
#
#### <component-package-qualified-class-name>[|<renderer-type>]=<facesbean-package-qualified-class-name> ###
-org.apache.myfaces.trinidad.component.UIXComponentBase=org.apache.myfaces.trinidadinternal.bean.UIXFacesBeanImpl
-org.apache.myfaces.trinidad.component.UIXEditableValue=org.apache.myfaces.trinidadinternal.bean.UIXEditableFacesBeanImpl
-### DON'T KNOW WHY THE NEXT LINE SHOULD BE NECESSARY!
-org.apache.myfaces.trinidad.component.UIXSelectRange|org.apache.myfaces.trinidad.ChoiceBar=org.apache.myfaces.trinidadinternal.bean.UIXEditableFacesBeanImpl
### Old "UIX" renderers and associated beans
org.apache.myfaces.trinidad.component.UIXCommand|org.apache.myfaces.trinidad.NavigationItem=org.apache.myfaces.trinidadinternal.uinode.nav.CommandNavigationItemFacesBean
org.apache.myfaces.trinidad.component.UIXProcess|org.apache.myfaces.trinidad.ChoiceBar=org.apache.myfaces.trinidadinternal.uinode.nav.ProcessChoiceBarFacesBean
diff --git a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/PartialTriggersTest.java b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/PartialTriggersTest.java
index 64ff6eb..e909648 100644
--- a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/PartialTriggersTest.java
+++ b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/PartialTriggersTest.java
@@ -26,7 +26,6 @@ import javax.faces.component.UIForm;
import javax.faces.component.UIViewRoot;
import junit.framework.Test;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.myfaces.trinidad.component.UIXCommand;
@@ -35,7 +34,9 @@ import org.apache.myfaces.trinidad.component.UIXPanel;
import org.apache.myfaces.trinidad.component.UIXTable;
import org.apache.myfaces.trinidad.context.RequestContext;
-public class PartialTriggersTest extends TestCase
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
+public class PartialTriggersTest extends FacesTestCase
{
public static final Test suite()
{
diff --git a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitTestCase.java b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitTestCase.java
index e3431e9..228a2ab 100644
--- a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitTestCase.java
+++ b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitTestCase.java
@@ -47,6 +47,8 @@ import org.apache.myfaces.trinidad.context.RequestContext;
import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
import org.apache.myfaces.trinidad.util.Service;
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
import org.apache.myfaces.trinidadinternal.io.XhtmlResponseWriter;
import junit.framework.AssertionFailedError;
@@ -99,7 +101,7 @@ abstract public class RenderKitTestCase extends TestSuite
}
- abstract public class BaseTest extends TestCase
+ abstract public class BaseTest extends FacesTestCase
{
public BaseTest(String name,
SuiteDefinition definition)
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.