|
From: <tri...@us...> - 2008-12-04 08:35:04
|
Revision: 898
http://equanda.svn.sourceforge.net/equanda/?rev=898&view=rev
Author: triathlon98
Date: 2008-12-04 08:34:54 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
EQ-299 remove checkstyle errors and warnings
Modified Paths:
--------------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaOptionModel.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaSelectModel.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/bindings/ManifestBindingPrefix.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormSupport.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPagedLoop.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/TreeTable.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Truncate.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/FlattenedTree.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/Tree.java
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaOptionModel.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaOptionModel.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaOptionModel.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -1,3 +1,27 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
package org.equanda.tapestry5.base;
import org.apache.tapestry5.AbstractOptionModel;
@@ -2,2 +26,7 @@
+/**
+ * Option model.
+ *
+ * @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
+ */
public class EquandaOptionModel
@@ -8,12 +37,12 @@
private String label;
private Object value;
- public EquandaOptionModel ( String value )
+ public EquandaOptionModel( String value )
{
this( value, value );
}
- public EquandaOptionModel ( String label, Object value )
+ public EquandaOptionModel( String label, Object value )
{
this.label = label;
this.value = value;
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaSelectModel.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaSelectModel.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/base/EquandaSelectModel.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -31,24 +31,29 @@
import java.util.Arrays;
import java.util.List;
+/**
+ * Select model.
+ *
+ * @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
+ */
public class EquandaSelectModel
extends AbstractSelectModel
{
private final List<OptionGroupModel> optionGroups;
private final List<OptionModel> optionModels;
- public EquandaSelectModel ( List<OptionGroupModel> optionGroups, List<OptionModel> optionModels )
+ public EquandaSelectModel( List<OptionGroupModel> optionGroups, List<OptionModel> optionModels )
{
this.optionGroups = optionGroups;
this.optionModels = optionModels;
}
- public EquandaSelectModel ( OptionModel... optionModels )
+ public EquandaSelectModel( OptionModel... optionModels )
{
this( null, Arrays.asList( optionModels ) );
}
- public EquandaSelectModel ( OptionGroupModel... groupModels )
+ public EquandaSelectModel( OptionGroupModel... groupModels )
{
this( Arrays.asList( groupModels ), null );
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/bindings/ManifestBindingPrefix.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/bindings/ManifestBindingPrefix.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/bindings/ManifestBindingPrefix.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -44,7 +44,7 @@
public class ManifestBindingPrefix
implements Binding
{
- private static final Map<String, String> cache = new ConcurrentHashMap<String, String>();
+ private static final Map<String, String> CACHE = new ConcurrentHashMap<String, String>();
private String expression;
public ManifestBindingPrefix( String expression )
@@ -57,7 +57,7 @@
try
{
// first try to get the value from the cache (these things don't really change at runtime after all)
- String res = cache.get( expression );
+ String res = CACHE.get( expression );
if ( res != null ) return res;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
@@ -70,7 +70,7 @@
URL url = urls.nextElement();
res = get( url );
}
- if ( res != null ) cache.put( expression, res );
+ if ( res != null ) CACHE.put( expression, res );
return res;
}
catch ( Exception ex )
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Accordion.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -24,7 +24,8 @@
package org.equanda.tapestry5.components;
-import org.apache.tapestry5.annotations.*;
+import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary;
+import org.apache.tapestry5.annotations.SupportsInformalParameters;
import org.equanda.tapestry5.base.TitleContent;
/**
@@ -32,7 +33,8 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-@IncludeJavaScriptLibrary( { "${tapestry.scriptaculous}/prototype.js", "classpath:/org/equanda/tapestry5/resources/accordion.js" } )
+@IncludeJavaScriptLibrary( { "${tapestry.scriptaculous}/prototype.js",
+ "classpath:/org/equanda/tapestry5/resources/accordion.js" } )
@SupportsInformalParameters
public class Accordion
extends TitleContent
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormSupport.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormSupport.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormSupport.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -46,7 +46,7 @@
private ComponentResources resources;
@Inject
- private Environment environment;
+ private Environment environment;
private String formActionLinkTarget;
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/FormTraversal.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -49,7 +49,7 @@
private Asset script;
@Environmental
- private RenderSupport renderSupport;
+ private RenderSupport renderSupport;
@BeginRender
boolean doBeginRender( MarkupWriter writer )
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPagedLoop.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPagedLoop.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPagedLoop.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -80,9 +80,7 @@
@Parameter( value = "prop:componentResources.elementName", defaultPrefix = BindingConstants.LITERAL )
private String elementName;
- /**
- * Defines the collection of values for the loop to iterate over.
- */
+ /** Defines the collection of values for the loop to iterate over. */
@Parameter( required = true, principal = true )
private Collection<Object> source;
@@ -105,9 +103,7 @@
// @Persist
private int addedRowCount;
- /**
- * The current value, set before the component renders its body.
- */
+ /** The current value, set before the component renders its body. */
@SuppressWarnings( "unused" )
@Parameter
private Object value;
@@ -118,14 +114,12 @@
*/
@SuppressWarnings( "unused" )
@Parameter
- private boolean _volatile;
+ private boolean volatileLoop;
@Parameter( defaultPrefix = BindingConstants.PROP )
private ObjectCreatorDelegate objectCreatorDelegate;
- /**
- * The index into the source items.
- */
+ /** The index into the source items. */
@Parameter
private int index;
@@ -142,8 +136,8 @@
@SuppressWarnings( "unused" )
@Component( parameters = { "source=pagedSource", "elementName=prop:elementName", "value=inherit:value",
- "volatile=inherit:volatile", "encoder=inherit:encoder", "index=index",
- "additionalRowCount=inherit:additionalRowCount" } )
+ "volatile=inherit:volatile", "encoder=inherit:encoder", "index=index",
+ "additionalRowCount=inherit:additionalRowCount" } )
private Loop loop;
@Component( parameters = { "source=pagedSource", "rowsPerPage=rowsPerPage", "currentPage=currentPage" } )
@@ -196,16 +190,16 @@
{
private static final long serialVersionUID = 6727709013577574475L;
- private final String _addedRowCountHiddenName;
+ private final String addedRowCountHiddenName;
- public SetupAction ( String controlName )
+ public SetupAction( String controlName )
{
- _addedRowCountHiddenName = controlName;
+ addedRowCountHiddenName = controlName;
}
public void execute( JSPagedLoop component )
{
- component.setupAddedRowCountHiddenName( _addedRowCountHiddenName );
+ component.setupAddedRowCountHiddenName( addedRowCountHiddenName );
}
}
@@ -322,7 +316,7 @@
@SetupRender
Object setupRender()
{
- currentPage = 1;
+ currentPage = 1;
rowIds = new ArrayList<String>();
assignedClientId = renderSupport.allocateClientId( clientId );
@@ -339,7 +333,7 @@
if ( objectCreatorDelegate != null )
{
- for ( int i = 0; i < additionalRowCount; i++ )
+ for ( int i = 0; i < additionalRowCount ; i++ )
{
Object object = objectCreatorDelegate.createObject();
pagedSource.add( object );
@@ -405,7 +399,7 @@
if ( objectCreatorDelegate != null )
{
- for ( int i = 0; i < count && i < addedRowsList.size(); i++ )
+ for ( int i = 0; i < count && i < addedRowsList.size() ; i++ )
{
objectCreatorDelegate.addNewObject( addedRowsList.get( i ) );
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/JSPager.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -35,22 +35,18 @@
/**
* Equanda modification of {@link org.apache.tapestry5.corelib.components.GridPager}
- *
+ *
* @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
*/
@IncludeStylesheet( value = { "classpath:/org/equanda/tapestry5/resources/jspager.css" } )
@IncludeJavaScriptLibrary( value = { "classpath:/org/equanda/tapestry5/resources/jspager.js" } )
public class JSPager
{
- /**
- * The source of the data displayed by the JSPagedLoop
- */
+ /** The source of the data displayed by the JSPagedLoop */
@Parameter
private List<Object> source;
- /**
- * The number of rows displayed per page.
- */
+ /** The number of rows displayed per page. */
@Parameter
private int rowsPerPage;
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/TreeTable.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/TreeTable.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/TreeTable.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -115,7 +115,7 @@
int i = 0;
for ( Tree node : children )
{
- // TODO check if stopping recursion works.. we probably have to forsee equals and hashCode method on FlattenedTree
+ // TODO check if stopping recursion works.. probably needs equals and hashCode method on FlattenedTree
if ( !list.contains( node ) )
{
buildSourceList( list, node, depth + 1, dotId + "-" + i );
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Truncate.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Truncate.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/components/Truncate.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -34,7 +34,7 @@
/**
* Text Truncate Component
- *
+ *
* @author <a href="mailto:vla...@gm...">Vladimir Tkachenko</a>
*/
@IncludeJavaScriptLibrary( "classpath:/org/equanda/tapestry5/resources/truncate.js" )
@@ -43,40 +43,29 @@
public class Truncate
implements ClientElement
{
-
- /**
- * The text to be truncated
- */
+ /** The text to be truncated */
@Parameter( required = true, defaultPrefix = BindingConstants.PROP )
private String text;
- /**
- * The max length of the text
- */
+ /** The max length of the text */
@Parameter( defaultPrefix = BindingConstants.LITERAL )
private Integer length;
- /**
- * The suffix
- */
+ /** The suffix */
@Parameter( defaultPrefix = BindingConstants.LITERAL )
private String suffix;
- /**
- * Injects SymbolSource object
- */
+ /** Injects SymbolSource object */
@Inject
private SymbolSource symbolSource;
- /**
- * Injects TypeCoercer object
- */
+ /** Injects TypeCoercer object */
@Inject
private TypeCoercer typeCoercer;
/**
* Default binding for length parameter
- *
+ *
* @return default length
*/
public Integer defaultLength()
@@ -86,7 +75,7 @@
/**
* Default binding for suffix parameter
- *
+ *
* @return default suffix
*/
public String defaultSuffix()
@@ -94,9 +83,7 @@
return symbolSource.valueForSymbol( "equanda.truncate.default.suffix" );
}
- /**
- * Mixin that discards body rendering
- */
+ /** Mixin that discards body rendering */
@Mixin
@SuppressWarnings( "unused" )
private DiscardBody discardBody;
@@ -111,7 +98,7 @@
/**
* Truncates text to specified length
- *
+ *
* @return truncated text
*/
public String getTruncatedText()
@@ -133,9 +120,8 @@
/**
* Renders truncated text
- *
- * @param writer
- * MarkupWriter used to render truncated text tag
+ *
+ * @param writer MarkupWriter used to render truncated text tag
*/
@BeginRender
void doBeginRender( MarkupWriter writer )
@@ -143,16 +129,15 @@
String text = getTruncatedText();
if ( null == text ) text = "";
writer.element( resources.getElementName() != null ? resources.getElementName() : "span", "id",
- assignedClientId ).text( text );
+ assignedClientId ).text( text );
resources.renderInformalParameters( writer );
writer.end();
}
/**
* Renders full text tag
- *
- * @param writer
- * MarkupWriter used to render full text tag
+ *
+ * @param writer MarkupWriter used to render full text tag
*/
@AfterRender
void doAfterRender( MarkupWriter writer )
@@ -168,8 +153,8 @@
body = root.find( "body" );
}
}
- String[] args = new String[] { "class", "eqTrunCt", "id", assignedClientId + "_text",
- "style", "visibility: hidden; top: -1000px; left: 0;" };
+ String[] args = new String[]{ "class", "eqTrunCt", "id", assignedClientId + "_text",
+ "style", "visibility: hidden; top: -1000px; left: 0;" };
if ( body != null )
{
Element element = body.element( "div", args );
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/FlattenedTree.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/FlattenedTree.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/FlattenedTree.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -1,3 +1,27 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
package org.equanda.tapestry5.data;
/**
@@ -3,5 +27,5 @@
* This class is used by the TreeTable component to flatten a given Tree structure
* so that it can be represented in an html table.
- *
+ * <p/>
* A Tree is nested, an html table is flat and this class represent each node of the
* tree, but without nesting. The TreeTable component can then convert a Tree structure
@@ -10,35 +34,41 @@
* The FlattenedTree still remember the position of the node in the original tree in order
* to render the tree correctly in html (reference to javascript used
* by TreeTable component for details).
- *
+ *
* @author Geert Mergan
*/
-public class FlattenedTree implements java.io.Serializable {
-
+public class FlattenedTree
+ implements java.io.Serializable
+{
private Tree tree;
private String dotId;
private int depth;
- public FlattenedTree(Tree tree, int depth, String dotId) {
+ public FlattenedTree( Tree tree, int depth, String dotId )
+ {
super();
this.tree = tree;
this.dotId = dotId;
this.depth = depth;
}
- public Tree getTree() {
+ public Tree getTree()
+ {
return tree;
}
- public String getDotId() {
+ public String getDotId()
+ {
return dotId;
}
- public int getDepth() {
+ public int getDepth()
+ {
return depth;
}
- public boolean isLeaf() {
- return tree.isLeaf();
+ public boolean isLeaf()
+ {
+ return tree.isLeaf();
}
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/Tree.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/Tree.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/data/Tree.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -1,3 +1,27 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
package org.equanda.tapestry5.data;
import java.util.List;
@@ -5,16 +29,16 @@
/**
* This interface must be implemented by an object that must be rendered
* in a tapestry page using the TreeTable component.
- *
+ *
* @author Geert Mergan
*/
-public interface Tree {
+public interface Tree
+{
+ List<Tree> getChildren();
- public List<Tree> getChildren();
+ void setChildren( List<Tree> children );
- public void setChildren(List<Tree> children);
+ boolean isLeaf();
- public boolean isLeaf();
-
- public String getLabel();
+ String getLabel();
}
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java 2008-12-03 22:10:23 UTC (rev 897)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java 2008-12-04 08:34:54 UTC (rev 898)
@@ -44,8 +44,10 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-public class EquandaModule
+public final class EquandaModule
{
+ private EquandaModule() {}
+
public static void contributeComponentClassResolver( Configuration<LibraryMapping> configuration )
{
configuration.add( new LibraryMapping( "equanda", "org.equanda.tapestry5" ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|