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 2013/11/15 18:11:10 UTC
svn commit: r1542331 [25/28] - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/
tobago-core/src/main/java/org/apache/myfaces/tobago/application/
tobago-core/src/main/java/org/apache/myfaces/tobago/compat/ tobago-core/...
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeCommandRenderer.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/TreeCommandRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeCommandRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeCommandRenderer.java Fri Nov 15 17:10:58 2013
@@ -49,7 +49,7 @@ public class TreeCommandRenderer extends
private static final Logger LOG = LoggerFactory.getLogger(TreeCommandRenderer.class);
@Override
- public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
+ public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeCommand command = (UITreeCommand) component;
final UITreeNode node = ComponentUtils.findAncestor(command, UITreeNode.class);
// Todo: use an expression?
@@ -58,7 +58,7 @@ public class TreeCommandRenderer extends
}
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeCommand command = (UITreeCommand) component;
final String clientId = command.getClientId(facesContext);
@@ -98,12 +98,12 @@ public class TreeCommandRenderer extends
}
}
- protected Style createStyle(FacesContext facesContext, AbstractUICommand link) {
+ protected Style createStyle(final FacesContext facesContext, final AbstractUICommand link) {
return new Style(facesContext, link);
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeCommand command = (UITreeCommand) component;
final ResponseWriter writer = facesContext.getResponseWriter();
if (command.isDisabled()) {
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeDataRenderer.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/TreeDataRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeDataRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeDataRenderer.java Fri Nov 15 17:10:58 2013
@@ -20,7 +20,7 @@
package org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
-import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
+import org.apache.myfaces.tobago.renderkit.util.EncodeUtils;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -29,16 +29,16 @@ import java.io.IOException;
public class TreeDataRenderer extends LayoutComponentRendererBase {
@Override
- public void decode(FacesContext facesContext, UIComponent component) {
+ public void decode(final FacesContext facesContext, final UIComponent component) {
}
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
- RenderUtils.prepareRendererAll(facesContext, component);
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
+ EncodeUtils.prepareRendererAll(facesContext, component);
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
}
/*
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeIconRenderer.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/TreeIconRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeIconRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeIconRenderer.java Fri Nov 15 17:10:58 2013
@@ -48,7 +48,7 @@ public class TreeIconRenderer extends La
= ResourceUtils.createString("image", "treeNode", "icon", "leaf", ResourceUtils.GIF);
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeIcon image = (UITreeIcon) component;
final AbstractUIData data = ComponentUtils.findAncestor(image, AbstractUIData.class);
@@ -90,7 +90,7 @@ public class TreeIconRenderer extends La
source = openSource;
}
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.startElement(HtmlElements.IMG, null);
writer.writeClassAttribute(Classes.create(node, "toggle", Markup.NULL));
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeIndentRenderer.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/TreeIndentRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeIndentRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeIndentRenderer.java Fri Nov 15 17:10:58 2013
@@ -42,7 +42,7 @@ import java.util.List;
public class TreeIndentRenderer extends LayoutComponentRendererBase {
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeIndent indent = (UITreeIndent) component;
final AbstractUITreeNode node = ComponentUtils.findAncestor(indent, AbstractUITreeNode.class);
@@ -73,7 +73,7 @@ public class TreeIndentRenderer extends
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.endElement(HtmlElements.SPAN);
}
@@ -89,7 +89,7 @@ public class TreeIndentRenderer extends
final String perpendicular = ResourceManagerUtils.getImageWithPath(facesContext, "image/I.gif");
for (int i = dropFirst ? 1 : 0; i < junctions.size() - 1; i++) {
- Boolean junction = junctions.get(i);
+ final Boolean junction = junctions.get(i);
writer.startElement(HtmlElements.IMG, null);
writer.writeClassAttribute(Classes.create(node, "junction"));
writer.writeAttribute(HtmlAttributes.ALT, "", false);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeLabelRenderer.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/TreeLabelRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeLabelRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeLabelRenderer.java Fri Nov 15 17:10:58 2013
@@ -42,7 +42,7 @@ public class TreeLabelRenderer extends L
private static final Logger LOG = LoggerFactory.getLogger(TreeLabelRenderer.class);
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
final AbstractUIData data = ComponentUtils.findAncestor(component, AbstractUIData.class);
final boolean listbox = data instanceof AbstractUITreeListbox;
@@ -58,7 +58,7 @@ public class TreeLabelRenderer extends L
writer.writeClassAttribute(Classes.create(label));
HtmlRendererUtils.writeDataAttributes(facesContext, writer, label);
writer.writeStyleAttribute(createStyle(facesContext, label));
- String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, label);
+ final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, label);
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
@@ -69,7 +69,7 @@ public class TreeLabelRenderer extends L
}
}
- protected Style createStyle(FacesContext facesContext, UITreeLabel link) {
+ protected Style createStyle(final FacesContext facesContext, final UITreeLabel link) {
return new Style(facesContext, link);
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxNodeRenderer.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/TreeListboxNodeRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxNodeRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxNodeRenderer.java Fri Nov 15 17:10:58 2013
@@ -48,9 +48,9 @@ public class TreeListboxNodeRenderer ext
// TODO cleanup: there might be some stuff to remove after tree refactoring
@Override
- public void decode(FacesContext facesContext, UIComponent component) {
+ public void decode(final FacesContext facesContext, final UIComponent component) {
- UITreeNode node = (UITreeNode) component;
+ final UITreeNode node = (UITreeNode) component;
super.decode(facesContext, node);
@@ -67,7 +67,7 @@ public class TreeListboxNodeRenderer ext
// expand state
if (folder) {
- boolean expanded = Boolean.parseBoolean(requestParameterMap.get(id + "-expanded"));
+ final boolean expanded = Boolean.parseBoolean(requestParameterMap.get(id + "-expanded"));
if (node.isExpanded() != expanded) {
new TreeExpansionEvent(node, node.isExpanded(), expanded).queue();
}
@@ -75,19 +75,19 @@ public class TreeListboxNodeRenderer ext
// select
if (tree.getSelectableAsEnum() != Selectable.NONE) { // selection
- String selected = requestParameterMap.get(treeId + AbstractUITree.SELECT_STATE);
- String searchString = ";" + node.getClientId(facesContext) + ";";
- UITreeSelect treeSelect = ComponentUtils.findDescendant(node, UITreeSelect.class);
+ final String selected = requestParameterMap.get(treeId + AbstractUITree.SELECT_STATE);
+ final String searchString = ";" + node.getClientId(facesContext) + ";";
+ final UITreeSelect treeSelect = ComponentUtils.findDescendant(node, UITreeSelect.class);
if (treeSelect != null) {
treeSelect.setSubmittedValue(selected.contains(searchString));
}
}
// marked
- String marked = requestParameterMap.get(treeId + ComponentUtils.SUB_SEPARATOR + AbstractUITree.SUFFIX_MARKED);
+ final String marked = requestParameterMap.get(treeId + ComponentUtils.SUB_SEPARATOR + AbstractUITree.SUFFIX_MARKED);
if (marked != null) {
- String searchString = treeId + UINamingContainer.getSeparatorChar(facesContext) + nodeStateId;
- boolean markedValue = marked.equals(searchString);
+ final String searchString = treeId + UINamingContainer.getSeparatorChar(facesContext) + nodeStateId;
+ final boolean markedValue = marked.equals(searchString);
if (node.isMarked() != markedValue) {
new TreeMarkedEvent(node, node.isMarked(), markedValue).queue();
}
@@ -97,7 +97,7 @@ public class TreeListboxNodeRenderer ext
}
@Override
- public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
+ public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
super.prepareRender(facesContext, component);
final UITreeNode node = (UITreeNode) component;
@@ -107,7 +107,7 @@ public class TreeListboxNodeRenderer ext
}
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeNode node = (UITreeNode) component;
final boolean folder = node.isFolder();
final String id = node.getClientId(facesContext);
@@ -124,7 +124,7 @@ public class TreeListboxNodeRenderer ext
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeNode node = (UITreeNode) component;
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
final boolean folder = node.isFolder();
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxRenderer.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/TreeListboxRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeListboxRenderer.java Fri Nov 15 17:10:58 2013
@@ -33,6 +33,7 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
+import org.apache.myfaces.tobago.renderkit.util.EncodeUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -45,13 +46,13 @@ import java.util.List;
public class TreeListboxRenderer extends LayoutComponentRendererBase {
- public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
+ public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
super.prepareRender(facesContext, component);
setRendererTypeForCommandsAndNodes(component);
}
- protected void setRendererTypeForCommandsAndNodes(UIComponent component) {
- for (UIComponent child : component.getChildren()) {
+ protected void setRendererTypeForCommandsAndNodes(final UIComponent component) {
+ for (final UIComponent child : component.getChildren()) {
if (child instanceof UITreeNode) {
child.setRendererType(RendererTypes.TREE_LISTBOX_NODE);
}
@@ -60,12 +61,12 @@ public class TreeListboxRenderer extends
}
@Override
- public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
+ public void encodeChildren(final FacesContext context, final UIComponent component) throws IOException {
// will be rendered in encodeEnd()
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
final AbstractUITree tree = (AbstractUITree) component;
final String clientId = tree.getClientId(facesContext);
@@ -112,17 +113,17 @@ public class TreeListboxRenderer extends
List<Integer> thisLevel = new ArrayList<Integer>();
thisLevel.add(0);
List<Integer> nextLevel = new ArrayList<Integer>();
- int depth = tree.getTreeDataModel().getDepth() != -1
+ final int depth = tree.getTreeDataModel().getDepth() != -1
? tree.getTreeDataModel().getDepth()
: 7; // XXX not a fix value!!!
// todo: use (TreeListbox ?)Layout
- Measure currentWidth = tree.getCurrentWidth();
- Measure width = currentWidth.divide(depth);
+ final Measure currentWidth = tree.getCurrentWidth();
+ final Measure width = currentWidth.divide(depth);
for (int level = 0; level < depth; level++) {
writer.startElement(HtmlElements.DIV, null);
writer.writeClassAttribute(Classes.create(tree, "level"));
- Style levelStyle = new Style();
+ final Style levelStyle = new Style();
levelStyle.setLeft(width.multiply(level));
levelStyle.setWidth(width);
writer.writeStyleAttribute(levelStyle);
@@ -136,12 +137,12 @@ public class TreeListboxRenderer extends
writer.endElement(HtmlElements.SELECT);
}
- for(Integer rowIndex : thisLevel) {
+ for(final Integer rowIndex : thisLevel) {
encodeSelectBox(facesContext, tree, writer, rowIndex, nextLevel);
}
thisLevel.clear();
- List<Integer> swap = thisLevel;
+ final List<Integer> swap = thisLevel;
thisLevel = nextLevel;
nextLevel = swap;
@@ -155,8 +156,8 @@ public class TreeListboxRenderer extends
}
private void encodeSelectBox(
- FacesContext facesContext, AbstractUITree tree, TobagoResponseWriter writer,
- int parentRowIndex, List<Integer> foldersRowIndices)
+ final FacesContext facesContext, final AbstractUITree tree, final TobagoResponseWriter writer,
+ final int parentRowIndex, final List<Integer> foldersRowIndices)
throws IOException {
tree.setRowIndex(parentRowIndex);
@@ -183,14 +184,14 @@ public class TreeListboxRenderer extends
final List<Integer> rowIndices = tree.getRowIndicesOfChildren();
- for (Integer rowIndex : rowIndices) {
+ for (final Integer rowIndex : rowIndices) {
tree.setRowIndex(rowIndex);
if (!tree.isRowAvailable()) {
break;
}
- for (UIComponent child : tree.getChildren()) {
- RenderUtils.prepareRendererAll(facesContext, child);
+ for (final UIComponent child : tree.getChildren()) {
+ EncodeUtils.prepareRendererAll(facesContext, child);
RenderUtils.encode(facesContext, child);
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuCommandRenderer.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/TreeMenuCommandRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuCommandRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuCommandRenderer.java Fri Nov 15 17:10:58 2013
@@ -32,13 +32,13 @@ public class TreeMenuCommandRenderer ext
private static final Logger LOG = LoggerFactory.getLogger(TreeMenuCommandRenderer.class);
- protected Style createStyle(FacesContext facesContext, AbstractUICommand node) {
+ protected Style createStyle(final FacesContext facesContext, final AbstractUICommand node) {
final AbstractUITreeNode parent = (AbstractUITreeNode) node.getParent();
final int level = parent.getLevel();
// final boolean folder = parent.isFolder();
- Style style = new Style();
+ final Style style = new Style();
Measure paddingLeft = getResourceManager().getThemeMeasure(facesContext, node, "custom.padding-left");
paddingLeft = paddingLeft.multiply(level);
style.setPaddingLeft(paddingLeft);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuLabelRenderer.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/TreeMenuLabelRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuLabelRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuLabelRenderer.java Fri Nov 15 17:10:58 2013
@@ -32,13 +32,13 @@ public class TreeMenuLabelRenderer exten
private static final Logger LOG = LoggerFactory.getLogger(TreeMenuLabelRenderer.class);
- protected Style createStyle(FacesContext facesContext, UITreeLabel node) {
+ protected Style createStyle(final FacesContext facesContext, final UITreeLabel node) {
final AbstractUITreeNode parent = (AbstractUITreeNode) node.getParent();
final int level = parent.getLevel();
// final boolean folder = parent.isFolder();
- Style style = new Style();
+ final Style style = new Style();
Measure paddingLeft = getResourceManager().getThemeMeasure(facesContext, node, "custom.padding-left");
paddingLeft = paddingLeft.multiply(level);
style.setPaddingLeft(paddingLeft);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuNodeRenderer.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/TreeMenuNodeRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuNodeRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuNodeRenderer.java Fri Nov 15 17:10:58 2013
@@ -42,7 +42,7 @@ import java.io.IOException;
public class TreeMenuNodeRenderer extends TreeNodeRendererBase {
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeNode node = (UITreeNode) component;
final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);
@@ -67,7 +67,7 @@ public class TreeMenuNodeRenderer extend
// In the case of a sheet, we need not hiding the node, because the whole TR will be hidden.
if (!dataRendersRowContainer && !visible) {
- Style style = new Style();
+ final Style style = new Style();
style.setDisplay(Display.NONE);
writer.writeStyleAttribute(style);
}
@@ -79,7 +79,7 @@ public class TreeMenuNodeRenderer extend
writer.writeClassAttribute(Classes.create(node, "icon"));
writer.writeAttribute(HtmlAttributes.SRC, src, false);
writer.writeAttribute(HtmlAttributes.ALT, "", false);
- Style style = new Style();
+ final Style style = new Style();
style.setWidth(Measure.ZERO);
writer.writeStyleAttribute(style);
writer.endElement(HtmlElements.IMG);
@@ -87,7 +87,7 @@ public class TreeMenuNodeRenderer extend
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeNode node = (UITreeNode) component;
final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);
final int level = node.getLevel();
@@ -102,7 +102,8 @@ public class TreeMenuNodeRenderer extend
writer.endElement(HtmlElements.DIV);
}
- private void encodeIcon(FacesContext facesContext, TobagoResponseWriter writer, boolean expanded, UITreeNode node)
+ private void encodeIcon(
+ final FacesContext facesContext, final TobagoResponseWriter writer, final boolean expanded, final UITreeNode node)
throws IOException {
final String srcOpen = ResourceManagerUtils.getImageWithPath(facesContext, "image/treeMenuOpen.gif");
final String srcClose = ResourceManagerUtils.getImageWithPath(facesContext, "image/treeMenuClose.gif");
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuRenderer.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/TreeMenuRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeMenuRenderer.java Fri Nov 15 17:10:58 2013
@@ -31,14 +31,14 @@ import java.io.IOException;
public class TreeMenuRenderer extends TreeRenderer {
@Override
- public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
+ public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
super.prepareRender(facesContext, component);
setRendererTypeForCommandsAndNodes(component);
}
- protected void setRendererTypeForCommandsAndNodes(UIComponent component) {
- for (UIComponent child : component.getChildren()) {
+ protected void setRendererTypeForCommandsAndNodes(final UIComponent component) {
+ for (final UIComponent child : component.getChildren()) {
if (child instanceof UITreeNode) {
child.setRendererType(RendererTypes.TREE_MENU_NODE);
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.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/TreeNodeRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java Fri Nov 15 17:10:58 2013
@@ -50,7 +50,7 @@ public class TreeNodeRenderer extends Tr
= ResourceUtils.createString("image", "treeNode", "icon", "leaf", ResourceUtils.GIF);
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
final AbstractUITreeNode node = (AbstractUITreeNode) component;
final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);
@@ -76,14 +76,14 @@ public class TreeNodeRenderer extends Tr
writer.writeAttribute(DataAttributes.TREE_PARENT, parentId, false);
}
- Style style = new Style();
+ final Style style = new Style();
// In the case of a sheet, we need not hiding the node, because the whole TR will be hidden.
if (!dataRendersRowContainer && !visible) {
style.setDisplay(Display.NONE);
}
// div style (width)
- Style widthStyle = new Style(facesContext, (LayoutBase) data);
+ final Style widthStyle = new Style(facesContext, (LayoutBase) data);
if (widthStyle.getWidth() != null) {
style.setWidth(widthStyle.getWidth().subtract(22)); // fixme: 4 + 18 for scrollbar
}
@@ -91,7 +91,7 @@ public class TreeNodeRenderer extends Tr
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.endElement(HtmlElements.DIV);
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRendererBase.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/TreeNodeRendererBase.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRendererBase.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRendererBase.java Fri Nov 15 17:10:58 2013
@@ -33,7 +33,7 @@ import java.io.IOException;
public class TreeNodeRendererBase extends LayoutComponentRendererBase {
@Override
- public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
+ public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
super.prepareRender(facesContext, component);
final AbstractUITreeNode node = (AbstractUITreeNode) component;
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeRenderer.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/TreeRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeRenderer.java Fri Nov 15 17:10:58 2013
@@ -34,6 +34,7 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
+import org.apache.myfaces.tobago.renderkit.util.EncodeUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -49,7 +50,7 @@ public class TreeRenderer extends Layout
private static final Logger LOG = LoggerFactory.getLogger(TreeRenderer.class);
@Override
- public void decode(FacesContext facesContext, UIComponent component) {
+ public void decode(final FacesContext facesContext, final UIComponent component) {
RenderUtils.decodeScrollPosition(facesContext, component);
final AbstractUITree tree = (AbstractUITree) component;
RenderUtils.decodedStateOfTreeData(facesContext, tree);
@@ -61,28 +62,28 @@ public class TreeRenderer extends Layout
}
@Override
- public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
+ public void encodeChildren(final FacesContext context, final UIComponent component) throws IOException {
// will be rendered in encodeEnd()
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
- AbstractUITree tree = (AbstractUITree) component;
+ final AbstractUITree tree = (AbstractUITree) component;
- String clientId = tree.getClientId(facesContext);
- UIComponent root = ComponentUtils.findDescendant(tree, UITreeNode.class);
+ final String clientId = tree.getClientId(facesContext);
+ final UIComponent root = ComponentUtils.findDescendant(tree, UITreeNode.class);
if (root == null) {
LOG.error("Can't find the tree root. This may occur while updating a tree from Tobago 1.0 to 1.5. "
+ "Please refer the documentation to see how to use tree tags.");
return;
}
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.startElement(HtmlElements.DIV, tree);
writer.writeClassAttribute(Classes.create(tree));
- Style style = new Style(facesContext, tree);
+ final Style style = new Style(facesContext, tree);
writer.writeStyleAttribute(style);
writer.writeIdAttribute(clientId);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, tree);
@@ -118,8 +119,8 @@ public class TreeRenderer extends Layout
expandedValue.append(",");
}
- for (UIComponent child : tree.getChildren()) {
- RenderUtils.prepareRendererAll(facesContext, child);
+ for (final UIComponent child : tree.getChildren()) {
+ EncodeUtils.prepareRendererAll(facesContext, child);
RenderUtils.encode(facesContext, child);
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeSelectRenderer.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/TreeSelectRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeSelectRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeSelectRenderer.java Fri Nov 15 17:10:58 2013
@@ -45,7 +45,7 @@ public class TreeSelectRenderer extends
private static final Log LOG = LogFactory.getLog(TreeSelectRenderer.class);
- public void decode(FacesContext facesContext, UIComponent component) {
+ public void decode(final FacesContext facesContext, final UIComponent component) {
final UITreeSelect select = (UITreeSelect) component;
final AbstractUITreeNode node = ComponentUtils.findAncestor(select, AbstractUITreeNode.class);
@@ -76,13 +76,13 @@ public class TreeSelectRenderer extends
}
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
final UITreeSelect select = (UITreeSelect) component;
final AbstractUITreeNode node = ComponentUtils.findAncestor(select, AbstractUITreeNode.class);
final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
if (data instanceof AbstractUITreeListbox) {
writer.write(StringUtils.defaultString(select.getLabel()));
@@ -137,12 +137,12 @@ public class TreeSelectRenderer extends
writer.endElement(HtmlElements.SPAN);
}
- private String getClientIdWithoutRowIndex(AbstractUIData data, String id) {
+ private String getClientIdWithoutRowIndex(final AbstractUIData data, final String id) {
final char separatorChar = UINamingContainer.getSeparatorChar(FacesContext.getCurrentInstance());
return id.replace("" + separatorChar + data.getRowIndex() + separatorChar, "" + separatorChar);
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/VerbatimRenderer.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/VerbatimRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/VerbatimRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/VerbatimRenderer.java Fri Nov 15 17:10:58 2013
@@ -35,14 +35,14 @@ public class VerbatimRenderer extends La
private static final Logger LOG = LoggerFactory.getLogger(VerbatimRenderer.class);
- public void encodeEnd(FacesContext facesContext,
- UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext,
+ final UIComponent component) throws IOException {
LOG.info("HI! " + component.getClientId(facesContext), new Exception());
- ResponseWriter writer = facesContext.getResponseWriter();
+ final ResponseWriter writer = facesContext.getResponseWriter();
- String value = RenderUtils.currentValue(component);
+ final String value = RenderUtils.currentValue(component);
if (value == null) {
return;
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/AbstractJavaScriptTestBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/AbstractJavaScriptTestBase.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/AbstractJavaScriptTestBase.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/AbstractJavaScriptTestBase.java Fri Nov 15 17:10:58 2013
@@ -51,12 +51,12 @@ public abstract class AbstractJavaScript
}
- protected Object eval(String script) {
+ protected Object eval(final String script) {
return cx.evaluateString(scope, script, "test", 1, null);
}
- protected int evalInt(String script) {
- Object o = eval(script);
+ protected int evalInt(final String script) {
+ final Object o = eval(script);
if (o instanceof Number) {
return ((Number) o).intValue();
}
@@ -64,8 +64,8 @@ public abstract class AbstractJavaScript
+ o.getClass().getName() + " with value " + o, 0);
}
- protected long evalLong(String script) {
- Object o = eval(script);
+ protected long evalLong(final String script) {
+ final Object o = eval(script);
if (o instanceof Number) {
return ((Number) o).longValue();
}
@@ -73,8 +73,8 @@ public abstract class AbstractJavaScript
+ o.getClass().getName() + " with value " + o, 0);
}
- protected boolean evalBoolean(String script) {
- Object o = eval(script);
+ protected boolean evalBoolean(final String script) {
+ final Object o = eval(script);
if (o instanceof Boolean) {
return ((Boolean) o).booleanValue();
}
@@ -83,7 +83,7 @@ public abstract class AbstractJavaScript
}
// XXX directory handling + Maven reactor current dir problem
- protected void loadScriptFile(String jsFile)
+ protected void loadScriptFile(final String jsFile)
throws IOException {
String fileName
= "src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/" + jsFile;
@@ -92,7 +92,7 @@ public abstract class AbstractJavaScript
fileName = System.getProperty("basedir") + "/" + fileName;
file = new File(fileName);
}
- FileReader fileReader = new FileReader(file);
+ final FileReader fileReader = new FileReader(file);
cx.evaluateReader(scope, fileReader, jsFile, 0, null);
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/DateTestUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/DateTestUtils.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/DateTestUtils.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/DateTestUtils.java Fri Nov 15 17:10:58 2013
@@ -28,25 +28,25 @@ import java.text.SimpleDateFormat;
public class DateTestUtils {
- public static List<String> createMonthNames(boolean longFormat, Locale locale) {
+ public static List<String> createMonthNames(final boolean longFormat, final Locale locale) {
return createLocalizationNames(
longFormat ? "MMMM" : "MMM", 0, 11, Calendar.MONTH, locale);
}
- public static List<String> createDayNames(boolean longFormat, Locale locale) {
+ public static List<String> createDayNames(final boolean longFormat, final Locale locale) {
return createLocalizationNames(
longFormat ? "EEEE" : "E", 1, 7, Calendar.DAY_OF_WEEK, locale);
}
- private static List<String> createLocalizationNames(String format, int min, int max,
- int field, Locale locale) {
- List<String> names = new ArrayList<String>();
- SimpleDateFormat dateFormat = new SimpleDateFormat(format, locale);
+ private static List<String> createLocalizationNames(final String format, final int min, final int max,
+ final int field, final Locale locale) {
+ final List<String> names = new ArrayList<String>();
+ final SimpleDateFormat dateFormat = new SimpleDateFormat(format, locale);
for (int day = min; day <= max; ++day) {
- Calendar calendar = Calendar.getInstance();
+ final Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(field, day);
- Date date = calendar.getTime();
+ final Date date = calendar.getTime();
names.add(dateFormat.format(date));
}
return names;
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/DateUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/DateUnitTest.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/DateUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/test/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/DateUnitTest.java Fri Nov 15 17:10:58 2013
@@ -44,8 +44,8 @@ public class DateUnitTest extends Abstra
createDate(1972, 1, 29)
);
- private static Date createDate(int year, int month, int day) {
- Calendar calendar = Calendar.getInstance(Locale.ENGLISH); // XXX
+ private static Date createDate(final int year, final int month, final int day) {
+ final Calendar calendar = Calendar.getInstance(Locale.ENGLISH); // XXX
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month - 1);
calendar.set(Calendar.DAY_OF_MONTH, day);
@@ -59,7 +59,7 @@ public class DateUnitTest extends Abstra
@Test
public void testNumberOnlyDateFormats() throws IOException {
- for (Date date : DATES) {
+ for (final Date date : DATES) {
checkFormat("yyyyMMdd", date, YEAR_MONTH_DAY, Locale.ENGLISH);
checkFormat("ddMMyyyy", date, YEAR_MONTH_DAY, Locale.ENGLISH);
checkFormat("d.M.yyyy", date, YEAR_MONTH_DAY, Locale.ENGLISH);
@@ -74,8 +74,8 @@ public class DateUnitTest extends Abstra
@Test
public void testEnglishMonths() throws IOException {
for (int month = 1; month <= 12; ++month) {
- Date date = createDate(2005, month, 10);
- StringBuilder format = new StringBuilder("M");
+ final Date date = createDate(2005, month, 10);
+ final StringBuilder format = new StringBuilder("M");
for (int i = 0; i < 4; ++i) {
format.append('M');
checkFormat(format.toString(), date, new int[] {Calendar.MONTH}, Locale.ENGLISH);
@@ -90,12 +90,12 @@ public class DateUnitTest extends Abstra
}
@Test
- public void checkTwoDigitYears(Locale locale) throws IOException, ParseException {
- DecimalFormat decimalFormat = new DecimalFormat("00");
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yy", locale);
- Calendar calendar = Calendar.getInstance(locale);
+ public void checkTwoDigitYears(final Locale locale) throws IOException, ParseException {
+ final DecimalFormat decimalFormat = new DecimalFormat("00");
+ final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yy", locale);
+ final Calendar calendar = Calendar.getInstance(locale);
for (int year = 0; year < 100; ++year) {
- String yearString = decimalFormat.format(year);
+ final String yearString = decimalFormat.format(year);
calendar.setTime(simpleDateFormat.parse(yearString));
Assert.assertEquals(calendar.get(Calendar.YEAR), evalParseDate(yearString, "yy", locale).get(Calendar.YEAR));
}
@@ -104,11 +104,11 @@ public class DateUnitTest extends Abstra
@Test
public void testEnglishWeekDays() throws IOException {
for (int day = 1; day <= 7; ++day) {
- Calendar calendar = Calendar.getInstance();
+ final Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_WEEK, day);
- Date date = calendar.getTime();
+ final Date date = calendar.getTime();
- StringBuilder format = new StringBuilder();
+ final StringBuilder format = new StringBuilder();
for (int i = 0; i < 4; ++i) {
format.append('E');
checkFormat(format.toString(), date, new int[0], Locale.ENGLISH); // XXX new int[] {Calendar.DAY_OF_WEEK}
@@ -116,7 +116,7 @@ public class DateUnitTest extends Abstra
}
}
- private Object evalFormatDate(Date date, String format) {
+ private Object evalFormatDate(final Date date, final String format) {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
return eval("new SimpleDateFormat(\"" + format + "\")"
+ ".format(new Date(" + date.getTime() + "))");
@@ -128,7 +128,7 @@ public class DateUnitTest extends Abstra
Assert.assertEquals("Januar", eval(createSymbols("s", Locale.GERMAN) + "s.months[0]"));
}
- private String createSymbols(String var, Locale locale) {
+ private String createSymbols(final String var, final Locale locale) {
return "var " + var + " = new DateFormatSymbols(); "
+ var + ".months = new Array("
+ createStringList(DateTestUtils.createMonthNames(true, locale)) + ");"
@@ -140,14 +140,14 @@ public class DateUnitTest extends Abstra
+ createStringList(DateTestUtils.createDayNames(false, locale)) + ");";
}
- private String createStringList(List<String> strings) {
+ private String createStringList(final List<String> strings) {
return "'" + join(strings, "', '") + "'";
}
- private String join(List<String> strings, String separator) {
- StringBuilder builder = new StringBuilder();
+ private String join(final List<String> strings, final String separator) {
+ final StringBuilder builder = new StringBuilder();
for (int i = 0; i < strings.size(); i++) {
- String s = strings.get(i);
+ final String s = strings.get(i);
if (i > 0) {
builder.append(separator);
}
@@ -156,29 +156,29 @@ public class DateUnitTest extends Abstra
return builder.toString();
}
- private Calendar evalParseDate(String input, String format, Locale locale) {
- long time = evalLong(createSymbols("s", locale) + ";"
+ private Calendar evalParseDate(final String input, final String format, final Locale locale) {
+ final long time = evalLong(createSymbols("s", locale) + ";"
+ "new SimpleDateFormat(\"" + format + "\", s)"
+ ".parse(\"" + input + "\").getTime()");
- Calendar calendar = Calendar.getInstance(locale);
+ final Calendar calendar = Calendar.getInstance(locale);
calendar.setTime(new Date(time));
return calendar;
}
- private void checkFormat(String format, Date date, int[] fields,
- Locale locale) {
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format, locale);
+ private void checkFormat(final String format, final Date date, final int[] fields,
+ final Locale locale) {
+ final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format, locale);
Assert.assertEquals(simpleDateFormat.format(date), evalFormatDate(date, format));
- Calendar calendar1 = Calendar.getInstance(locale);
+ final Calendar calendar1 = Calendar.getInstance(locale);
calendar1.setTime(date);
- Calendar calendar2 = evalParseDate(
+ final Calendar calendar2 = evalParseDate(
simpleDateFormat.format(date), format, locale);
- for (int field : fields) {
+ for (final int field : fields) {
checkField(calendar1, calendar2, field);
}
}
- private void checkField(Calendar calendar1, Calendar calendar2, int field) {
+ private void checkField(final Calendar calendar1, final Calendar calendar2, final int field) {
Assert.assertEquals(calendar1.get(field), calendar2.get(field));
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java Fri Nov 15 17:10:58 2013
@@ -42,7 +42,7 @@ import java.io.IOException;
public class BoxRenderer extends BoxRendererBase {
@Override
- public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
+ public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
super.prepareRender(facesContext, component);
HtmlRendererUtils.renderDojoDndSource(facesContext, component);
}
@@ -75,17 +75,17 @@ without shadow
*/
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- UIBox box = (UIBox) component;
+ final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ final UIBox box = (UIBox) component;
- String clientId = box.getClientId(facesContext);
+ final String clientId = box.getClientId(facesContext);
writer.startElement(HtmlElements.DIV, box);
HtmlRendererUtils.renderDojoDndItem(box, writer, true);
writer.writeClassAttribute(Classes.create(box));
writer.writeIdAttribute(clientId);
- String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, box);
+ final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, box);
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
@@ -94,19 +94,20 @@ without shadow
encodeBox(facesContext, writer, box);
}
- private void encodeBox(FacesContext facesContext, TobagoResponseWriter writer, UIBox box) throws IOException {
+ private void encodeBox(final FacesContext facesContext, final TobagoResponseWriter writer, final UIBox box)
+ throws IOException {
// todo: shadow = 0px means, that shadow is disabled, but it may be better, if we can set a boolean in the config.
// todo: this is possible after fixing
- Measure measure = getResourceManager().getThemeMeasure(facesContext, box, "shadow");
- boolean hasShadow = measure.greaterThan(Measure.ZERO);
+ final Measure measure = getResourceManager().getThemeMeasure(facesContext, box, "shadow");
+ final boolean hasShadow = measure.greaterThan(Measure.ZERO);
if (hasShadow) {
// shadow begin
writer.startElement(HtmlElements.DIV, box);
writer.writeClassAttribute(Classes.create(box, "shadow"));
- Style shadow = new Style();
+ final Style shadow = new Style();
shadow.setWidth(box.getCurrentWidth().subtract(1));
shadow.setHeight(box.getCurrentHeight().subtract(1));
writer.writeStyleAttribute(shadow);
@@ -115,16 +116,16 @@ without shadow
writer.startElement(HtmlElements.DIV, box);
writer.writeClassAttribute(Classes.create(box, "border"));
- Style border = new Style();
+ final Style border = new Style();
border.setWidth(box.getCurrentWidth().subtract(3));
border.setHeight(box.getCurrentHeight().subtract(3));
writer.writeStyleAttribute(border);
}
- UIComponent label = box.getFacet(Facets.LABEL);
+ final UIComponent label = box.getFacet(Facets.LABEL);
writer.startElement(HtmlElements.DIV, null);
writer.writeClassAttribute(Classes.create(box, "header"));
- String labelString = (String) box.getAttributes().get(Attributes.LABEL);
+ final String labelString = (String) box.getAttributes().get(Attributes.LABEL);
if (label != null) {
RenderUtils.encode(facesContext, label);
} else if (labelString != null) {
@@ -137,7 +138,7 @@ without shadow
RenderUtils.encode(facesContext, menuBar);
}
- UIPanel toolbar = (UIPanel) box.getFacet(Facets.TOOL_BAR);
+ final UIPanel toolbar = (UIPanel) box.getFacet(Facets.TOOL_BAR);
if (toolbar != null) {
renderToolbar(facesContext, writer, box, toolbar);
}
@@ -164,14 +165,15 @@ without shadow
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
+ final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.endElement(HtmlElements.DIV);
writer.endElement(HtmlElements.DIV);
}
protected void renderToolbar(
- FacesContext facesContext, TobagoResponseWriter writer, UIBox box, UIPanel toolbar) throws IOException {
+ final FacesContext facesContext, final TobagoResponseWriter writer, final UIBox box, final UIPanel toolbar)
+ throws IOException {
writer.startElement(HtmlElements.DIV, null);
writer.writeClassAttribute(Classes.create(box, "headerToolBar"));
toolbar.setRendererType(RendererTypes.BOX_TOOL_BAR);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/BoxRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/BoxRendererBase.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/BoxRendererBase.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/BoxRendererBase.java Fri Nov 15 17:10:58 2013
@@ -40,7 +40,7 @@ public abstract class BoxRendererBase ex
}
@Override
- public Measure getBorderTop(FacesContext facesContext, Configurable component) {
+ public Measure getBorderTop(final FacesContext facesContext, final Configurable component) {
Measure borderTop = super.getBorderTop(facesContext, component);
if (getMenuBarFacet((UIComponent) component) != null) {
@@ -50,7 +50,7 @@ public abstract class BoxRendererBase ex
}
@Override
- public Measure getMinimumHeight(FacesContext facesContext, Configurable component) {
+ public Measure getMinimumHeight(final FacesContext facesContext, final Configurable component) {
if (component instanceof UIBox && ((UIBox) component).isCollapsed()) {
return getBorderTop(facesContext, component);
}
@@ -58,19 +58,19 @@ public abstract class BoxRendererBase ex
}
@Override
- public Measure getMaximumHeight(FacesContext facesContext, Configurable component) {
+ public Measure getMaximumHeight(final FacesContext facesContext, final Configurable component) {
if (component instanceof UIBox && ((UIBox) component).isCollapsed()) {
return getBorderTop(facesContext, component);
}
return super.getMaximumHeight(facesContext, component);
}
- protected UIMenuBar getMenuBarFacet(UIComponent component) {
+ protected UIMenuBar getMenuBarFacet(final UIComponent component) {
return (UIMenuBar) component.getFacet(Facets.MENUBAR);
}
@Override
- public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeChildren(final FacesContext facesContext, final UIComponent component) throws IOException {
if (component instanceof UIBox && ((UIBox) component).isCollapsed()) {
return;
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/CommandRendererBase.java Fri Nov 15 17:10:58 2013
@@ -33,13 +33,13 @@ public abstract class CommandRendererBas
private static final Logger LOG = LoggerFactory.getLogger(CommandRendererBase.class);
- public void decode(FacesContext facesContext, UIComponent component) {
+ public void decode(final FacesContext facesContext, final UIComponent component) {
if (ComponentUtils.isOutputOnly(component)) {
return;
}
- String actionId = FacesContextUtils.getActionId(facesContext);
- String clientId = component.getClientId(facesContext);
+ final String actionId = FacesContextUtils.getActionId(facesContext);
+ final String clientId = component.getClientId(facesContext);
if (LOG.isDebugEnabled()) {
LOG.debug("actionId = '" + actionId + "'");
LOG.debug("clientId = '" + clientId + "'");
@@ -53,11 +53,11 @@ public abstract class CommandRendererBas
}
}
- protected void commandActivated(UIComponent component) {
+ protected void commandActivated(final UIComponent component) {
component.queueEvent(new ActionEvent(component));
}
- public String getImageWithPath(FacesContext facesContext, String image, boolean disabled) {
+ public String getImageWithPath(final FacesContext facesContext, final String image, final boolean disabled) {
String imageWithPath = null;
if (disabled) {
imageWithPath = ResourceManagerUtils.getDisabledImageWithPath(facesContext, image);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Command.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Command.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Command.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Command.java Fri Nov 15 17:10:58 2013
@@ -63,8 +63,8 @@ public class Command {
}
public Command(
- String action, Boolean transition, String target, String url, String[] partially, String focus,
- String confirmation, Integer delay, Popup popup, Boolean omit) {
+ final String action, final Boolean transition, final String target, final String url, final String[] partially,
+ final String focus, final String confirmation, final Integer delay, final Popup popup, final Boolean omit) {
this.action = action;
this.transition = transition;
this.target = target;
@@ -77,7 +77,7 @@ public class Command {
this.omit = omit;
}
- public Command(FacesContext facesContext, AbstractUICommandBase command) {
+ public Command(final FacesContext facesContext, final AbstractUICommandBase command) {
this(
null,
command.isTransition(),
@@ -94,7 +94,7 @@ public class Command {
}
}
- public Command(FacesContext facesContext, UIComponent facetComponent, String focusId) {
+ public Command(final FacesContext facesContext, UIComponent facetComponent, final String focusId) {
if (facetComponent instanceof UIForm && facetComponent.getChildCount() == 1) {
Deprecation.LOG.warn("Please don't use a form, but a command with immediate=true instead.");
facetComponent = facetComponent.getChildren().get(0);
@@ -104,7 +104,7 @@ public class Command {
if (!ComponentUtils.getBooleanAttribute(facetComponent, Attributes.TRANSITION)) {
this.transition = Boolean.FALSE;
}
- String target = ComponentUtils.getStringAttribute(facetComponent, Attributes.TARGET);
+ final String target = ComponentUtils.getStringAttribute(facetComponent, Attributes.TARGET);
if (target != null) {
this.target = target;
}
@@ -126,7 +126,7 @@ public class Command {
}
}
- int delay = ComponentUtils.getIntAttribute(facetComponent, Attributes.DELAY);
+ final int delay = ComponentUtils.getIntAttribute(facetComponent, Attributes.DELAY);
if (delay > 0) {
this.delay = delay;
}
@@ -136,7 +136,7 @@ public class Command {
}
}
- private static String getConfirmation(AbstractUICommandBase command) {
+ private static String getConfirmation(final AbstractUICommandBase command) {
final ValueHolder facet = (ValueHolder) command.getFacet(Facets.CONFIRMATION);
return facet != null ? "" + facet.getValue() : null;
}
@@ -145,7 +145,7 @@ public class Command {
return action;
}
- public void setAction(String action) {
+ public void setAction(final String action) {
this.action = action;
}
@@ -153,7 +153,7 @@ public class Command {
return transition;
}
- public void setTransition(Boolean transition) {
+ public void setTransition(final Boolean transition) {
this.transition = transition;
}
@@ -161,7 +161,7 @@ public class Command {
return target;
}
- public void setTarget(String target) {
+ public void setTarget(final String target) {
this.target = target;
}
@@ -169,7 +169,7 @@ public class Command {
return url;
}
- public void setUrl(String url) {
+ public void setUrl(final String url) {
this.url = url;
}
@@ -177,7 +177,7 @@ public class Command {
return partially;
}
- public void setPartially(String[] partially) {
+ public void setPartially(final String[] partially) {
this.partially = partially;
}
@@ -185,7 +185,7 @@ public class Command {
return focus;
}
- public void setFocus(String focus) {
+ public void setFocus(final String focus) {
this.focus = focus;
}
@@ -193,7 +193,7 @@ public class Command {
return confirmation;
}
- public void setConfirmation(String confirmation) {
+ public void setConfirmation(final String confirmation) {
this.confirmation = confirmation;
}
@@ -201,7 +201,7 @@ public class Command {
return delay;
}
- public void setDelay(Integer delay) {
+ public void setDelay(final Integer delay) {
this.delay = delay;
}
@@ -209,7 +209,7 @@ public class Command {
return popup;
}
- public void setPopup(Popup popup) {
+ public void setPopup(final Popup popup) {
this.popup = popup;
}
@@ -217,7 +217,7 @@ public class Command {
return omit;
}
- public void setOmit(Boolean omit) {
+ public void setOmit(final Boolean omit) {
this.omit = omit;
}
@@ -232,7 +232,7 @@ public class Command {
* @deprecated Script will not work when CSP is activated
*/
@Deprecated
- public void setScript(String script) {
+ public void setScript(final String script) {
this.script = script;
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/CommandMap.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/CommandMap.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/CommandMap.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/CommandMap.java Fri Nov 15 17:10:58 2013
@@ -43,11 +43,11 @@ public class CommandMap {
/**
* Creates a command map, which hold the given command triggered by "click".
*/
- public CommandMap(Command click) {
+ public CommandMap(final Command click) {
this.click = click;
}
- public void setClick(Command click) {
+ public void setClick(final Command click) {
this.click = click;
}
@@ -55,7 +55,7 @@ public class CommandMap {
return click;
}
- public void addCommand(String name, Command command) {
+ public void addCommand(final String name, final Command command) {
if (name.equals("click")) {
setClick(command);
} else {
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/JsonUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/JsonUtils.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/JsonUtils.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/JsonUtils.java Fri Nov 15 17:10:58 2013
@@ -26,12 +26,12 @@ public class JsonUtils {
private JsonUtils() {
}
- private static void encode(StringBuilder builder, String name, String[] value) {
+ private static void encode(final StringBuilder builder, final String name, final String[] value) {
builder.append("\"");
builder.append(name);
builder.append("\":\"");
boolean colon = false;
- for (String item : value) {
+ for (final String item : value) {
if (colon) {
builder.append(",");
}
@@ -41,7 +41,7 @@ public class JsonUtils {
builder.append("\",");
}
- static void encode(StringBuilder builder, String name, Boolean value) {
+ static void encode(final StringBuilder builder, final String name, final Boolean value) {
builder.append("\"");
builder.append(name);
builder.append("\":");
@@ -49,7 +49,7 @@ public class JsonUtils {
builder.append(",");
}
- static void encode(StringBuilder builder, String name, Integer value) {
+ static void encode(final StringBuilder builder, final String name, final Integer value) {
builder.append("\"");
builder.append(name);
builder.append("\":");
@@ -57,7 +57,7 @@ public class JsonUtils {
builder.append(",");
}
- static void encode(StringBuilder builder, String name, String value) {
+ static void encode(final StringBuilder builder, final String name, String value) {
value = value.replaceAll("\\\"", "\\\\\\\"");
builder.append("\"");
builder.append(name);
@@ -66,19 +66,19 @@ public class JsonUtils {
builder.append("\",");
}
- public static String encode(CommandMap commandMap) {
- StringBuilder builder = new StringBuilder();
+ public static String encode(final CommandMap commandMap) {
+ final StringBuilder builder = new StringBuilder();
builder.append("{");
- int initialLength = builder.length();
+ final int initialLength = builder.length();
- Command click = commandMap.getClick();
+ final Command click = commandMap.getClick();
if (click != null) {
encode(builder, "click", click);
}
final Map<String, Command> other = commandMap.getOther();
if (other != null) {
- for(Map.Entry<String, Command> entry : other.entrySet()) {
+ for(final Map.Entry<String, Command> entry : other.entrySet()) {
encode(builder, entry.getKey(), entry.getValue());
}
}
@@ -92,53 +92,53 @@ public class JsonUtils {
return builder.toString();
}
- static void encode(StringBuilder builder, String name, Command command) {
+ static void encode(final StringBuilder builder, final String name, final Command command) {
builder.append("\"");
builder.append(name);
builder.append("\":{");
- int initialLength = builder.length();
+ final int initialLength = builder.length();
- String action = command.getAction();
+ final String action = command.getAction();
if (action != null) {
encode(builder, "action", action);
}
- Boolean transition = command.getTransition();
+ final Boolean transition = command.getTransition();
if (transition != null && !transition) { // true is the default, so encoding is needed.
encode(builder, "transition", transition);
}
- String target = command.getTarget();
+ final String target = command.getTarget();
if (target != null) {
encode(builder, "target", target);
}
- String url = command.getUrl();
+ final String url = command.getUrl();
if (url != null) {
encode(builder, "url", url);
}
- String[] partially = command.getPartially();
+ final String[] partially = command.getPartially();
if (partially != null && partially.length > 0) {
encode(builder, "partially", partially);
}
- String focus = command.getFocus();
+ final String focus = command.getFocus();
if (focus != null) {
encode(builder, "focus", focus);
}
- String confirmation = command.getConfirmation();
+ final String confirmation = command.getConfirmation();
if (confirmation != null) {
encode(builder, "confirmation", confirmation);
}
- Integer delay = command.getDelay();
+ final Integer delay = command.getDelay();
if (delay != null) {
encode(builder, "delay", delay);
}
- Popup popup = command.getPopup();
+ final Popup popup = command.getPopup();
if (popup != null) {
encode(builder, "popup", popup);
}
- String script = command.getScript();
+ final String script = command.getScript();
if (script != null) {
encode(builder, "script", script);
}
- Boolean omit = command.getOmit();
+ final Boolean omit = command.getOmit();
if (omit != null && omit) { // false is the default, so encoding is needed.
encode(builder, "omit", omit);
}
@@ -151,17 +151,17 @@ public class JsonUtils {
builder.append("},");
}
- static void encode(StringBuilder builder, String name, Popup popup) {
+ static void encode(final StringBuilder builder, final String name, final Popup popup) {
builder.append("\"");
builder.append(name);
builder.append("\":{");
- int initialLength = builder.length();
+ final int initialLength = builder.length();
- String command = popup.getCommand();
+ final String command = popup.getCommand();
if (command != null) {
encode(builder, "command", command);
}
- Boolean immediate = popup.isImmediate();
+ final Boolean immediate = popup.isImmediate();
if (immediate != null) {
encode(builder, "immediate", immediate);
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Popup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Popup.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Popup.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/Popup.java Fri Nov 15 17:10:58 2013
@@ -35,12 +35,12 @@ public class Popup {
*/
private Boolean immediate;
- private Popup(String command, Boolean immediate) {
+ private Popup(final String command, final Boolean immediate) {
this.command = command;
this.immediate = immediate;
}
- public static Popup createPopup(AbstractUICommandBase component) {
+ public static Popup createPopup(final AbstractUICommandBase component) {
String command = null;
Boolean immediate = null;
@@ -49,7 +49,7 @@ public class Popup {
command = "close";
immediate = popupClose.equals("immediate");
} else {
- boolean popupAction = ComponentUtils.containsPopupActionListener(component);
+ final boolean popupAction = ComponentUtils.containsPopupActionListener(component);
if (popupAction) {
command = "open";
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MediatorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MediatorRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MediatorRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MediatorRenderer.java Fri Nov 15 17:10:58 2013
@@ -37,19 +37,19 @@ public class MediatorRenderer extends La
private static final Logger LOG = LoggerFactory.getLogger(MediatorRenderer.class);
@Override
- public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws IOException {
- UIMediator mediator = (UIMediator) component;
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ final UIMediator mediator = (UIMediator) component;
+ final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.startElement(HtmlElements.DIV, mediator);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, mediator);
writer.writeStyleAttribute(new Style(facesContext, mediator));
}
@Override
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.endElement(HtmlElements.DIV);
}
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java?rev=1542331&r1=1542330&r2=1542331&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java Fri Nov 15 17:10:58 2013
@@ -42,10 +42,10 @@ import java.io.IOException;
public class SeparatorRenderer extends LayoutComponentRendererBase {
- public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {
- UISeparator separator = (UISeparator) component;
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
+ final UISeparator separator = (UISeparator) component;
+ final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
String label = getLabel(separator);
@@ -58,7 +58,7 @@ public class SeparatorRenderer extends L
writer.writeIdAttribute(separator.getClientId(facesContext));
writer.writeClassAttribute(Classes.create(component));
HtmlRendererUtils.writeDataAttributes(facesContext, writer, component);
- Style style = new Style(facesContext, separator);
+ final Style style = new Style(facesContext, separator);
writer.writeStyleAttribute(style);
writer.writeAttribute(HtmlAttributes.CELLPADDING, "0", false);
@@ -88,14 +88,14 @@ public class SeparatorRenderer extends L
writer.startElement(HtmlElements.HR , component);
writer.writeIdAttribute(separator.getClientId(facesContext));
writer.writeClassAttribute(Classes.create(component));
- Style style = new Style(facesContext, separator);
+ final Style style = new Style(facesContext, separator);
style.setHeight(Measure.ZERO); // not nice
writer.writeStyleAttribute(style);
writer.endElement(HtmlElements.HR);
}
}
- private String getLabel(UISeparator separator) {
+ private String getLabel(final UISeparator separator) {
String label = separator.getLabel();
if (label == null && separator.getFacet(Facets.LABEL) != null) {
// deprecated
@@ -106,8 +106,8 @@ public class SeparatorRenderer extends L
}
@Override
- public Measure getHeight(FacesContext facesContext, Configurable component) {
- String label = getLabel((UISeparator) component);
+ public Measure getHeight(final FacesContext facesContext, final Configurable component) {
+ final String label = getLabel((UISeparator) component);
if (label == null) {
return getResourceManager().getThemeMeasure(facesContext, component, "withoutLabelHeight");
} else {