You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/04/11 11:40:02 UTC
svn commit: r1324671 - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/util/
tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/
Author: lofwyr
Date: Wed Apr 11 09:40:02 2012
New Revision: 1324671
URL: http://svn.apache.org/viewvc?rev=1324671&view=rev
Log:
adding util method
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ColumnRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java?rev=1324671&r1=1324670&r2=1324671&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java Wed Apr 11 09:40:02 2012
@@ -912,6 +912,10 @@ public class ComponentUtils {
return null;
}
+ public static void addCurrentMarkup(SupportsMarkup component, Markup markup) {
+ component.setCurrentMarkup(markup.add(component.getCurrentMarkup()));
+ }
+
public static boolean hasChildrenWithMessages(FacesContext facesContext, NamingContainer container) {
if (container instanceof UIComponent) {
String clientId = ((UIComponent) container).getClientId(facesContext);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ColumnRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ColumnRenderer.java?rev=1324671&r1=1324670&r2=1324671&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ColumnRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ColumnRenderer.java Wed Apr 11 09:40:02 2012
@@ -22,6 +22,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UIOut;
import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.util.ComponentUtils;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -36,7 +37,7 @@ public class ColumnRenderer extends Layo
final UIColumn column = (UIColumn) component;
if (isPure(column)) {
- column.setCurrentMarkup(Markup.PURE.add(column.getCurrentMarkup()));
+ ComponentUtils.addCurrentMarkup(column, Markup.PURE);
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java?rev=1324671&r1=1324670&r2=1324671&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MenuRenderer.java Wed Apr 11 09:40:02 2012
@@ -50,7 +50,7 @@ public class MenuRenderer extends Layout
final UIMenu menu = (UIMenu) component;
final boolean firstLevel = !RendererTypes.MENU.equals(menu.getParent().getRendererType());
if (firstLevel) {
- menu.setCurrentMarkup(menu.getCurrentMarkup().add(Markup.TOP));
+ ComponentUtils.addCurrentMarkup(menu, Markup.TOP);
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java?rev=1324671&r1=1324670&r2=1324671&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java Wed Apr 11 09:40:02 2012
@@ -58,7 +58,7 @@ public class PopupRenderer extends Layou
super.prepareRender(facesContext, popup);
if (popup.isModal()) {
- popup.setCurrentMarkup(popup.getCurrentMarkup().add(Markup.MODAL));
+ ComponentUtils.addCurrentMarkup(popup, Markup.MODAL);
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java?rev=1324671&r1=1324670&r2=1324671&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java Wed Apr 11 09:40:02 2012
@@ -29,6 +29,7 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
+import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.NamingContainer;
@@ -46,7 +47,7 @@ public class SelectManyCheckboxRenderer
UISelectManyCheckbox select = (UISelectManyCheckbox) component;
super.prepareRender(facesContext, select);
if (select.isInline()) {
- select.setCurrentMarkup(Markup.INLINE.add(select.getCurrentMarkup()));
+ ComponentUtils.addCurrentMarkup(select, Markup.INLINE);
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java?rev=1324671&r1=1324670&r2=1324671&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java Wed Apr 11 09:40:02 2012
@@ -30,6 +30,7 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
+import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.NamingContainer;
@@ -49,7 +50,7 @@ public class SelectOneRadioRenderer exte
FacesContextUtils.addOnloadScript(facesContext, "Tobago.selectOneRadioInit('"
+ select.getClientId(facesContext) + "')");
if (select.isInline()) {
- select.setCurrentMarkup(Markup.INLINE.add(select.getCurrentMarkup()));
+ ComponentUtils.addCurrentMarkup(select, Markup.INLINE);
}
}
Modified: myfaces/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/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?rev=1324671&r1=1324670&r2=1324671&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java Wed Apr 11 09:40:02 2012
@@ -186,11 +186,11 @@ public class TabGroupRenderer extends La
if (tab.isRendered()) {
LabelWithAccessKey label = new LabelWithAccessKey(tab);
if (activeIndex == index) {
- tab.setCurrentMarkup(tab.getCurrentMarkup().add(Markup.SELECTED));
+ ComponentUtils.addCurrentMarkup(tab, Markup.SELECTED);
}
FacesMessage.Severity maxSeverity = ComponentUtils.getMaximumSeverityOfChildrenMessages(facesContext, tab);
if (maxSeverity != null) {
- tab.setCurrentMarkup(tab.getCurrentMarkup().add(ComponentUtils.markupOfSeverity(maxSeverity)));
+ ComponentUtils.addCurrentMarkup(tab, ComponentUtils.markupOfSeverity(maxSeverity));
}
writer.startElement(HtmlElements.DIV, tab);
writer.writeClassAttribute(Classes.create(tab));