From: <jbo...@li...> - 2005-12-18 15:35:23
|
Author: wrzep Date: 2005-12-18 10:35:18 -0500 (Sun, 18 Dec 2005) New Revision: 1847 Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Columns.java trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java Log: comments, minor code improvments http://jira.jboss.com/jira/browse/JBLAB-415 Pawel Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Columns.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Columns.java 2005-12-18 15:18:30 UTC (rev 1846) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Columns.java 2005-12-18 15:35:18 UTC (rev 1847) @@ -23,7 +23,6 @@ package org.jboss.forge.status; import java.util.ArrayList; -import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Set; @@ -39,12 +38,21 @@ /** * @author Pawel Wrzeszcz +* A class holding column information about columns on the one page to display. */ public class Columns { - List<Column> columns; - Projects projects; + /** Status Matrix Columns list (Column order matters) */ + private List<Column> columns; + /** Projects present in the Status Matrix */ + private Projects projects; + + /** + * @param pageRoot root Node specfying Columns to display + * @param plugins Plugins used by Columns + * @param projects Projects present in the Status Matrix + */ public Columns(Node pageRoot, Plugins plugins, Projects projects) { this.projects = projects; @@ -66,11 +74,21 @@ } } + /** + * Fills the given context with columns information + * + * @param context DelegateContext to fill + */ public void fillContext(DelegateContext context) { fillColumnsNames(context); fillValues(context); } + /** + * Fills the given context with column names + * + * @param context DelegateContext to fill + */ private void fillColumnsNames(DelegateContext context) { for (Iterator iter = columns.iterator(); iter.hasNext();) { @@ -83,7 +101,11 @@ } } - /** Fills the context with appropiate values (from each column) for each project. */ + /** Fills the given context with the cell values + * (for each column and for each project). + * + * @param context DelegateContext to fill + */ private void fillValues(DelegateContext context) { Set<String> projectIds = projects.getProjectIds( @@ -95,10 +117,20 @@ position++; DelegateContext projectContext = context.next("project"); + fillProjectContext(projectContext, projectId, position); + fillEntries(projectContext, projectId); } + //TODO sorting } + /** + * Fills the given context with the project informationcell value + * + * @param projectContext DelegateContext to fill + * @param projectId project id + * @param position Project posistion in the Status Matrix + */ private void fillProjectContext(DelegateContext projectContext, String projectId, int position) { @@ -106,11 +138,16 @@ projectContext.put("name", projects.getProjectName(projectId)); projectContext.put("link", projects.getProjectLink(projectId)); - - fillEntries(projectContext, columns, projectId); } - private void fillEntries(DelegateContext projectContext, Collection<Column> columns, String projectId) { + /** + * Fills the given context with the cells information in the project row + * + * @param projectId specifies project row + * @param projectContext DelegateContext to fill + */ + private void fillEntries(DelegateContext projectContext, String projectId) { + for (Iterator iter = columns.iterator(); iter.hasNext();) { Column column = (Column) iter.next(); Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2005-12-18 15:18:30 UTC (rev 1846) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2005-12-18 15:35:18 UTC (rev 1847) @@ -74,7 +74,7 @@ /** * Fills the given context with the Status Matrix information. * - * @param context Context to fill. + * @param context DelegateContext to fill. */ public void fillContext(DelegateContext context) { mainPageColumns.fillContext(context); |