You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/04/20 21:14:08 UTC
svn commit: r395673 - in /myfaces/tobago/trunk: contrib/facelets/
contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/
core/src/main/java/org/apache/myfaces/tobago/component/
core/src/main/java/org/apache/myfaces/tobago/taglib/component/ ...
Author: bommel
Date: Thu Apr 20 12:14:05 2006
New Revision: 395673
URL: http://svn.apache.org/viewcvs?rev=395673&view=rev
Log:
clean navigation.jsp in demo
added binding to tabChangeListener tag
apply checkstyle rules in tobago-tool-apt
remove ant apt task
remove deprecated ForEach in ComponentUtil
added loadBundle and tabChangeListener to facelets
Added:
myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java
myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/BundleMapWrapper.java
Removed:
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/ant/
Modified:
myfaces/tobago/trunk/contrib/facelets/pom.xml
myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/AbstractTobagoTagLibrary.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ForEachTag.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/StyleTag.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabChangeListenerTag.java
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasScript.java
myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java
myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/navigator.jsp
myfaces/tobago/trunk/example/demo/src/main/webapp/overview/navigator.jsp
myfaces/tobago/trunk/example/demo/src/main/webapp/overview/tabControl.jsp
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/AbstractAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessorFactory.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessorFactory.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/DynamicExpression.java
myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/Tag.java
Modified: myfaces/tobago/trunk/contrib/facelets/pom.xml
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/contrib/facelets/pom.xml?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/contrib/facelets/pom.xml (original)
+++ myfaces/tobago/trunk/contrib/facelets/pom.xml Thu Apr 20 12:14:05 2006
@@ -151,10 +151,18 @@
</exclusion>
</exclusions>
</dependency>
+
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>1.1.2</version>
<scope>provided</scope>
</dependency>
Modified: myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/AbstractTobagoTagLibrary.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/AbstractTobagoTagLibrary.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/AbstractTobagoTagLibrary.java (original)
+++ myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/AbstractTobagoTagLibrary.java Thu Apr 20 12:14:05 2006
@@ -30,6 +30,8 @@
public AbstractTobagoTagLibrary(String namespace) {
super(namespace);
addTagHandler("attribute", AttributeHandler.class);
+ addTagHandler("tabChangeListener", TabChangeListenerHandler.class);
+ addTagHandler("loadBundle", LoadBundleHandler.class);
}
}
Added: myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java?rev=395673&view=auto
==============================================================================
--- myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java (added)
+++ myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java Thu Apr 20 12:14:05 2006
@@ -0,0 +1,60 @@
+package org.apache.myfaces.tobago.facelets;
+
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+
+import org.apache.myfaces.tobago.util.BundleMapWrapper;
+
+import javax.faces.component.UIComponent;
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.el.ELException;
+import java.io.IOException;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 20.04.2006
+ * Time: 19:35:29
+ * To change this template use File | Settings | File Templates.
+ */
+public class LoadBundleHandler extends TagHandler {
+ private final TagAttribute basename;
+
+ private final TagAttribute var;
+
+ public LoadBundleHandler(TagConfig config) {
+ super(config);
+ this.basename = this.getRequiredAttribute("basename");
+ this.var = this.getRequiredAttribute("var");
+ }
+
+ public void apply(FaceletContext faceletContext, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException {
+ String name = basename.getValue(faceletContext);
+ BundleMapWrapper map = new BundleMapWrapper(name);
+ FacesContext facesContext = faceletContext.getFacesContext();
+ facesContext.getExternalContext().
+ getRequestMap().put(var.getValue(faceletContext), map);
+ }
+}
Added: myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java?rev=395673&view=auto
==============================================================================
--- myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java (added)
+++ myfaces/tobago/trunk/contrib/facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java Thu Apr 20 12:14:05 2006
@@ -0,0 +1,81 @@
+package org.apache.myfaces.tobago.facelets;
+
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagAttributeException;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+
+import java.io.IOException;
+
+import org.apache.myfaces.tobago.event.TabChangeSource;
+import org.apache.myfaces.tobago.event.TabChangeListener;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.el.ValueExpression;
+import javax.el.ELException;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 20.04.2006
+ * Time: 18:14:11
+ * To change this template use File | Settings | File Templates.
+ */
+public class TabChangeListenerHandler extends TagHandler {
+
+ private Class listenerType;
+
+ private final TagAttribute type;
+
+ private final TagAttribute binding;
+
+
+ public TabChangeListenerHandler(TagConfig config) {
+ super(config);
+ binding = getAttribute("binding");
+ type = getAttribute("type");
+ if (type != null) {
+ if (!type.isLiteral()) {
+ throw new TagAttributeException(tag, type, "Must be literal");
+ }
+ try {
+ this.listenerType = Class.forName(type.getValue());
+ } catch (Exception e) {
+ throw new TagAttributeException(tag, type, e);
+ }
+ }
+ }
+
+ public void apply(FaceletContext faceletContext, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException {
+ if (parent instanceof TabChangeSource) {
+ // only process if parent was just created
+ if (parent.getParent() == null) {
+ TabChangeSource changeSource = (TabChangeSource) parent;
+ TabChangeListener listener = null;
+ ValueExpression valueExpression = null;
+ if (binding != null) {
+ valueExpression = binding.getValueExpression(faceletContext, TabChangeListener.class);
+ listener = (TabChangeListener) valueExpression.getValue(faceletContext);
+ }
+ if (listener == null) {
+ try {
+ listener = (TabChangeListener) listenerType.newInstance();
+ } catch (Exception e) {
+ throw new TagAttributeException(tag, type, e.getCause());
+ }
+ if (valueExpression != null) {
+ valueExpression.setValue(faceletContext, listener);
+ }
+ }
+ changeSource.addTabChangeListener(listener);
+ }
+ } else {
+ throw new TagException(tag, "Parent is not of type TabChangeSource, type is: " + parent);
+ }
+ }
+}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java Thu Apr 20 12:14:05 2006
@@ -49,7 +49,6 @@
import org.apache.myfaces.tobago.el.ConstantMethodBinding;
import org.apache.myfaces.tobago.event.SheetStateChangeEvent;
import org.apache.myfaces.tobago.renderkit.RendererBase;
-import org.apache.myfaces.tobago.taglib.component.ForEachTag;
import org.apache.myfaces.tobago.util.RangeParser;
import javax.faces.FactoryFinder;
@@ -602,16 +601,7 @@
}
}
}
- public static void setIntegerProperty(UIComponent component,
- String name, String value, ForEachTag.IterationHelper iterator) {
- if (value != null) {
- if (UIComponentTag.isValueReference(value)) {
- component.setValueBinding(name, createValueBinding(value, iterator));
- } else {
- component.getAttributes().put(name, new Integer(value));
- }
- }
- }
+
public static void setBooleanProperty(UIComponent component,
String name, String value) {
if (value != null) {
@@ -622,27 +612,6 @@
}
}
}
- public static void setBooleanProperty(UIComponent component,
- String name, String value, ForEachTag.IterationHelper iterator) {
- if (value != null) {
- if (UIComponentTag.isValueReference(value)) {
- component.setValueBinding(name, createValueBinding(value, iterator));
- } else {
- component.getAttributes().put(name, Boolean.valueOf(value));
- }
- }
- }
-
- public static void setStringProperty(UIComponent component, String name,
- String value, ForEachTag.IterationHelper iterator) {
- if (value != null) {
- if (UIComponentTag.isValueReference(value)) {
- component.setValueBinding(name, createValueBinding(value, iterator));
- } else {
- component.getAttributes().put(name, value);
- }
- }
- }
public static void setStringProperty(UIComponent component, String name,
String value) {
@@ -654,22 +623,19 @@
}
}
}
+ public static void setValueForValueBinding(String name, Object value) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ ValueBinding valueBinding = context.getApplication().createValueBinding(name);
+ valueBinding.setValue(context, value);
+ }
public static ValueBinding createValueBinding(String value) {
return FacesContext.getCurrentInstance().getApplication()
.createValueBinding(value);
}
- public static ValueBinding createValueBinding(String value,
- ForEachTag.IterationHelper iterator) {
- if (iterator != null) {
- value = iterator.replace(value);
- }
- return FacesContext.getCurrentInstance().getApplication()
- .createValueBinding(value);
- }
public static String getValueFromEl(String script) {
if (UIComponentTag.isValueReference(script)) {
- ValueBinding valueBinding = ComponentUtil.createValueBinding(script, null);
+ ValueBinding valueBinding = ComponentUtil.createValueBinding(script);
script = (String) valueBinding.getValue(FacesContext.getCurrentInstance());
}
return script;
@@ -689,7 +655,7 @@
public static UIColumn createTextColumn(String label, String sortable, String align, String value) {
UIComponent text = createComponent(UIOutput.COMPONENT_TYPE, RENDERER_TYPE_OUT);
- setStringProperty(text, ATTR_VALUE, value, null);
+ setStringProperty(text, ATTR_VALUE, value);
setBooleanProperty(text, ATTR_CREATE_SPAN, "false");
setBooleanProperty(text, ATTR_ESCAPE, "false");
return createColumn(label, sortable, align, text);
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ForEachTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ForEachTag.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ForEachTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ForEachTag.java Thu Apr 20 12:14:05 2006
@@ -85,7 +85,7 @@
if (stop == IterationHelper.ALL) {
if (UIComponentTag.isValueReference(forEachItems)) {
final Object items
- = ComponentUtil.createValueBinding(this.forEachItems, null).getValue(facesContext);
+ = ComponentUtil.createValueBinding(this.forEachItems).getValue(facesContext);
if (items instanceof List) {
stop = ((List) items).size();
} else if (items instanceof Object[]) {
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LoadBundleTag.java Thu Apr 20 12:14:05 2006
@@ -19,16 +19,13 @@
import org.apache.myfaces.tobago.apt.annotation.BodyContent;
import org.apache.myfaces.tobago.apt.annotation.Tag;
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
-import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
-import org.apache.myfaces.tobago.context.ResourceManagerUtil;
import org.apache.myfaces.tobago.taglib.decl.HasVar;
+import org.apache.myfaces.tobago.util.BundleMapWrapper;
import javax.faces.context.FacesContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
-import java.util.Collection;
import java.util.Map;
-import java.util.Set;
/**
* Load a resource bundle localized for the Locale of the current view
@@ -64,7 +61,6 @@
* Base name of the resource bundle to be loaded.
*/
@TagAttribute(required = true)
- @UIComponentTagAttribute()
public void setBasename(String basename) {
this.basename = basename;
}
@@ -72,80 +68,16 @@
public String getVar() {
return var;
}
-
+ /**
+ *
+ * Name of a session-scope attribute under which the bundle data
+ * will be exposed.
+ *
+ */
+ @TagAttribute(required = true)
public void setVar(String var) {
this.var = var;
}
- private static class BundleMapWrapper implements Map {
-
- private String basename;
-
- public BundleMapWrapper(String basename) {
- this.basename = basename;
- }
-
- public void clear() {
- throw new UnsupportedOperationException();
- }
-
- public boolean containsKey(Object key) {
- if (null == key) {
- return false;
- }
- String value = ResourceManagerUtil.getPropertyNotNull(
- FacesContext.getCurrentInstance(), basename, key.toString());
- return value != null;
- }
-
- public boolean containsValue(Object value) {
- throw new UnsupportedOperationException();
- }
-
- public Set entrySet() {
- throw new UnsupportedOperationException();
- }
-
- public Object get(Object key) {
- if (null == key) {
- return null;
- }
- String value = ResourceManagerUtil.getPropertyNotNull(
- FacesContext.getCurrentInstance(), basename, key.toString());
- return value;
- }
-
- public int hashCode() {
- return basename.hashCode();
- }
-
- public boolean isEmpty() {
- throw new UnsupportedOperationException();
- }
-
- public Set keySet() {
- throw new UnsupportedOperationException();
- }
-
- public Object put(Object k, Object v) {
- throw new UnsupportedOperationException();
- }
-
- public void putAll(Map t) {
- throw new UnsupportedOperationException();
- }
-
- public Object remove(Object k) {
- throw new UnsupportedOperationException();
- }
-
- public int size() {
- throw new UnsupportedOperationException();
- }
-
- public Collection values() {
- throw new UnsupportedOperationException();
- }
- }
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/StyleTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/StyleTag.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/StyleTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/StyleTag.java Thu Apr 20 12:14:05 2006
@@ -77,7 +77,6 @@
* Name of the stylsheet file to add to page.
*/
@TagAttribute
- //@UIComponentTagAttribute(expression=DynamicExpression.NONE)
public void setStyle(String style) {
this.style = style;
}
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabChangeListenerTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabChangeListenerTag.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabChangeListenerTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/TabChangeListenerTag.java Thu Apr 20 12:14:05 2006
@@ -19,11 +19,9 @@
import org.apache.myfaces.tobago.apt.annotation.BodyContent;
import org.apache.myfaces.tobago.apt.annotation.Tag;
import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
-import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
import org.apache.myfaces.tobago.component.ComponentUtil;
-import org.apache.myfaces.tobago.component.UITabGroup;
import org.apache.myfaces.tobago.event.TabChangeListener;
-import org.apache.myfaces.tobago.taglib.decl.HasTabChangeListenerType;
+import org.apache.myfaces.tobago.event.TabChangeSource;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -32,37 +30,39 @@
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
-// TODO: maybe drop this tag and do that with an attribute in tabGroup
-
/**
* Register an TabChangedListener instance on the UIComponent
* associated with the closest parent UIComponent custom action.
*/
@Tag(name = "tabChangeListener", bodyContent = BodyContent.EMPTY)
-public class TabChangeListenerTag extends TagSupport
- implements HasTabChangeListenerType {
+public class TabChangeListenerTag extends TagSupport {
/**
* <p>The fully qualified class name of the {@link TabChangeListener}
* instance to be created.</p>
*/
- private String type = null;
- private String typeString = null;
-
-
+ private String type;
+ private String binding;
/**
* Fully qualified Java class name of a TabChangeListener to be
* created and registered.
*/
@TagAttribute(required = true)
- @UIComponentTagAttribute()
public void setType(String type) {
+ this.type = type;
+ }
- this.typeString = type;
-
+ /**
+ * The value binding expression to a TabChangeListener.
+ */
+ @TagAttribute
+ public void setBinding(String binding) {
+ this.binding = binding;
}
+
+
/**
* <p>Create a new instance of the specified {@link TabChangeListener}
* class, and register it with the {@link javax.faces.component.UIComponent} instance associated
@@ -78,38 +78,56 @@
UIComponentTag tag =
UIComponentTag.getParentUIComponentTag(pageContext);
if (tag == null) {
- throw new JspException("com.sun.faces.NOT_NESTED_IN_FACES_TAG_ERROR");
+ // TODO Message resource i18n
+ throw new JspException("Not nested in faces tag");
}
- // Nothing to do unless this tag created a component
if (!tag.getCreated()) {
return (SKIP_BODY);
}
- // evaluate any VB expression that we were passed
- if (UIComponentTag.isValueReference(typeString)) {
- ValueBinding valueBinding = ComponentUtil.createValueBinding(typeString, null);
- type = (String) valueBinding.getValue(FacesContext.getCurrentInstance());
- } else {
- type = typeString;
- }
-
- // Create and register an instance with the appropriate component
- TabChangeListener handler = createStateChangeListener();
-
UIComponent component = tag.getComponentInstance();
if (component == null) {
- throw new JspException("com.sun.faces.NULL_COMPONENT_ERROR");
+ // TODO Message resource i18n
+ throw new JspException("Component Instance is null");
}
- // We need to cast here because addTabChangeListener
- // method does not apply to al components (it is not a method on
- // UIComponent).
- if (component instanceof UITabGroup) {
- ((UITabGroup) component).addTabChangeListener(handler);
+ if (!(component instanceof TabChangeSource)) {
+ // TODO Message resource i18n
+ throw new JspException("Component "+ component.getClass().getName() + " is not instanceof TabChangeSource");
}
+ TabChangeSource changeSource = (TabChangeSource) component;
- return (SKIP_BODY);
+ TabChangeListener handler = null;
+
+ if (UIComponentTag.isValueReference(binding)) {
+ ValueBinding valueBinding = ComponentUtil.createValueBinding(binding);
+ if (valueBinding != null) {
+ Object obj = valueBinding.getValue(FacesContext.getCurrentInstance());
+ if (obj != null && obj instanceof TabChangeListener) {
+ handler = (TabChangeListener) obj;
+ }
+ }
+ }
+ if (handler == null && type != null) {
+ String className;
+ // evaluate any VB expression that we were passed
+ if (UIComponentTag.isValueReference(type)) {
+ ValueBinding typeValueBinding = ComponentUtil.createValueBinding(type);
+ className = (String) typeValueBinding.getValue(FacesContext.getCurrentInstance());
+ } else {
+ className = type;
+ }
+ handler = createStateChangeListener(className);
+ if (handler != null && binding != null) {
+ ComponentUtil.setValueForValueBinding(binding, handler);
+ }
+ }
+ if (handler != null) {
+ changeSource.addTabChangeListener(handler);
+ }
+ // TODO else LOG.warn?
+ return (SKIP_BODY);
}
@@ -118,7 +136,7 @@
*/
public void release() {
this.type = null;
-
+ this.binding = null;
}
/**
@@ -127,9 +145,9 @@
*
* @throws javax.servlet.jsp.JspException if a new instance cannot be created
*/
- protected TabChangeListener createStateChangeListener() throws JspException {
+ protected TabChangeListener createStateChangeListener(String className) throws JspException {
try {
- Class clazz = getClass().getClassLoader().loadClass(type);
+ Class clazz = getClass().getClassLoader().loadClass(className);
return ((TabChangeListener) clazz.newInstance());
} catch (Exception e) {
throw new JspException(e);
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasScript.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasScript.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasScript.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasScript.java Thu Apr 20 12:14:05 2006
@@ -27,6 +27,10 @@
* To change this template use File | Settings | File Templates.
*/
public interface HasScript {
+ /**
+ * Script to be invoked when clicked
+ * @param actionScript
+ */
@TagAttribute @UIComponentTagAttribute()
void setScript(String actionScript);
Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/BundleMapWrapper.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/BundleMapWrapper.java?rev=395673&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/BundleMapWrapper.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/util/BundleMapWrapper.java Thu Apr 20 12:14:05 2006
@@ -0,0 +1,103 @@
+package org.apache.myfaces.tobago.util;
+
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import org.apache.myfaces.tobago.context.ResourceManagerUtil;
+
+import javax.faces.context.FacesContext;
+import java.util.Map;
+import java.util.Set;
+import java.util.Collection;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 20.04.2006
+ * Time: 19:31:21
+ * To change this template use File | Settings | File Templates.
+ */
+public class BundleMapWrapper implements Map {
+
+ private String basename;
+
+ public BundleMapWrapper(String basename) {
+ this.basename = basename;
+ }
+
+ public void clear() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean containsKey(Object key) {
+ if (null == key) {
+ return false;
+ }
+ String value = ResourceManagerUtil.getPropertyNotNull(
+ FacesContext.getCurrentInstance(), basename, key.toString());
+ return value != null;
+ }
+
+ public boolean containsValue(Object value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set entrySet() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object get(Object key) {
+ if (null == key) {
+ return null;
+ }
+ String value = ResourceManagerUtil.getPropertyNotNull(
+ FacesContext.getCurrentInstance(), basename, key.toString());
+ return value;
+ }
+
+ public int hashCode() {
+ return basename.hashCode();
+ }
+
+ public boolean isEmpty() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set keySet() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object put(Object k, Object v) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void putAll(Map t) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object remove(Object k) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int size() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Collection values() {
+ throw new UnsupportedOperationException();
+ }
+}
+
Modified: myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java (original)
+++ myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java Thu Apr 20 12:14:05 2006
@@ -28,6 +28,7 @@
import org.apache.myfaces.tobago.component.UIInput;
import org.apache.myfaces.tobago.context.ResourceManagerUtil;
import org.apache.myfaces.tobago.event.SheetStateChangeEvent;
+import org.apache.myfaces.tobago.event.TabChangeListener;
import org.apache.myfaces.tobago.example.demo.model.solar.Solar;
import org.apache.myfaces.tobago.example.demo.model.solar.SolarObject;
import org.apache.myfaces.tobago.model.TreeState;
@@ -109,6 +110,8 @@
private SelectItem[] toolbarTextItems;
+ private TabChangeListener tabChangeListener;
+
public TobagoDemoController() {
@@ -198,6 +201,16 @@
{ToolBarTag.LABEL_OFF, ToolBarTag.LABEL_BOTTOM, ToolBarTag.LABEL_RIGHT};
toolbarTextItems = getSelectItems(toolbarTextKeys, "demo");
toolbarTextPosition = ToolBarTag.LABEL_BOTTOM;
+ }
+
+ public TabChangeListener getTabChangeListener() {
+ System.err.println("getTabChangeListener " + tabChangeListener);
+ return tabChangeListener;
+ }
+
+ public void setTabChangeListener(TabChangeListener tabChangeListener) {
+ LOG.error("Setting TabChangeListener " + tabChangeListener);
+ this.tabChangeListener = tabChangeListener;
}
private List<UIColumn> createSolarArrayColumns() {
Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/navigator.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/navigator.jsp?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/navigator.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/mini-howto/navigator.jsp Thu Apr 20 12:14:05 2006
@@ -13,80 +13,56 @@
* See the License for the specific language governing permissions and
* limitations under the License.
--%>
-<%@ page import="javax.faces.context.FacesContext"%>
<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<f:subview id="navigator" >
+<f:subview id="navigator">
<tc:panel>
<f:facet name="layout">
<tc:gridLayout columns="10px;1*"
- rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;1*" />
+ rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;1*"/>
</f:facet>
- <%
- // FIXME: this hotfix ensures that, "miniHowtoNavigation" is available
- // for JSTL-Tags
- FacesContext facesContext = FacesContext.getCurrentInstance();
- facesContext.getApplication().getVariableResolver()
- .resolveVariable(facesContext, "miniHowtoNavigation");
- %>
-
- <f:verbatim>
- <c:if test='${miniHowtoNavigation.currentPage == "mini-howto/intro"}'>
- <tc:image value="image/navigate-pointer.gif" height="16" width="16" />
- </c:if>
- </f:verbatim>
+ <tc:image rendered="#{miniHowtoNavigation.currentPage == 'mini-howto/intro'}"
+ value="image/navigate-pointer.gif" height="16" width="16"/>
+
<tc:link action="mini-howto/intro" immediate="true"
- actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.intro}" />
+ actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.intro}"/>
+
+ <tc:image rendered="#{miniHowtoNavigation.currentPage == 'mini-howto/jspDefinition'}"
+ value="image/navigate-pointer.gif" width="16px" height="16px"/>
- <f:verbatim>
- <c:if test='${miniHowtoNavigation.currentPage == "mini-howto/jspDefinition"}'>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px" />
- </c:if>
- </f:verbatim>
<tc:link action="mini-howto/jspDefinition" immediate="true"
- actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.jspDefinition}" />
+ actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.jspDefinition}"/>
+
+ <tc:image rendered="#{miniHowtoNavigation.currentPage == 'mini-howto/navigationRules'}"
+ value="image/navigate-pointer.gif" width="16px" height="16px"/>
- <f:verbatim>
- <c:if test='${miniHowtoNavigation.currentPage == "mini-howto/navigationRules"}'>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px" />
- </c:if>
- </f:verbatim>
<tc:link action="mini-howto/navigationRules" immediate="true"
- actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.navigationRules}" />
+ actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.navigationRules}"/>
+
+ <tc:image rendered="#{miniHowtoNavigation.currentPage == 'mini-howto/classDefinition'}"
+ value="image/navigate-pointer.gif" width="16px" height="16px"/>
- <f:verbatim>
- <c:if test='${miniHowtoNavigation.currentPage == "mini-howto/classDefinition"}'>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px" />
- </c:if>
- </f:verbatim>
<tc:link action="mini-howto/classDefinition" immediate="true"
- actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.classDefinition}" />
+ actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.classDefinition}"/>
+
+ <tc:image rendered="#{miniHowtoNavigation.currentPage == 'mini-howto/theme'}"
+ value="image/navigate-pointer.gif" width="16px" height="16px"/>
- <f:verbatim>
- <c:if test='${miniHowtoNavigation.currentPage == "mini-howto/theme"}'>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px" />
- </c:if>
- </f:verbatim>
<tc:link action="mini-howto/theme" immediate="true"
- actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.theme}" />
+ actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.theme}"/>
+
+ <tc:image rendered="#{miniHowtoNavigation.currentPage == 'mini-howto/validation'}"
+ value="image/navigate-pointer.gif" width="16px" height="16px"/>
- <f:verbatim>
- <c:if test='${miniHowtoNavigation.currentPage == "mini-howto/validation"}'>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px" />
- </c:if>
- </f:verbatim>
<tc:link action="mini-howto/validation" immediate="true"
- actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.validation}" />
+ actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.validation}"/>
+
+ <tc:image rendered="#{miniHowtoNavigation.currentPage == 'mini-howto/i18n'}"
+ value="image/navigate-pointer.gif" width="16px" height="16px"/>
- <f:verbatim>
- <c:if test='${miniHowtoNavigation.currentPage == "mini-howto/i18n"}'>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px" />
- </c:if>
- </f:verbatim>
<tc:link action="mini-howto/i18n" immediate="true"
- actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.i18n}" />
+ actionListener="#{miniHowtoNavigation.navigate}" label="#{miniHowtoBundle.i18n}"/>
<tc:cell spanX="2">
<f:verbatim>
@@ -94,12 +70,13 @@
</f:verbatim>
</tc:cell>
- <tc:cell />
+ <tc:cell/>
+
<tc:link action="#{overviewNavigation.getCurrentPage}" immediate="true"
- tip="#{miniHowtoBundle.overviewNavigateTooltip}"
- label="#{miniHowtoBundle.overview}" />
+ tip="#{miniHowtoBundle.overviewNavigateTooltip}"
+ label="#{miniHowtoBundle.overview}"/>
- <tc:cell spanX="2" />
+ <tc:cell spanX="2"/>
</tc:panel>
</f:subview>
Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/overview/navigator.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/example/demo/src/main/webapp/overview/navigator.jsp?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/overview/navigator.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/overview/navigator.jsp Thu Apr 20 12:14:05 2006
@@ -13,110 +13,77 @@
* See the License for the specific language governing permissions and
* limitations under the License.
--%>
-<%@ page import="javax.faces.context.FacesContext"%>
<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<f:subview id="navigator" >
+<f:subview id="navigator">
<tc:panel>
<f:facet name="layout">
<tc:gridLayout columns="16px;1*"
- rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;1*" />
-<%-- rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;1*" />--%>
+ rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;1*"/>
+ <%-- rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;1*" />--%>
</f:facet>
- <%
- // FIXME: this hotfix ensures that, "overviewNavigation" is available
- // FIXME: for JSTL-Tags <c:if>
- FacesContext facesContext = FacesContext.getCurrentInstance();
- facesContext.getApplication().getVariableResolver()
- .resolveVariable(facesContext, "overviewNavigation");
- %>
-
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif"
- width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/intro'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif"
+ width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/intro'}"/>
<tc:link action="overview/intro" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.intro}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.intro}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/basicControls'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/basicControls'}"/>
<tc:link action="overview/basicControls" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.basicControls}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.basicControls}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/sheetControl'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/sheetControl'}"/>
<tc:link action="overview/sheetControl" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.sheetControl}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.sheetControl}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/treeControl'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/treeControl'}"/>
<tc:link action="overview/treeControl" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.treeControl}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.treeControl}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/tabControl'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/tabControl'}"/>
<tc:link action="overview/tabControl" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.tabControl}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.tabControl}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/toolbar'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/toolbar'}"/>
<tc:link action="overview/toolbar" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.toolbar}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.toolbar}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/validation'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/validation'}"/>
<tc:link action="overview/validation" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.validation}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.validation}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/form'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/form'}"/>
<tc:link action="overview/form" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.form}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.form}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/themes'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/themes'}"/>
<tc:link action="overview/themes" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.themes}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.themes}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/browser'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/browser'}"/>
<tc:link action="overview/browser" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.browser}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.browser}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/locale'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/locale'}"/>
<tc:link action="overview/locale" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.locale}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.locale}"/>
- <f:verbatim>
- <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
- rendered="#{overviewNavigation.currentPage == 'overview/layout'}" />
- </f:verbatim>
+ <tc:image value="image/navigate-pointer.gif" width="16px" height="16px"
+ rendered="#{overviewNavigation.currentPage == 'overview/layout'}"/>
<tc:link action="overview/layout" immediate="true"
- actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.layout}" />
+ actionListener="#{overviewNavigation.navigate}" label="#{overviewBundle.layout}"/>
<tc:cell spanX="2">
<f:verbatim>
@@ -124,12 +91,12 @@
</f:verbatim>
</tc:cell>
- <tc:cell />
+ <tc:cell/>
<tc:link action="#{miniHowtoNavigation.getCurrentPage}" immediate="true"
- tip="#{overviewBundle.miniHowtoNavigateTooltip}"
- label="#{overviewBundle.miniHowto}" />
+ tip="#{overviewBundle.miniHowtoNavigateTooltip}"
+ label="#{overviewBundle.miniHowto}"/>
- <tc:cell spanX="2" />
+ <tc:cell spanX="2"/>
</tc:panel>
</f:subview>
Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/overview/tabControl.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/example/demo/src/main/webapp/overview/tabControl.jsp?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/overview/tabControl.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/overview/tabControl.jsp Thu Apr 20 12:14:05 2006
@@ -85,7 +85,8 @@
<tc:tabGroup id="tabMarsOuterForm2" switchType="reloadTab" state="#{demo.tabState2}" >
- <tc:tabChangeListener type="org.apache.myfaces.tobago.example.demo.actionlistener.SimpleTabChangeListener"/>
+ <tc:tabChangeListener type="org.apache.myfaces.tobago.example.demo.actionlistener.SimpleTabChangeListener"
+ binding="#{demo.tabChangeListener}" />
<tc:tab label="#{overviewBundle.tabPlanet}">
<tc:panel >
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java Thu Apr 20 12:14:05 2006
@@ -185,8 +185,8 @@
toolbar.getChildren().add(command);
command.getAttributes().put(ATTR_IMAGE, "image/tobago-richtext-edit.gif");
- command.setValueBinding(ATTR_DISABLED, ComponentUtil.createValueBinding("#{! tobagoRichtextPreviewState}", null));
- command.setValueBinding(ATTR_VALUE, ComponentUtil.createValueBinding("#{!tobagoRichtextPreviewState}", null));
+ command.setValueBinding(ATTR_DISABLED, ComponentUtil.createValueBinding("#{! tobagoRichtextPreviewState}"));
+ command.setValueBinding(ATTR_VALUE, ComponentUtil.createValueBinding("#{!tobagoRichtextPreviewState}"));
String title = ResourceManagerUtil.getPropertyNotNull(
facesContext, "tobago", "tobago.richtexteditor.edit.title");
@@ -201,8 +201,8 @@
toolbar.getChildren().add(command);
//command.getAttributes().put(ATTR_COMMAND_TYPE, ToolBarSelectBooleanTag.COMMAND_TYPE);
command.getAttributes().put(ATTR_IMAGE, "image/tobago-richtext-preview.gif");
- command.setValueBinding(ATTR_DISABLED, ComponentUtil.createValueBinding("#{tobagoRichtextPreviewState}", null));
- command.setValueBinding(ATTR_VALUE, ComponentUtil.createValueBinding("#{tobagoRichtextPreviewState}", null));
+ command.setValueBinding(ATTR_DISABLED, ComponentUtil.createValueBinding("#{tobagoRichtextPreviewState}"));
+ command.setValueBinding(ATTR_VALUE, ComponentUtil.createValueBinding("#{tobagoRichtextPreviewState}"));
title = ResourceManagerUtil.getPropertyNotNull(
facesContext, "tobago", "tobago.richtexteditor.preview.title");
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/AbstractAnnotationVisitor.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/AbstractAnnotationVisitor.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/AbstractAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/AbstractAnnotationVisitor.java Thu Apr 20 12:14:05 2006
@@ -28,7 +28,7 @@
* To change this template use File | Settings | File Templates.
*/
public abstract class AbstractAnnotationVisitor extends AnnotationDeclarationVisitorCollector {
- protected final AnnotationProcessorEnvironment env;
+ private final AnnotationProcessorEnvironment env;
public AbstractAnnotationVisitor(AnnotationProcessorEnvironment env) {
this.env = env;
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessor.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessor.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessor.java Thu Apr 20 12:14:05 2006
@@ -47,8 +47,8 @@
*/
public class FaceletAnnotationProcessor implements AnnotationProcessor {
- protected final AnnotationProcessorEnvironment env;
- protected final Set<AnnotationTypeDeclaration> atds;
+ private final AnnotationProcessorEnvironment env;
+ private final Set<AnnotationTypeDeclaration> atds;
public FaceletAnnotationProcessor(Set<AnnotationTypeDeclaration> atds,
AnnotationProcessorEnvironment env) {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessorFactory.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessorFactory.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessorFactory.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationProcessorFactory.java Thu Apr 20 12:14:05 2006
@@ -35,21 +35,21 @@
*/
public class FaceletAnnotationProcessorFactory implements AnnotationProcessorFactory {
- private FaceletAnnotationProcessor annotationProcessor = null;
-
- private static final Collection<String> supportedAnnotations
+ private static final Collection<String> SUPPORTED_ANNOTATIONS
= Collections.unmodifiableCollection(Arrays.asList("org.apache.myfaces.tobago.apt.annotation.Tag",
"org.apache.myfaces.tobago.apt.annotation.TagAttribute", "org.apache.myfaces.tobago.apt.annotation.Taglib",
- "org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute" ));
+ "org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute"));
- private static final Collection<String> supportedOptions = Collections.emptyList();
+ private static final Collection<String> SUPPORTED_OPTIONS = Collections.emptyList();
+
+ private FaceletAnnotationProcessor annotationProcessor = null;
public Collection<String> supportedAnnotationTypes() {
- return supportedAnnotations;
+ return SUPPORTED_ANNOTATIONS;
}
public Collection<String> supportedOptions() {
- return supportedOptions;
+ return SUPPORTED_OPTIONS;
}
public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds,
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java Thu Apr 20 12:14:05 2006
@@ -84,14 +84,14 @@
JCompUnit unit = new JCompUnit(libraryClass);
libraryClass.setSuperClass("AbstractTobagoTagLibrary");
- JField nameSpace = new JField(new JClass("String"),"NAMESPACE");
+ JField nameSpace = new JField(new JClass("String"), "NAMESPACE");
nameSpace.getModifiers().setFinal(true);
nameSpace.getModifiers().setStatic(true);
nameSpace.getModifiers().makePublic();
nameSpace.setInitString("\""+taglibAnnotation.uri()+"\"");
libraryClass.addField(nameSpace);
- JField instance = new JField(libraryClass,"INSTANCE");
+ JField instance = new JField(libraryClass, "INSTANCE");
instance.getModifiers().setFinal(true);
instance.getModifiers().setStatic(true);
instance.getModifiers().makePublic();
@@ -108,7 +108,7 @@
}
}
- Writer writer = env.getFiler().createTextFile(Filer.Location.SOURCE_TREE,
+ Writer writer = getEnv().getFiler().createTextFile(Filer.Location.SOURCE_TREE,
packageName,
new File(libraryClass.getName(true)+".java"), null);
JSourceWriter sourceWriter = new JSourceWriter(writer);
@@ -122,15 +122,15 @@
Tag annotationTag = decl.getAnnotation(Tag.class);
if (annotationTag != null) {
- createTag(constructor,decl, annotationTag);
+ createTag(constructor, decl, annotationTag);
}
}
- protected void createTag(JConstructor constructor,InterfaceDeclaration decl, Tag annotationTag) {
+ protected void createTag(JConstructor constructor, InterfaceDeclaration decl, Tag annotationTag) {
UIComponentTag componentTag = decl.getAnnotation(UIComponentTag.class);
if (componentTag == null) {
- return ;
+ return;
}
try {
Class uiComponentClass = Class.forName(componentTag.uiComponent());
@@ -139,7 +139,7 @@
addComponent.append(annotationTag.name());
Field componentField = uiComponentClass.getField("COMPONENT_TYPE");
- String componentType = (String)componentField.get(null);
+ String componentType = (String) componentField.get(null);
addComponent.append("\", \"");
addComponent.append(componentType);
@@ -160,9 +160,4 @@
e.printStackTrace();
}
}
-
- public AnnotationProcessorEnvironment getEnv() {
- return env;
- }
-
}
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessor.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessor.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessor.java Thu Apr 20 12:14:05 2006
@@ -44,22 +44,21 @@
*/
public class TaglibAnnotationProcessor implements AnnotationProcessor {
- protected final AnnotationProcessorEnvironment env;
- protected final Set<AnnotationTypeDeclaration> atds;
+ private final AnnotationProcessorEnvironment env;
+ private final Set<AnnotationTypeDeclaration> atds;
public TaglibAnnotationProcessor(Set<AnnotationTypeDeclaration> atds,
AnnotationProcessorEnvironment env) {
this.atds = atds;
this.env = env;
this.env.getMessager().printNotice("Starting annotation process");
-
}
public void process() {
TaglibAnnotationVisitor visitor = new TaglibAnnotationVisitor(env);
for (AnnotationTypeDeclaration atd : atds) {
- env.getMessager().printNotice("Collecting annotation "+atd);
+ env.getMessager().printNotice("Collecting annotation " + atd);
Collection<Declaration> decls = env.getDeclarationsAnnotatedWith(atd);
for (Declaration decl : decls) {
decl.accept(DeclarationVisitors.getDeclarationScanner(visitor, DeclarationVisitors.NO_OP));
@@ -82,8 +81,8 @@
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.transform(new DOMSource(documentAndFileName.getDocument()),
new StreamResult(writer));
- env.getMessager().printNotice("Write to file " +documentAndFileName.getPackageName()+" "+
- documentAndFileName.getFileName());
+ env.getMessager().printNotice("Write to file " + documentAndFileName.getPackageName()
+ + " " + documentAndFileName.getFileName());
IOUtils.closeQuietly(writer);
}
} catch (ParserConfigurationException e) {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationProcessorFactory.java Thu Apr 20 12:14:05 2006
@@ -33,20 +33,21 @@
*/
public class TaglibAnnotationProcessorFactory implements AnnotationProcessorFactory {
- private TaglibAnnotationProcessor annotationProcessor = null;
-
- private static final Collection<String> supportedAnnotations
+ private static final Collection<String> SUPPORTED_ANNOTATIONS
= Collections.unmodifiableCollection(Arrays.asList("org.apache.myfaces.tobago.apt.annotation.Tag",
- "org.apache.myfaces.tobago.apt.annotation.TagAttribute", "org.apache.myfaces.tobago.apt.annotation.Taglib" ));
+ "org.apache.myfaces.tobago.apt.annotation.TagAttribute",
+ "org.apache.myfaces.tobago.apt.annotation.Taglib"));
- private static final Collection<String> supportedOptions = Collections.emptySet();
+ private static final Collection<String> SUPPORTED_OPTIONS = Collections.emptySet();
+
+ private TaglibAnnotationProcessor annotationProcessor = null;
public Collection<String> supportedAnnotationTypes() {
- return supportedAnnotations;
+ return SUPPORTED_ANNOTATIONS;
}
public Collection<String> supportedOptions() {
- return supportedOptions;
+ return SUPPORTED_OPTIONS;
}
public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds,
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TaglibAnnotationVisitor.java Thu Apr 20 12:14:05 2006
@@ -121,7 +121,7 @@
//decl.getQualifiedName().replaceAll("Declaration", "");
String msg = "Replacing: " + decl.getQualifiedName()
+ " -> " + className;
- env.getMessager().printNotice(msg);
+ getEnv().getMessager().printNotice(msg);
Element tag = createTag(decl, annotationTag, className, document);
addAttributes(decl, tag, document);
parent.appendChild(tag);
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessor.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessor.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessor.java Thu Apr 20 12:14:05 2006
@@ -45,8 +45,8 @@
*/
public class TobagoAnnotationProcessor implements AnnotationProcessor {
- protected final AnnotationProcessorEnvironment env;
- protected final Set<AnnotationTypeDeclaration> atds;
+ private final AnnotationProcessorEnvironment env;
+ private final Set<AnnotationTypeDeclaration> atds;
public TobagoAnnotationProcessor(Set<AnnotationTypeDeclaration> atds,
AnnotationProcessorEnvironment env) {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessorFactory.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessorFactory.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessorFactory.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationProcessorFactory.java Thu Apr 20 12:14:05 2006
@@ -33,21 +33,21 @@
*/
public class TobagoAnnotationProcessorFactory implements AnnotationProcessorFactory {
- private TobagoAnnotationProcessor annotationProcessor = null;
-
- private static final Collection<String> supportedAnnotations
+ private static final Collection<String> SUPPORTED_ANNOTATIONS
= Collections.unmodifiableCollection(Arrays.asList("org.apache.myfaces.tobago.apt.annotation.Tag",
"org.apache.myfaces.tobago.apt.annotation.TagAttribute", "org.apache.myfaces.tobago.apt.annotation.Taglib",
- "org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute" ));
+ "org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute"));
- private static final Collection<String> supportedOptions = Collections.emptyList();
+ private static final Collection<String> SUPPORTED_OPTIONS = Collections.emptyList();
+
+ private TobagoAnnotationProcessor annotationProcessor = null;
public Collection<String> supportedAnnotationTypes() {
- return supportedAnnotations;
+ return SUPPORTED_ANNOTATIONS;
}
public Collection<String> supportedOptions() {
- return supportedOptions;
+ return SUPPORTED_OPTIONS;
}
public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds,
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/TobagoAnnotationVisitor.java Thu Apr 20 12:14:05 2006
@@ -35,8 +35,6 @@
*/
public class TobagoAnnotationVisitor extends TaglibAnnotationVisitor {
-
-
public TobagoAnnotationVisitor(AnnotationProcessorEnvironment env) {
super(env);
}
@@ -52,7 +50,8 @@
if (contentDescription != null) {
if (bodyContent.equals(BodyContent.JSP)
&& contentDescription.contentType().length() > 0) {
- throw new IllegalArgumentException("contentType " + contentDescription.contentType() + " for bodyContent JSP not allowed!");
+ throw new IllegalArgumentException("contentType "
+ + contentDescription.contentType() + " for bodyContent JSP not allowed!");
} else if (bodyContent.equals(BodyContent.TAGDEPENDENT)
&& contentDescription.contentType().length() == 0) {
throw new IllegalArgumentException("contentType should set for tagdependent bodyContent");
@@ -97,7 +96,8 @@
String simpleName = d.getSimpleName();
if (simpleName.startsWith("set")) {
Element attribute = document.createElement("attribute");
- addLeafTextElement(simpleName.substring(3, 4).toLowerCase() + simpleName.substring(4), "name", attribute, document);
+ addLeafTextElement(simpleName.substring(3, 4).toLowerCase()
+ + simpleName.substring(4), "name", attribute, document);
addLeafTextElement(Boolean.toString(tagAttribute.required()), "required", attribute, document);
addLeafTextElement(Boolean.toString(tagAttribute.rtexprvalue()), "rtexprvalue", attribute, document);
if (uiTagAttribute != null) {
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/DynamicExpression.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/DynamicExpression.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/DynamicExpression.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/DynamicExpression.java Thu Apr 20 12:14:05 2006
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-/**
+/*
* Created: Apr 27, 2005 5:08:45 PM
* User: bommel
* $Id: DynamicExpression.java,v 1.1 2005/05/11 15:20:34 bommel Exp $
@@ -33,8 +33,8 @@
return "MB";
case NONE:
return "NONE";
+ default:
+ throw new IllegalStateException("Unexpected DynamicExpression " + name());
}
- throw new IllegalStateException("Unexpected DynamicExpression " + name());
}
-
}
Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/Tag.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/Tag.java?rev=395673&r1=395672&r2=395673&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/Tag.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/annotation/Tag.java Thu Apr 20 12:14:05 2006
@@ -16,21 +16,20 @@
* limitations under the License.
*/
-import javax.servlet.jsp.tagext.TagExtraInfo;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-/**
+/*
* Created: Mar 8, 2005 5:40:59 PM
* User: bommel
* $Id: Tag.java,v 1.2 2005/04/20 18:39:09 bommel Exp $
*/
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = ElementType.TYPE)
-
public @interface Tag {
+
String name();
BodyContent bodyContent() default BodyContent.JSP;