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/19 15:39:36 UTC

svn commit: r395244 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/ core/src/main/java/org/apache/myfaces/tobago/component/ core/src/main/java/org/apache/myfaces/tobago/event/ core/src/main/java/org/apache/myfaces/tobago/tagli...

Author: bommel
Date: Wed Apr 19 06:39:34 2006
New Revision: 395244

URL: http://svn.apache.org/viewcvs?rev=395244&view=rev
Log:
enable script command for facelets

Added:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagExtraInfo.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasNavigate.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasScript.java
Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.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/component/UITree.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ButtonTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LinkTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuCommandTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectBooleanTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectOneTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarCommandTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectBooleanTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectOneTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
    myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/ButtonRenderer.java
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/pom.xml
    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/annotation/Tag.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java Wed Apr 19 06:39:34 2006
@@ -21,7 +21,8 @@
   public static final String SUBCOMPONENT_SEP = "::";
 
 //  public static final String ATTR_ACCESS_KEY = "accessKey";
-  public static final String ATTR_ACTION_STRING = "actionString";
+  public static final String ATTR_ACTION_SCRIPT = "script";
+  public static final String ATTR_ACTION_NAVIGATE = "navigate";
   public static final String ATTR_ACTION_LISTENER = "actionListener";
   public static final String ATTR_ALIGN = "align";
   public static final String ATTR_ALT = "alt";

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=395244&r1=395243&r2=395244&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 Wed Apr 19 06:39:34 2006
@@ -23,7 +23,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_NAVIGATE;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_SCRIPT;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALIGN;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CREATE_SPAN;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
@@ -55,7 +56,7 @@
 import javax.faces.application.Application;
 import javax.faces.component.ActionSource;
 import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIColumn;
+
 import javax.faces.component.UICommand;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIGraphic;
@@ -876,7 +877,13 @@
         && (commandType.equals(COMMAND_TYPE_NAVIGATE)
           || commandType.equals(COMMAND_TYPE_RESET)
           || commandType.equals(COMMAND_TYPE_SCRIPT))) {
-      setStringProperty(component, ATTR_ACTION_STRING, action);
+      if (commandType.equals(COMMAND_TYPE_NAVIGATE)) {
+        setStringProperty(component, ATTR_ACTION_NAVIGATE, action);
+      } else if (commandType.equals(COMMAND_TYPE_SCRIPT)) {
+        setStringProperty(component, ATTR_ACTION_SCRIPT, action);
+      } else {
+        LOG.warn("Type reset is not supported");
+      }
     } else {
       if (action != null) {
         if (UIComponentTag.isValueReference(action)) {

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITree.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITree.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITree.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UITree.java Wed Apr 19 06:39:34 2006
@@ -18,7 +18,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ICON_SIZE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_IMAGE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL_POSITION;
@@ -183,8 +182,7 @@
       UICommand command = (UICommand) ComponentUtil.createComponent(
           facesContext, UICommand.COMPONENT_TYPE, RENDERER_TYPE_LINK);
       toolbar.getChildren().add(command);
-      command.setId("button" + i);
-      command.getAttributes().put(ATTR_ACTION_STRING, commands[i].getCommand());
+      command.setId(commands[i].getCommand());
 
       for (ActionListener listener : getActionListeners()) {
         command.addActionListener(listener);

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/event/DefaultTreeActionListener.java Wed Apr 19 06:39:34 2006
@@ -23,7 +23,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
 import org.apache.myfaces.tobago.component.UITree;
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.model.TreeState;
@@ -66,8 +65,7 @@
     UITree tree = (UITree) component;
     TreeState treeState = tree.getState();
     DefaultMutableTreeNode marker = treeState.getMarker();
-    String command = (String) actionEvent.getComponent().getAttributes().get(
-        ATTR_ACTION_STRING);
+    String command = actionEvent.getComponent().getId();
 
     if (LOG.isDebugEnabled()) {
       LOG.debug("marker      " + marker);

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ButtonTagDeclaration.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ButtonTagDeclaration.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ButtonTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ButtonTagDeclaration.java Wed Apr 19 06:39:34 2006
@@ -19,8 +19,6 @@
 import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
-import org.apache.myfaces.tobago.taglib.decl.HasAction;
-import org.apache.myfaces.tobago.taglib.decl.HasActionListener;
 import org.apache.myfaces.tobago.taglib.decl.HasCommandType;
 import org.apache.myfaces.tobago.taglib.decl.HasDeprecatedWidth;
 import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
@@ -43,7 +41,7 @@
 /**
  * Renders a button element.
  */
-@Tag(name = "button")
+@Tag(name = "button", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
 @BodyContentDescription(anyTagOf = "facestag")
 @UIComponentTag(
     uiComponent = "org.apache.myfaces.tobago.component.UICommand",
@@ -51,6 +49,6 @@
 
 public interface ButtonTagDeclaration extends CommandTagDeclaration,
     HasIdBindingAndRendered, HasLabelAndAccessKey, HasImage,
-    IsDisabled, HasAction, HasActionListener, HasCommandType,
+    IsDisabled, HasCommandType,
     IsImmediateCommand, IsDefaultCommand, HasDeprecatedWidth, HasTip, IsInline {
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTag.java Wed Apr 19 06:39:34 2006
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_SCRIPT;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_NAVIGATE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_IMMEDIATE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TYPE;
@@ -31,6 +33,8 @@
   private String actionListener;
   private String type;
   private String immediate;
+  private String script;
+  private String navigate;
 
   public String getComponentType() {
     return UICommand.COMPONENT_TYPE;
@@ -44,6 +48,8 @@
 //   ComponentUtil.setBooleanProperty(component, ATTR_DEFAULT_COMMAND, defaultCommand);
     ComponentUtil.setBooleanProperty(component, ATTR_IMMEDIATE, immediate);
     ComponentUtil.setAction(component, type, action);
+    ComponentUtil.setStringProperty(component, ATTR_ACTION_NAVIGATE, navigate);
+    ComponentUtil.setStringProperty(component, ATTR_ACTION_SCRIPT, script);
     ComponentUtil.setActionListener(command, actionListener);
   }
 
@@ -54,6 +60,8 @@
     type = null;
     disabled = null;
     immediate = null;
+    script = null;
+    navigate = null;
   }
 
   public String getAction() {
@@ -62,6 +70,14 @@
 
   public void setAction(String action) {
     this.action = action;
+  }
+
+  public void setScript(String script) {
+    this.script = script;
+  }
+
+  public void setNavigate(String navigate) {
+    this.navigate = navigate;
   }
 
   public String getActionListener() {

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagDeclaration.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagDeclaration.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagDeclaration.java Wed Apr 19 06:39:34 2006
@@ -1,5 +1,10 @@
 package org.apache.myfaces.tobago.taglib.component;
 
+import org.apache.myfaces.tobago.taglib.decl.HasAction;
+import org.apache.myfaces.tobago.taglib.decl.HasActionListener;
+import org.apache.myfaces.tobago.taglib.decl.HasScript;
+import org.apache.myfaces.tobago.taglib.decl.HasNavigate;
+
 /*
  * Copyright 2002-2005 The Apache Software Foundation.
  *
@@ -26,5 +31,5 @@
  */
 
 
-public interface CommandTagDeclaration extends TobagoTagDeclaration {
+public interface CommandTagDeclaration extends TobagoTagDeclaration, HasAction, HasActionListener, HasScript, HasNavigate {
 }

Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagExtraInfo.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagExtraInfo.java?rev=395244&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagExtraInfo.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/CommandTagExtraInfo.java Wed Apr 19 06:39:34 2006
@@ -0,0 +1,51 @@
+package org.apache.myfaces.tobago.taglib.component;
+
+/*
+ * 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 javax.servlet.jsp.tagext.ValidationMessage;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.TagData;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 19.04.2006
+ * Time: 10:56:39
+ * To change this template use File | Settings | File Templates.
+ */
+public class CommandTagExtraInfo extends TagExtraInfo {
+  public ValidationMessage[] validate(TagData data) {
+    Object action = data.getAttribute("action");
+    Object actionScript = data.getAttribute("script");
+    Object actionNavigate = data.getAttribute("navigate");
+    if (action != null) {
+      if (actionScript != null||actionNavigate != null) {
+        return generateValidationMessages(data);
+      }
+    } else if (actionScript != null&&actionNavigate != null) {
+      return generateValidationMessages(data);
+    }
+    return null;
+  }
+
+  private ValidationMessage[] generateValidationMessages(TagData data) {
+    ValidationMessage messages[]  = new ValidationMessage[1];
+        messages [0] = new ValidationMessage(data.getId(),
+            "Only one Attribute of action, script and navigate is allowed");
+    return messages;
+  }
+}

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LinkTagDeclaration.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LinkTagDeclaration.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LinkTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/LinkTagDeclaration.java Wed Apr 19 06:39:34 2006
@@ -19,8 +19,6 @@
 import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
-import org.apache.myfaces.tobago.taglib.decl.HasAction;
-import org.apache.myfaces.tobago.taglib.decl.HasActionListener;
 import org.apache.myfaces.tobago.taglib.decl.HasCommandType;
 import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
 import org.apache.myfaces.tobago.taglib.decl.HasImage;
@@ -42,13 +40,13 @@
 /**
  * Renders a link element.
  */
-@Tag(name = "link")
+@Tag(name = "link", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
 @BodyContentDescription(anyTagOf = "facestag")
 @UIComponentTag(
     uiComponent = "org.apache.myfaces.tobago.component.UICommand",
     rendererType = "Link")
 public interface LinkTagDeclaration extends CommandTagDeclaration,
     HasIdBindingAndRendered, HasLabelAndAccessKey, IsDisabled,
-    HasAction, HasActionListener, IsInline, HasCommandType,
+    IsInline, HasCommandType,
     HasTarget, HasTip, IsImmediateCommand, HasImage {
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuCommandTagDeclaration.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuCommandTagDeclaration.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuCommandTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuCommandTagDeclaration.java Wed Apr 19 06:39:34 2006
@@ -18,8 +18,6 @@
 
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
-import org.apache.myfaces.tobago.taglib.decl.HasAction;
-import org.apache.myfaces.tobago.taglib.decl.HasActionListener;
 import org.apache.myfaces.tobago.taglib.decl.HasCommandType;
 import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
 import org.apache.myfaces.tobago.taglib.decl.HasImage;
@@ -37,10 +35,10 @@
 /**
  * Renders a menu item.
  */
-@Tag(name = "menuItem")
+@Tag(name = "menuItem", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
 @UIComponentTag(
     uiComponent = "org.apache.myfaces.tobago.component.UIMenuCommand",
     rendererType = "MenuCommand")
 public interface MenuCommandTagDeclaration extends TobagoTagDeclaration, CommandTagDeclaration, HasIdBindingAndRendered,
-    HasLabelAndAccessKey, IsDisabled, HasAction, HasActionListener, HasCommandType, HasImage, IsImmediateCommand {
+    HasLabelAndAccessKey, IsDisabled,  HasCommandType, HasImage, IsImmediateCommand {
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectBooleanTagDeclaration.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectBooleanTagDeclaration.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectBooleanTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectBooleanTagDeclaration.java Wed Apr 19 06:39:34 2006
@@ -18,7 +18,6 @@
 
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
-import org.apache.myfaces.tobago.taglib.decl.HasAction;
 import org.apache.myfaces.tobago.taglib.decl.HasBooleanValue;
 import org.apache.myfaces.tobago.taglib.decl.HasCommandType;
 import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
@@ -38,12 +37,12 @@
  * Renders a checkable menuitem.
  */
 
-@Tag(name = "menucheck")
+@Tag(name = "menucheck", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
 @UIComponentTag(
     uiComponent = "org.apache.myfaces.tobago.component.UISelectBooleanCommand",
     rendererType = "MenuCommand")
 
 public interface MenuSelectBooleanTagDeclaration extends TobagoTagDeclaration, CommandTagDeclaration,
-    HasIdBindingAndRendered, IsDisabled, HasAction, HasCommandType, HasBooleanValue, HasLabelAndAccessKey,
+    HasIdBindingAndRendered, IsDisabled, HasCommandType, HasBooleanValue, HasLabelAndAccessKey,
     IsImmediateCommand {
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectOneTagDeclaration.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectOneTagDeclaration.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectOneTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/MenuSelectOneTagDeclaration.java Wed Apr 19 06:39:34 2006
@@ -37,7 +37,7 @@
 /**
  * Renders a submenu with select one items.
  */
-@Tag(name = "menuradio")
+@Tag(name = "menuradio", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
 @UIComponentTag(
     uiComponent = "org.apache.myfaces.tobago.component.UISelectOneCommand",
     rendererType = "MenuCommand")

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarCommandTagDeclaration.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarCommandTagDeclaration.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarCommandTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarCommandTagDeclaration.java Wed Apr 19 06:39:34 2006
@@ -16,17 +16,15 @@
  * limitations under the License.
  */
 
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
+import org.apache.myfaces.tobago.taglib.decl.HasCommandType;
 import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
-import org.apache.myfaces.tobago.taglib.decl.HasLabelAndAccessKey;
 import org.apache.myfaces.tobago.taglib.decl.HasImage;
-import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
-import org.apache.myfaces.tobago.taglib.decl.HasAction;
-import org.apache.myfaces.tobago.taglib.decl.HasActionListener;
-import org.apache.myfaces.tobago.taglib.decl.HasCommandType;
+import org.apache.myfaces.tobago.taglib.decl.HasLabelAndAccessKey;
 import org.apache.myfaces.tobago.taglib.decl.HasTip;
+import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
 import org.apache.myfaces.tobago.taglib.decl.IsImmediateCommand;
-import org.apache.myfaces.tobago.apt.annotation.Tag;
-import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
 
 /*
  * Created by IntelliJ IDEA.
@@ -39,11 +37,11 @@
 /**
  * Renders a command button within a toolbar.
  */
-@Tag(name = "toolBarCommand")
+@Tag(name = "toolBarCommand", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
 @UIComponentTag(
     uiComponent = "org.apache.myfaces.tobago.component.UICommand",
     rendererType = "Button")
 public interface ToolBarCommandTagDeclaration extends CommandTagDeclaration, HasIdBindingAndRendered,
-    HasLabelAndAccessKey, HasImage, IsDisabled, HasAction, HasActionListener, HasCommandType, HasTip,
+    HasLabelAndAccessKey, HasImage, IsDisabled, HasCommandType, HasTip,
     IsImmediateCommand {
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectBooleanTagDeclaration.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectBooleanTagDeclaration.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectBooleanTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectBooleanTagDeclaration.java Wed Apr 19 06:39:34 2006
@@ -18,7 +18,6 @@
 
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
-import org.apache.myfaces.tobago.taglib.decl.HasAction;
 import org.apache.myfaces.tobago.taglib.decl.HasBooleanValue;
 import org.apache.myfaces.tobago.taglib.decl.HasCommandType;
 import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
@@ -39,11 +38,11 @@
 /**
  * Renders a selectable command button within a toolbar.
  */
-@Tag(name = "toolBarCheck")
+@Tag(name = "toolBarCheck", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
 @UIComponentTag(
     uiComponent = "org.apache.myfaces.tobago.component.UISelectBooleanCommand",
     rendererType = "MenuCommand")
 public interface ToolBarSelectBooleanTagDeclaration extends TobagoTagDeclaration, CommandTagDeclaration,
-    HasIdBindingAndRendered, HasLabelAndAccessKey, HasCommandType, HasImage, IsDisabled, HasAction, HasBooleanValue,
+    HasIdBindingAndRendered, HasLabelAndAccessKey, HasCommandType, HasImage, IsDisabled, HasBooleanValue,
     HasTip, IsImmediateCommand {
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectOneTagDeclaration.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectOneTagDeclaration.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectOneTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ToolBarSelectOneTagDeclaration.java Wed Apr 19 06:39:34 2006
@@ -18,7 +18,6 @@
 
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
-import org.apache.myfaces.tobago.taglib.decl.HasAction;
 import org.apache.myfaces.tobago.taglib.decl.HasCommandType;
 import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
 import org.apache.myfaces.tobago.taglib.decl.HasValue;
@@ -36,10 +35,10 @@
 /**
  * Renders a set of radio command button's within a toolbar.
  */
-@Tag(name = "toolBarSelectOne")
+@Tag(name = "toolBarSelectOne", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
 @UIComponentTag(
     uiComponent = "org.apache.myfaces.tobago.component.UISelectOneCommand",
     rendererType = "MenuCommand")
 public interface ToolBarSelectOneTagDeclaration extends TobagoTagDeclaration, CommandTagDeclaration,
-    HasIdBindingAndRendered, IsDisabled, HasAction, HasCommandType, HasValue, IsImmediateCommand {
+    HasIdBindingAndRendered, IsDisabled, HasCommandType, HasValue, IsImmediateCommand {
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasAction.java Wed Apr 19 06:39:34 2006
@@ -26,15 +26,15 @@
   /**
    *
    * Action to invoke when clicked.
-   * Depends on 'type' attribute:
-   * If type is NOT 'navigate', 'reset' or 'script' this must be a
-   * MethodBinding representing the application action to invoke when
+   * This must be a MethodBinding or a String representing the application action to invoke when
    * this component is activated by the user.
-   * The expression must evaluate to a public method that takes no parameters,
+   * The MethodBinding must evaluate to a public method that takes no parameters,
    * and returns a String (the logical outcome) which is passed to the
    * NavigationHandler for this application.
+   * The String is directly passed to the Navigationhandler.
    *
    */
   @TagAttribute @UIComponentTagAttribute()
   void setAction(String action);
+  
 }

Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasNavigate.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasNavigate.java?rev=395244&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasNavigate.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasNavigate.java Wed Apr 19 06:39:34 2006
@@ -0,0 +1,33 @@
+package org.apache.myfaces.tobago.taglib.decl;
+
+/*
+ * 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.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 19.04.2006
+ * Time: 11:41:03
+ * To change this template use File | Settings | File Templates.
+ */
+public interface HasNavigate {
+  @TagAttribute @UIComponentTagAttribute()
+  void setNavigate(String navigate);
+
+}

Added: 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=395244&view=auto
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasScript.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasScript.java Wed Apr 19 06:39:34 2006
@@ -0,0 +1,33 @@
+package org.apache.myfaces.tobago.taglib.decl;
+
+/*
+ * 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.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 19.04.2006
+ * Time: 11:40:11
+ * To change this template use File | Settings | File Templates.
+ */
+public interface HasScript {
+  @TagAttribute @UIComponentTagAttribute()
+  void setScript(String actionScript);
+
+}

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java Wed Apr 19 06:39:34 2006
@@ -23,16 +23,13 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_NAVIGATE;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_SCRIPT;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DEFAULT_COMMAND;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_IMAGE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TIP;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TYPE;
-import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_NAVIGATE;
-import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_RESET;
-import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_SCRIPT;
 import org.apache.myfaces.tobago.component.ComponentUtil;
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.renderkit.CommandRendererBase;
@@ -129,34 +126,35 @@
 
   private String createButtonType(UIComponent component) {
     String buttonType;
-    String type = (String) component.getAttributes().get(ATTR_TYPE);
+    //String type = (String) component.getAttributes().get(ATTR_TYPE);
 
     boolean defaultCommand = ComponentUtil.getBooleanAttribute(component,
         ATTR_DEFAULT_COMMAND);
-    if (COMMAND_TYPE_RESET.equals(type)) {
-      buttonType = "reset";
-    } else { // default: Action.TYPE_SUBMIT
+    //if (COMMAND_TYPE_RESET.equals(type)) {
+    //  buttonType = "reset";
+    //} else { // default: Action.TYPE_SUBMIT
       buttonType = defaultCommand ? "submit" : "button";
-    }
+    //}
     return buttonType;
   }
 
   public static String createOnClick(FacesContext facesContext,
       UIComponent component) {
-    String type = (String) component.getAttributes().get(ATTR_TYPE);
-    String command = (String) component.getAttributes().get(ATTR_ACTION_STRING);
+    //String type = (String) component.getAttributes().get(ATTR_TYPE);
+    //String command = (String) component.getAttributes().get(ATTR_ACTION_STRING);
     String clientId = component.getClientId(facesContext);
     boolean defaultCommand = ComponentUtil.getBooleanAttribute(component,
         ATTR_DEFAULT_COMMAND);
     String onclick;
 
-    if (COMMAND_TYPE_NAVIGATE.equals(type)) {
+    if (component.getAttributes().containsKey(ATTR_ACTION_NAVIGATE)) {
       onclick = "Tobago.navigateToUrl('"
-          + HtmlUtils.generateUrl(facesContext, command) + "');";
-    } else if (COMMAND_TYPE_RESET.equals(type)) {
-      onclick = null;
-    } else if (COMMAND_TYPE_SCRIPT.equals(type)) {
-      onclick = command;
+          + HtmlUtils.generateUrl(facesContext, (String) component.getAttributes().get(ATTR_ACTION_NAVIGATE)) + "');";
+      // FIXME !!
+      //} else if (COMMAND_TYPE_RESET.equals(type)) {
+    //  onclick = null;
+    } else if (component.getAttributes().containsKey(ATTR_ACTION_SCRIPT)) {
+      onclick = (String) component.getAttributes().get(ATTR_ACTION_SCRIPT);
     } else if (defaultCommand) {
       ComponentUtil.findPage(component).setDefaultActionId(clientId);
 //      onclick = "Tobago.setAction('" + clientId + "');";

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java Wed Apr 19 06:39:34 2006
@@ -23,7 +23,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_SCRIPT;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALT;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CALENDAR_DATE_INPUT_ID;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_COLUMNS;
@@ -34,9 +34,7 @@
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_POPUP_RESET;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ROWS;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_CLASS;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TYPE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH;
-import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_SCRIPT;
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_LAYOUT;
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_PICKER;
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_PICKER_POPUP;
@@ -137,7 +135,6 @@
     link.setRendered(true);
     link.setImmediate(true);
     Map<String, Object>  attributes = link.getAttributes();
-    attributes.put(ATTR_TYPE, "script");
     link.setId(idPrefix + DatePickerController.OPEN_POPUP);
     link.setActionListener(datePickerController);
     attributes.put(ATTR_LAYOUT_WIDTH, getConfiguredValue(facesContext, component, "pickerWidth"));
@@ -148,7 +145,7 @@
     link.getChildren().add(hidden);
     hidden.setId(idPrefix + "Dimension");
     // attributes map is still of link
-    attributes.put(ATTR_ACTION_STRING, "Tobago.openPickerPopup(event, '"
+    attributes.put(ATTR_ACTION_SCRIPT, "Tobago.openPickerPopup(event, '"
         + link.getClientId(facesContext) + "', '"
         + hidden.getClientId(facesContext) + "')");
 
@@ -227,8 +224,7 @@
     okButton.setId("ok" + DatePickerController.CLOSE_POPUP);
     attributes = okButton.getAttributes();
     attributes.put(ATTR_LABEL, "OK");
-    attributes.put(ATTR_TYPE, COMMAND_TYPE_SCRIPT);
-    attributes.put(ATTR_ACTION_STRING, "writeIntoField('"
+    attributes.put(ATTR_ACTION_SCRIPT, "writeIntoField('"
         + popup.getClientId(facesContext) + "', '"
         + component.getClientId(facesContext) + "'); Tobago.closePickerPopup('"
         + popup.getClientId(facesContext) + "')");
@@ -239,8 +235,8 @@
     box.getChildren().add(cancelButton);
     attributes = cancelButton.getAttributes();
     attributes.put(ATTR_LABEL, "Cancel");
-    attributes.put(ATTR_TYPE, COMMAND_TYPE_SCRIPT);
-    attributes.put(ATTR_ACTION_STRING, "Tobago.closePickerPopup('" + popup.getClientId(facesContext) + "')");
+    //attributes.put(ATTR_TYPE, COMMAND_TYPE_SCRIPT);
+    attributes.put(ATTR_ACTION_SCRIPT, "Tobago.closePickerPopup('" + popup.getClientId(facesContext) + "')");
     cancelButton.setId(DatePickerController.CLOSE_POPUP);
     cancelButton.setActionListener(datePickerController);
 

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java Wed Apr 19 06:39:34 2006
@@ -23,7 +23,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_SCRIPT;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_NAVIGATE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_IMAGE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL;
@@ -56,11 +57,12 @@
     String onclick = null;
     String href;
 
-    String type = (String) component.getAttributes().get(ATTR_TYPE);
-    String action = (String) component.getAttributes().get(ATTR_ACTION_STRING);
+    //String type = (String) component.getAttributes().get(ATTR_TYPE);
+    //String action = (String) component.getAttributes().get(ATTR_ACTION_STRING);
 
     String clientId = component.getClientId(facesContext);
-    if (COMMAND_TYPE_NAVIGATE.equals(type)) {
+    if (component.getAttributes().containsKey(ATTR_ACTION_NAVIGATE)) {
+      String action = (String) component.getAttributes().get(ATTR_ACTION_NAVIGATE);
       if (action == null) {
         LOG.warn("keine Action in Link : id " + clientId
             + " label = " + component.getAttributes().get(ATTR_LABEL));
@@ -68,11 +70,11 @@
         action = "";
       }
       href = HtmlUtils.generateUrl(facesContext, action);
-    } else if (COMMAND_TYPE_RESET.equals(type)) {
-      href = "javascript:Tobago.resetForm()";
-    } else if (COMMAND_TYPE_SCRIPT.equals(type)) {
+    //} else if (COMMAND_TYPE_RESET.equals(type)) {
+    //  href = "javascript:Tobago.resetForm()";
+    } else  if (component.getAttributes().containsKey(ATTR_ACTION_SCRIPT)) {
+      onclick = (String) component.getAttributes().get(ATTR_ACTION_SCRIPT);
       href = "#";
-      onclick = action;
     } else { // default: Action.TYPE_SUBMIT
       href = "javascript:Tobago.submitAction('"
           + clientId + "')";

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuBarRenderer.java Wed Apr 19 06:39:34 2006
@@ -23,7 +23,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
+
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_IMAGE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_MENU_POPUP;
@@ -31,14 +31,12 @@
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_PAGE_MENU;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_CLASS;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TYPE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_VALUE;
-import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_NAVIGATE;
-import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_RESET;
-import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_SCRIPT;
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_CHECKBOX;
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_RADIO;
 import static org.apache.myfaces.tobago.TobagoConstants.SUBCOMPONENT_SEP;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_NAVIGATE;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_SCRIPT;
 import org.apache.myfaces.tobago.component.ComponentUtil;
 import org.apache.myfaces.tobago.component.UIPage;
 import org.apache.myfaces.tobago.component.UIMenuCommand;
@@ -334,20 +332,18 @@
 
   private String createOnClick(FacesContext facesContext,
                                UIComponent component) {
-    String type = (String) component.getAttributes().get(ATTR_TYPE);
-    String command = (String) component.getAttributes().get(ATTR_ACTION_STRING);
     String clientId = component.getClientId(facesContext);
     String onclick;
 
-    if (COMMAND_TYPE_NAVIGATE.equals(type)) {
+    if (component.getAttributes().containsKey(ATTR_ACTION_NAVIGATE)) {
       onclick = "Tobago.navigateToUrl('"
-          + HtmlUtils.generateUrl(facesContext, command) + "')";
-    } else if (COMMAND_TYPE_RESET.equals(type)) {
-      onclick = null;
-    } else if (COMMAND_TYPE_SCRIPT.equals(type)) {
-      onclick = command;
+          + HtmlUtils.generateUrl(facesContext, (String) component.getAttributes().get(ATTR_ACTION_NAVIGATE)) + "');";
+    //} else if (COMMAND_TYPE_RESET.equals(type)) {
+    //  onclick = null;
+    } else if (component.getAttributes().containsKey(ATTR_ACTION_SCRIPT)) {
+      onclick = (String) component.getAttributes().get(ATTR_ACTION_SCRIPT);
     } else { // default: Action.TYPE_SUBMIT
-      onclick = "Tobago.submitAction('" + clientId + "')";
+      onclick = "Tobago.submitAction('" + clientId + "');";
     }
     return onclick;
   }

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=395244&r1=395243&r2=395244&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 Wed Apr 19 06:39:34 2006
@@ -23,7 +23,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_SCRIPT;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ICON_SIZE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_IMAGE;
@@ -183,7 +183,7 @@
     command = (UICommand) ComponentUtil.createComponent(
         facesContext, UISelectBooleanCommand.COMPONENT_TYPE, RENDERER_TYPE_MENUCOMMAND);
     toolbar.getChildren().add(command);
-    command.getAttributes().put(ATTR_TYPE, COMMAND_TYPE_SCRIPT);
+
     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));
@@ -194,12 +194,11 @@
 
     String onClick = "Tobago.submitAction('"
         + clientId + RichTextEditorRenderer.CHANGE_BUTTON + "')";
-    command.getAttributes().put(ATTR_ACTION_STRING, onClick);
+    command.getAttributes().put(ATTR_ACTION_SCRIPT, onClick);
 
     command = (UICommand) ComponentUtil.createComponent(
         facesContext, UISelectBooleanCommand.COMPONENT_TYPE, RENDERER_TYPE_MENUCOMMAND);
     toolbar.getChildren().add(command);
-    command.getAttributes().put(ATTR_TYPE, COMMAND_TYPE_SCRIPT);
     //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));
@@ -208,14 +207,13 @@
     title = ResourceManagerUtil.getPropertyNotNull(
         facesContext, "tobago", "tobago.richtexteditor.preview.title");
     command.getAttributes().put(ATTR_TIP, title);
-    command.getAttributes().put(ATTR_ACTION_STRING, onClick);
+    command.getAttributes().put(ATTR_ACTION_SCRIPT, onClick);
 
     command = (UICommand) ComponentUtil.createComponent(
         facesContext, UICommand.COMPONENT_TYPE, RENDERER_TYPE_MENUCOMMAND);
     toolbar.getChildren().add(command);
-    command.getAttributes().put(ATTR_TYPE, COMMAND_TYPE_SCRIPT);
     command.getAttributes().put(ATTR_IMAGE, "image/config.gif");
-    command.getAttributes().put(ATTR_ACTION_STRING, "Tobago.doEditorCommand(this);");
+    command.getAttributes().put(ATTR_ACTION_SCRIPT, "Tobago.doEditorCommand(this);");
 
     return toolbar;
   }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java Wed Apr 19 06:39:34 2006
@@ -23,7 +23,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_SCRIPT;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALIGN;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DIRECT_LINK_COUNT;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
@@ -44,10 +44,8 @@
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_BODY;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_CLASS;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_HEADER;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TYPE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH_LIST;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_WIDTH_LIST_STRING;
-import static org.apache.myfaces.tobago.TobagoConstants.COMMAND_TYPE_SCRIPT;
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_MENUPOPUP;
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_PAGER_PAGE;
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_PAGER_ROW;
@@ -897,8 +895,7 @@
     UICommand menuItem
         = (UICommand) application.createComponent(UIMenuCommand.COMPONENT_TYPE);
     menuItem.setRendererType(RENDERER_TYPE_MENUCOMMAND);
-    menuItem.getAttributes().put(ATTR_TYPE, COMMAND_TYPE_SCRIPT);
-    menuItem.getAttributes().put(ATTR_ACTION_STRING, action);
+    menuItem.getAttributes().put(ATTR_ACTION_SCRIPT, action);
     menuItem.getAttributes().put(ATTR_LABEL, label);
     return menuItem;
   }

Modified: myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/ButtonRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/ButtonRenderer.java?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/ButtonRenderer.java (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/wml/standard/standard/tag/ButtonRenderer.java Wed Apr 19 06:39:34 2006
@@ -25,8 +25,8 @@
 import org.apache.commons.collections.keyvalue.DefaultKeyValue;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_STRING;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TYPE;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_SCRIPT;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_NAVIGATE;
 import static org.apache.myfaces.tobago.TobagoConstants.FACET_LABEL;
 import org.apache.myfaces.tobago.component.ComponentUtil;
 import org.apache.myfaces.tobago.component.UIPage;
@@ -51,13 +51,11 @@
 
     TobagoResponseWriter writer
         = (TobagoResponseWriter) facesContext.getResponseWriter();
+     // TODO
+    //String action = (String) command.getAttributes().get(ATTR_ACTION);
 
-    String type = (String) command.getAttributes().get(
-        ATTR_TYPE);
-    String action = (String) command.getAttributes().get(
-        ATTR_ACTION_STRING);
-
-    if ("submit".equals(type) && page != null) {
+    if (!command.getAttributes().containsKey(ATTR_ACTION_NAVIGATE)
+        &&!command.getAttributes().containsKey(ATTR_ACTION_SCRIPT)) {
       ValueHolder labelComponent
           = (ValueHolder) command.getFacet(FACET_LABEL);
       String label = (String) labelComponent.getValue();
@@ -69,7 +67,7 @@
       writer.writeText(label, null);
 
       writer.startElement("go", command);
-      writer.writeAttribute("href", action, null);
+      //writer.writeAttribute("href", action, null);
 
       for (KeyValue postField : page.getPostfields()) {
         writer.startElement("postfield", command);
@@ -80,8 +78,7 @@
       writer.endElement("go");
       writer.endElement("anchor");
     } else {
-      LOG.error("button type \""
-          + type + "\" is not supported!");
+      LOG.error("button type navigate or script is not supported!");
     }
   }
 }

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/pom.xml
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/pom.xml?rev=395244&r1=395243&r2=395244&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/pom.xml Wed Apr 19 06:39:34 2006
@@ -49,19 +49,18 @@
       <scope>compile</scope>
     </dependency>
     <dependency>
-      <!--<groupId>myfaces</groupId>-->
+      <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.1</version>-->
       <version>1.1.2</version>
       <scope>provided</scope>
     </dependency>
-    <!--<dependency>-->
-      <!--<groupId>myfaces</groupId>-->
-      <!--<artifactId>myfaces-api</artifactId>-->
-      <!--<version>1.1.1</version>-->
-      <!--<scope>provided</scope>-->
-    <!--</dependency>-->
+
     <dependency>
       <groupId>org.codehaus.modello</groupId>
       <artifactId>modello-core</artifactId>

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=395244&r1=395243&r2=395244&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 Wed Apr 19 06:39:34 2006
@@ -132,7 +132,11 @@
     Element tagElement = document.createElement("tag");
     addLeafTextElement(annotationTag.name(), "name", tagElement, document);
     addLeafTextElement(className, "tag-class", tagElement, document);
-
+    String tagExtraInfo = annotationTag.tagExtraInfoClassName();
+    if (tagExtraInfo != null&& tagExtraInfo.length() > 0) {
+      // TODO check tagExtraInfo extends TagExtraInfo         
+      addLeafTextElement(tagExtraInfo, "tei-class", tagElement, document);
+    }
     BodyContent bodyContent = annotationTag.bodyContent();
     BodyContentDescription contentDescription = decl.getAnnotation(BodyContentDescription.class);
     // TODO more error checking

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=395244&r1=395243&r2=395244&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 Wed Apr 19 06:39:34 2006
@@ -16,6 +16,7 @@
  * 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;
@@ -33,5 +34,7 @@
   String name();
 
   BodyContent bodyContent() default BodyContent.JSP;
+
+  String tagExtraInfoClassName() default "";
 
 }