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 2005/12/29 23:25:13 UTC
svn commit: r359914 - in /incubator/tobago/trunk: ./ src/site/fml/
tobago-core/ tobago-core/src/main/java/org/apache/myfaces/tobago/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/event/
tobago-core/src/main/java/org/apache/myfaces/tobag...
Author: bommel
Date: Thu Dec 29 14:24:34 2005
New Revision: 359914
URL: http://svn.apache.org/viewcvs?rev=359914&view=rev
Log:
added some TODO's
refactored events
added hello world to faq
Added:
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeListener.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeSource.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeEvent.java (contents, props changed)
- copied, changed from r359248, incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/StateChangeEvent.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeListener.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeSource.java
incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/SimpleTabChangeListener.java
Removed:
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/StateChangeEvent.java
Modified:
incubator/tobago/trunk/pom.xml
incubator/tobago/trunk/readme.txt
incubator/tobago/trunk/src/site/fml/faq.fml
incubator/tobago/trunk/tobago-core/pom.xml
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIForm.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeEvent.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FormRenderer.java
incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
incubator/tobago/trunk/tobago-tool/pom.xml
Modified: incubator/tobago/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/pom.xml?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/pom.xml (original)
+++ incubator/tobago/trunk/pom.xml Thu Dec 29 14:24:34 2005
@@ -167,6 +167,13 @@
</reportSet>
</reportSets>
</plugin>
+ <!--plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>org/apache/myfaces/tobago/checkstyle.xml</configLocation>
+ </configuration>
+ </plugin-->
<plugin>
<inherited>false</inherited>
@@ -264,6 +271,11 @@
<artifactId>wagon-ftp</artifactId>
<version>1.0-alpha-3</version>
</extension>
+ <!--extension>
+ <groupId>org.apache.myfaces.tobago</groupId>
+ <artifactId>build-tools</artifactId>
+ <version>${version}</version>
+ </extension-->
</extensions>
</build>
Modified: incubator/tobago/trunk/readme.txt
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/readme.txt?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/readme.txt (original)
+++ incubator/tobago/trunk/readme.txt Thu Dec 29 14:24:34 2005
@@ -32,7 +32,16 @@
It will create a log file in the app-server starting folder.
You may want to change that in the src/main/webapp/WEB-INF/classes/log4j.xml
-Known Bugs
-----------
-Until we have a public issue tracker see known-bugs.txt.
+
+Incubation Disclaimer
+---------------------
+
+Tobago is an effort undergoing incubation at the Apache Software Foundation (ASF),
+sponsored by the MyFaces PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other
+successful ASF projects. While incubation status is not necessarily a reflection
+of the completeness or stability of the code, it does indicate that the project
+has yet to be fully endorsed by the ASF.
+
Modified: incubator/tobago/trunk/src/site/fml/faq.fml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/src/site/fml/faq.fml?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/src/site/fml/faq.fml (original)
+++ incubator/tobago/trunk/src/site/fml/faq.fml Thu Dec 29 14:24:34 2005
@@ -10,6 +10,13 @@
<a href="http://tobago.atanion.net/tobago-example-demo/">Demo</a>
</answer>
</faq>
+ <faq id="hello-world">
+ <question>Where i can find a Hello World example and a list of needed jars?</question>
+ <answer><p>
+ Please look at <a href="http://svn.apache.org/repos/asf/incubator/tobago/trunk/tobago-example/tobago-example-blank/">tobago-example-blank</a>.
+ </p>
+ </answer>
+ </faq>
<faq id="tobago/RI">
<question>Does tobago run with the Sun RI?</question>
<answer><p>Tobago should run with Sun RI and with MyFaces.</p></answer>
Modified: incubator/tobago/trunk/tobago-core/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/pom.xml?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/pom.xml (original)
+++ incubator/tobago/trunk/tobago-core/pom.xml Thu Dec 29 14:24:34 2005
@@ -100,6 +100,7 @@
<tldDocDir>${basedir}/target/site/tlddoc</tldDocDir>
</configuration>
</plugin>
+
<!-- wait until checkstyle 4.0 is released
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Pager.java Thu Dec 29 14:24:34 2005
@@ -133,11 +133,12 @@
LOG.error("Unkown action: " + action);
}
- MethodBinding stateChangeListener = data.getStateChangeListener();
+ /*MethodBinding stateChangeListener = data.getStateChangeListener();
if (stateChangeListener != null) {
stateChangeListener.invoke(facesContext,
new Object[] {new SheetStateChangeEvent(data)});
- }
+ } */
+ data.queueEvent(new SheetStateChangeEvent(data));
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("aobj[0] instanceof '" + aobj[0] + "'");
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIData.java Thu Dec 29 14:24:34 2005
@@ -28,27 +28,30 @@
import org.apache.myfaces.tobago.util.LayoutInfo;
import org.apache.myfaces.tobago.util.LayoutUtil;
import org.apache.myfaces.tobago.util.StringUtil;
+import org.apache.myfaces.tobago.event.SheetStateChangeSource;
+import org.apache.myfaces.tobago.event.SheetStateChangeListener;
+import org.apache.myfaces.tobago.event.SheetStateChangeEvent;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
+import javax.faces.el.EvaluationException;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.AbortProcessingException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-public class UIData extends javax.faces.component.UIData {
-// ------------------------------------------------------------------ constants
+public class UIData extends javax.faces.component.UIData implements SheetStateChangeSource {
private static final Log LOG = LogFactory.getLog(UIData.class);
public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Data";
-// ----------------------------------------------------------------- attributes
-
private MethodBinding stateChangeListener;
private List<Integer> widthList;
@@ -61,7 +64,6 @@
private boolean showHeader = true;
private boolean showHeaderSet = false;
-// ----------------------------------------------------------- business methods
public void encodeBegin(FacesContext facesContext) throws IOException {
UILayout.prepareDimension(facesContext, this);
@@ -384,6 +386,50 @@
public void setSorter(Sorter sorter) {
this.sorter = sorter;
+ }
+
+ public void queueEvent(FacesEvent facesEvent) {
+ if (facesEvent instanceof SheetStateChangeEvent) {
+ UIComponent parent = getParent();
+ if (parent == null) {
+ throw new IllegalStateException("component is not a descendant of a UIViewRoot");
+ }
+ parent.queueEvent(facesEvent);
+ } else {
+ super.queueEvent(facesEvent);
+ }
+
+ }
+
+ public void broadcast(FacesEvent facesEvent) throws AbortProcessingException {
+ super.broadcast(facesEvent);
+ if ( facesEvent instanceof SheetStateChangeEvent) {
+ MethodBinding sheetChangeListenerBinding = getStateChangeListener();
+ if (sheetChangeListenerBinding != null) {
+ try {
+ sheetChangeListenerBinding.invoke(getFacesContext(), new Object[]{(SheetStateChangeEvent)facesEvent});
+ } catch (EvaluationException e) {
+ Throwable cause = e.getCause();
+ if (cause != null && cause instanceof AbortProcessingException) {
+ throw (AbortProcessingException)cause;
+ } else {
+ throw e;
+ }
+ }
+ }
+ }
+ }
+
+ public void addStateChangeListener(SheetStateChangeListener listener) {
+ addFacesListener(listener);
+ }
+
+ public SheetStateChangeListener[] getStateChangeListeners() {
+ return (SheetStateChangeListener[])getFacesListeners(SheetStateChangeListener.class);
+ }
+
+ public void removeStateChangeListener(SheetStateChangeListener listener) {
+ removeFacesListener(listener);
}
public MethodBinding getStateChangeListener() {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIForm.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIForm.java?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIForm.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIForm.java Thu Dec 29 14:24:34 2005
@@ -28,18 +28,11 @@
public class UIForm extends javax.faces.component.UIForm {
-// ///////////////////////////////////////////// constant
-
private static final Log LOG = LogFactory.getLog(UIForm.class);
public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Form";
-// ///////////////////////////////////////////// attribute
-
-// ///////////////////////////////////////////// constructor
-
-// ///////////////////////////////////////////// code
-
+ // TODO can this removed?
public void processDecodes(FacesContext facesContext) {
// Process this component itself
@@ -98,7 +91,4 @@
}
}
}
-
-// ///////////////////////////////////////////// bean getter + setter
-
}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIInput.java Thu Dec 29 14:24:34 2005
@@ -35,6 +35,7 @@
private static final Log LOG = LogFactory.getLog(UIInput.class);
public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Input";
+ // TODO can this removed?
public void updateModel(FacesContext facesContext) {
if (ComponentUtil.mayUpdateModel(this)) {
super.updateModel(facesContext);
@@ -46,24 +47,6 @@
UILayout.getLayout(this).layoutBegin(facesContext, this);
super.encodeBegin(facesContext);
}
-
- /*public void encodeChildren(FacesContext facesContext) throws IOException {
- UILayout layout = UILayout.getLayout(this);
- if (layout instanceof UILabeledInputLayout) {
- if (isRendered() ) {
- layout.encodeChildrenOfComponent(facesContext, this);
- }
- } else {
- super.encodeChildren(facesContext);
- }
- } */
-
- /*public void encodeEnd(FacesContext facesContext) throws IOException {
-
- //if (! (UILayout.getLayout(this) instanceof UILabeledInputLayout)) {
- super.encodeEnd(facesContext);
- //}
- } */
public void encodeAjax(FacesContext facesContext) throws IOException {
AjaxUtils.encodeAjaxComponent(facesContext, this);
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UITabGroup.java Thu Dec 29 14:24:34 2005
@@ -24,6 +24,7 @@
import org.apache.commons.logging.LogFactory;
import static org.apache.myfaces.tobago.TobagoConstants.*;
import org.apache.myfaces.tobago.event.TabChangeListener;
+import org.apache.myfaces.tobago.event.TabChangeSource;
import org.apache.myfaces.tobago.ajax.api.AjaxComponent;
import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
import org.apache.myfaces.tobago.ajax.api.AjaxPhaseListener;
@@ -31,12 +32,16 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.EvaluationException;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.AbortProcessingException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;
-public class UITabGroup extends UIPanel implements AjaxComponent {
+public class UITabGroup extends UIPanel implements TabChangeSource, AjaxComponent {
private static final Log LOG = LogFactory.getLog(UITabGroup.class);
@@ -48,6 +53,8 @@
private int activeIndex;
private int renderedIndex;
+ private MethodBinding tabChangeListener = null;
+
@Override
public boolean getRendersChildren() {
return true;
@@ -166,6 +173,32 @@
}
}
+ public void broadcast(FacesEvent facesEvent) throws AbortProcessingException {
+ super.broadcast(facesEvent);
+
+ MethodBinding tabChangeListenerBinding = getTabChangeListener();
+ if (tabChangeListenerBinding != null) {
+ try {
+ tabChangeListenerBinding.invoke(getFacesContext(), new Object[]{facesEvent});
+ } catch (EvaluationException e) {
+ Throwable cause = e.getCause();
+ if (cause != null && cause instanceof AbortProcessingException) {
+ throw (AbortProcessingException)cause;
+ } else {
+ throw e;
+ }
+ }
+ }
+ }
+
+ public void setTabChangeListener(MethodBinding tabStateChangeListener) {
+ this.tabChangeListener = tabStateChangeListener;
+ }
+
+ public MethodBinding getTabChangeListener() {
+ return tabChangeListener;
+ }
+
public void updateState(FacesContext facesContext) {
ValueBinding stateBinding = getValueBinding(ATTR_STATE);
if (stateBinding != null) {
@@ -185,11 +218,16 @@
removeFacesListener(listener);
}
+ public TabChangeListener[] getTabChangeListeners() {
+ return (TabChangeListener[]) getFacesListeners(TabChangeListener.class);
+ }
+
public Object saveState(FacesContext context) {
- Object[] state = new Object[3];
+ Object[] state = new Object[4];
state[0] = super.saveState(context);
state[1] = new Integer(renderedIndex);
state[2] = new Integer(activeIndex);
+ state[3] = tabChangeListener;
return state;
}
@@ -198,6 +236,7 @@
super.restoreState(context, values[0]);
renderedIndex = ((Integer)values[1]).intValue();
activeIndex = ((Integer)values[2]).intValue();
+ tabChangeListener = (MethodBinding) values[3];
}
public void encodeAjax(FacesContext facesContext) throws IOException {
@@ -221,7 +260,7 @@
final String ajaxId = (String) facesContext.getExternalContext().
getRequestParameterMap().get(AjaxPhaseListener.AJAX_COMPONENT_ID);
if (ajaxId.equals(getClientId(facesContext))) {
- // TODO what about invoking StateChangeListener ?
+ // TODO what about invoking TabChangeListener ?
encodeAjax(facesContext);
} else {final Iterator facetsAndChildren = getFacetsAndChildren();
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeEvent.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeEvent.java?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeEvent.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeEvent.java Thu Dec 29 14:24:34 2005
@@ -31,11 +31,11 @@
}
public boolean isAppropriateListener(FacesListener facesListener) {
- return true; //TODO
+ return facesListener instanceof SheetStateChangeListener;
}
public void processListener(FacesListener facesListener) {
- //TODO
+ ((SheetStateChangeListener)facesListener).processSheetStateChange(this);
}
}
Added: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeListener.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeListener.java?rev=359914&view=auto
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeListener.java (added)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeListener.java Thu Dec 29 14:24:34 2005
@@ -0,0 +1,14 @@
+package org.apache.myfaces.tobago.event;
+
+import javax.faces.event.FacesListener;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 18.12.2005
+ * Time: 14:13:38
+ * To change this template use File | Settings | File Templates.
+ */
+public interface SheetStateChangeListener extends FacesListener {
+ public void processSheetStateChange(SheetStateChangeEvent sheetStateChangeEvent);
+}
Added: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeSource.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeSource.java?rev=359914&view=auto
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeSource.java (added)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/SheetStateChangeSource.java Thu Dec 29 14:24:34 2005
@@ -0,0 +1,21 @@
+package org.apache.myfaces.tobago.event;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 18.12.2005
+ * Time: 13:56:59
+ * To change this template use File | Settings | File Templates.
+ */
+public interface SheetStateChangeSource {
+
+ public javax.faces.el.MethodBinding getStateChangeListener();
+
+ public void setStateChangeListener(javax.faces.el.MethodBinding actionListener);
+
+ public void addStateChangeListener(SheetStateChangeListener listener);
+
+ public SheetStateChangeListener[] getStateChangeListeners();
+
+ public void removeStateChangeListener(SheetStateChangeListener listener);
+}
Copied: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeEvent.java (from r359248, incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/StateChangeEvent.java)
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeEvent.java?p2=incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeEvent.java&p1=incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/StateChangeEvent.java&r1=359248&r2=359914&rev=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/StateChangeEvent.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeEvent.java Thu Dec 29 14:24:34 2005
@@ -24,12 +24,12 @@
* Date: 13.12.2004
* Time: 16:25:03
*/
-public class StateChangeEvent extends FacesEvent {
+public class TabChangeEvent extends FacesEvent {
private Object oldState;
private Object newState;
- public StateChangeEvent(UIComponent uiComponent, Object oldState, Object newState) {
+ public TabChangeEvent(UIComponent uiComponent, Object oldState, Object newState) {
super(uiComponent);
this.oldState = oldState;
this.newState = newState;
@@ -40,7 +40,7 @@
}
public void processListener(FacesListener facesListener) {
- ((TabChangeListener)facesListener).processStateChange(this);
+ ((TabChangeListener)facesListener).processTabChange(this);
}
public Object getOldState() {
Propchange: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeEvent.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeListener.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeListener.java?rev=359914&view=auto
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeListener.java (added)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeListener.java Thu Dec 29 14:24:34 2005
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.tobago.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * User: weber
+ * Date: 13.12.2004
+ * Time: 16:21:54
+ */
+public interface TabChangeListener extends FacesListener {
+
+ public void processTabChange(TabChangeEvent tabChangeEvent);
+
+}
Added: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeSource.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeSource.java?rev=359914&view=auto
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeSource.java (added)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/TabChangeSource.java Thu Dec 29 14:24:34 2005
@@ -0,0 +1,21 @@
+package org.apache.myfaces.tobago.event;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 22.12.2005
+ * Time: 23:01:03
+ * To change this template use File | Settings | File Templates.
+ */
+public interface TabChangeSource {
+
+ public javax.faces.el.MethodBinding getTabChangeListener();
+
+ public void setTabChangeListener(javax.faces.el.MethodBinding actionListener);
+
+ public void addTabChangeListener(TabChangeListener listener);
+
+ public TabChangeListener[] getTabChangeListeners();
+
+ public void removeTabChangeListener(TabChangeListener listener);
+}
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/InputRendererBase.java Thu Dec 29 14:24:34 2005
@@ -30,16 +30,8 @@
public class InputRendererBase extends RendererBase {
-// ///////////////////////////////////////////// constant
-
private static final Log LOG = LogFactory.getLog(InputRendererBase.class);
-// ///////////////////////////////////////////// attribute
-
-// ///////////////////////////////////////////// constructor
-
-// ///////////////////////////////////////////// code
-
public void decode(FacesContext context, UIComponent component) {
UIInput uiInput;
if (component instanceof UIInput) {
@@ -73,8 +65,6 @@
public int getLabelWidth(FacesContext facesContext, UIComponent component) {
return getConfiguredValue(facesContext, component, "labelWidth");
}
-
-// ///////////////////////////////////////////// bean getter + setter
}
Added: incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/SimpleTabChangeListener.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/SimpleTabChangeListener.java?rev=359914&view=auto
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/SimpleTabChangeListener.java (added)
+++ incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/actionlistener/SimpleTabChangeListener.java Thu Dec 29 14:24:34 2005
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.tobago.example.demo.actionlistener;
+
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
+
+import org.apache.myfaces.tobago.event.TabChangeListener;
+import org.apache.myfaces.tobago.event.TabChangeEvent;
+
+/**
+ * User: weber
+ * Date: 13.12.2004
+ * Time: 16:55:44
+ */
+public class SimpleTabChangeListener implements TabChangeListener {
+
+ private static final Log LOG = LogFactory.getLog(SimpleTabChangeListener.class);
+
+ public void processTabChange(TabChangeEvent tabChangeEvent) {
+ LOG.info("TabState has Changed: from " + tabChangeEvent.getOldState()
+ + " to " + tabChangeEvent.getNewState());
+
+ }
+}
Modified: incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FormRenderer.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FormRenderer.java?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FormRenderer.java (original)
+++ incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FormRenderer.java Thu Dec 29 14:24:34 2005
@@ -30,14 +30,6 @@
public class FormRenderer extends RendererBase {
-// ///////////////////////////////////////////// constant
-
-// ///////////////////////////////////////////// attribute
-
-// ///////////////////////////////////////////// constructor
-
-// ///////////////////////////////////////////// code
-
public void decode(FacesContext facesContext, UIComponent component) {
UIForm form = (UIForm) component;
UIPage page = ComponentUtil.findPage(form);
@@ -61,8 +53,6 @@
//}
}
-
-// ///////////////////////////////////////////// bean getter + setter
}
Modified: incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java (original)
+++ incubator/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java Thu Dec 29 14:24:34 2005
@@ -27,7 +27,7 @@
import org.apache.myfaces.tobago.component.UITabGroup;
import org.apache.myfaces.tobago.component.UIPage;
import org.apache.myfaces.tobago.context.ResourceManagerUtil;
-import org.apache.myfaces.tobago.event.StateChangeEvent;
+import org.apache.myfaces.tobago.event.TabChangeEvent;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.RenderUtil;
import org.apache.myfaces.tobago.renderkit.RendererBase;
@@ -37,7 +37,6 @@
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import org.apache.myfaces.tobago.ajax.api.AjaxRenderer;
import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
-import org.apache.myfaces.tobago.TobagoConstants;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
@@ -79,7 +78,7 @@
int activeIndex = Integer.parseInt(newValue);
if (activeIndex != oldIndex) {
((UITabGroup) component).setActiveIndex(activeIndex);
- StateChangeEvent event = new StateChangeEvent(component,
+ TabChangeEvent event = new TabChangeEvent(component,
new Integer(oldIndex), new Integer(activeIndex));
event.setPhaseId(PhaseId.UPDATE_MODEL_VALUES);
component.queueEvent(event);
Modified: incubator/tobago/trunk/tobago-tool/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-tool/pom.xml?rev=359914&r1=359913&r2=359914&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-tool/pom.xml (original)
+++ incubator/tobago/trunk/tobago-tool/pom.xml Thu Dec 29 14:24:34 2005
@@ -1,3 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * 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.
+-->
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>