You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2006/03/11 21:55:35 UTC
svn commit: r385164 [7/32] - in /jakarta/tapestry/trunk: ./ .settings/
annotations/src/java/org/apache/tapestry/annotations/
annotations/src/test/org/apache/tapestry/annotations/ config/
contrib/src/documentation/content/xdocs/tapestry-contrib/Componen...
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableColumn.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableColumn.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableColumn.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableColumn.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -25,23 +25,22 @@
*/
public class TreeTableColumn extends SimpleTableColumn
{
+ private static final long serialVersionUID = -8046804468741132535L;
- private static final long serialVersionUID = -8046804468741132535L;
-
- public TreeTableColumn(String arg0, boolean arg1, ComponentAddress objComponentAddress)
- {
- super(arg0, arg1);
- setValueRendererSource(new TreeTableValueRenderSource(objComponentAddress));
- }
-
- /**
- * @see org.apache.tapestry.contrib.table.model.common.AbstractTableColumn#getValueRenderer(org.apache.tapestry.IRequestCycle,
- * org.apache.tapestry.contrib.table.model.ITableModelSource,
- * java.lang.Object)
- */
- public IRender getValueRenderer(IRequestCycle arg0, ITableModelSource arg1, Object arg2)
- {
- return super.getValueRenderer(arg0, arg1, arg2);
- }
+ /**
+ * @param arg0
+ * @param arg1
+ */
+ public TreeTableColumn(String arg0, boolean arg1, ComponentAddress objComponentAddress) {
+ super(arg0, arg1);
+ setValueRendererSource(new TreeTableValueRenderSource(objComponentAddress));
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.table.model.common.AbstractTableColumn#getValueRenderer(org.apache.tapestry.IRequestCycle, org.apache.tapestry.contrib.table.model.ITableModelSource, java.lang.Object)
+ */
+ public IRender getValueRenderer(IRequestCycle arg0, ITableModelSource arg1, Object arg2) {
+ return super.getValueRenderer(arg0, arg1, arg2);
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableDataView.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableDataView.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableDataView.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableDataView.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -38,9 +38,9 @@
/**
*/
-public abstract class TreeTableDataView extends BaseComponent implements ITreeRowSource, PageDetachListener
+public abstract class TreeTableDataView extends BaseComponent implements ITreeRowSource,
+ PageDetachListener
{
-
private int m_nTreeDeep = -1;
private TreeRowObject m_objTreeRowObject = null;
@@ -73,7 +73,7 @@
public ITreeModelSource getTreeModelSource()
{
- ITreeModelSource objSource = (ITreeModelSource)getPage().getRequestCycle().getAttribute(
+ ITreeModelSource objSource = (ITreeModelSource) getPage().getRequestCycle().getAttribute(
ITreeModelSource.TREE_MODEL_SOURCE_ATTRIBUTE);
return objSource == null ? getTreeViewParameter() : objSource;
@@ -94,27 +94,46 @@
Object objRootUID = objTreeDataModel.getUniqueKey(objRoot, null);
if (getShowRootNode())
{
- walkTree(arrAllExpandedNodes, objRoot, objRootUID, 0, objTreeModel, TreeRowObject.FIRST_LAST_ROW,
- new int[0], true);
+ walkTree(
+ arrAllExpandedNodes,
+ objRoot,
+ objRootUID,
+ 0,
+ objTreeModel,
+ TreeRowObject.FIRST_LAST_ROW,
+ new int[0],
+ true);
}
else
{
int nChildenCount = objTreeModel.getTreeDataModel().getChildCount(objRoot);
- int nRowPossiotionType = nChildenCount == 1 ? TreeRowObject.FIRST_LAST_ROW : TreeRowObject.FIRST_ROW;
+ int nRowPossiotionType = nChildenCount == 1 ? TreeRowObject.FIRST_LAST_ROW
+ : TreeRowObject.FIRST_ROW;
boolean bFirst = true;
- for(Iterator iter = objTreeModel.getTreeDataModel().getChildren(objRoot); iter.hasNext();)
+ for (Iterator iter = objTreeModel.getTreeDataModel().getChildren(objRoot); iter
+ .hasNext();)
{
Object objChild = iter.next();
- Object objChildUID = objTreeModel.getTreeDataModel().getUniqueKey(objChild, objRoot);
+ Object objChildUID = objTreeModel.getTreeDataModel().getUniqueKey(
+ objChild,
+ objRoot);
boolean bChildLast = !iter.hasNext();
if (!bFirst)
{
if (bChildLast)
nRowPossiotionType = TreeRowObject.LAST_ROW;
- else nRowPossiotionType = TreeRowObject.MIDDLE_ROW;
+ else
+ nRowPossiotionType = TreeRowObject.MIDDLE_ROW;
}
- walkTree(arrAllExpandedNodes, objChild, objChildUID, 0, objTreeModel, nRowPossiotionType,
- new int[0], bChildLast);
+ walkTree(
+ arrAllExpandedNodes,
+ objChild,
+ objChildUID,
+ 0,
+ objTreeModel,
+ nRowPossiotionType,
+ new int[0],
+ bChildLast);
bFirst = false;
}
}
@@ -125,15 +144,16 @@
return m_arrAllExpandedNodes;
}
- public void walkTree(ArrayList arrAllExpandedNodes, Object objParent, Object objParentUID, int nDepth,
- ITreeModel objTreeModel, int nRowPossiotionType, int[] arrConnectImages, boolean bLast)
+ public void walkTree(ArrayList arrAllExpandedNodes, Object objParent, Object objParentUID,
+ int nDepth, ITreeModel objTreeModel, int nRowPossiotionType, int[] arrConnectImages,
+ boolean bLast)
{
m_nTreeDeep = nDepth;
int nNumberOfChildren = objTreeModel.getTreeDataModel().getChildCount(objParent);
boolean bLeaf = (nNumberOfChildren == 0) ? true : false;
- TreeRowObject objTreeRowObject = new TreeRowObject(objParent, objParentUID, nDepth, bLeaf, nRowPossiotionType,
- arrConnectImages);
+ TreeRowObject objTreeRowObject = new TreeRowObject(objParent, objParentUID, nDepth, bLeaf,
+ nRowPossiotionType, arrConnectImages);
arrAllExpandedNodes.add(objTreeRowObject);
boolean bContain = objTreeModel.getTreeStateModel().isUniqueKeyExpanded(objParentUID);
@@ -143,18 +163,29 @@
System.arraycopy(arrConnectImages, 0, arrConnectImagesNew, 0, arrConnectImages.length);
if (bLast)
arrConnectImagesNew[arrConnectImagesNew.length - 1] = TreeRowObject.EMPTY_CONN_IMG;
- else arrConnectImagesNew[arrConnectImagesNew.length - 1] = TreeRowObject.LINE_CONN_IMG;
+ else
+ arrConnectImagesNew[arrConnectImagesNew.length - 1] = TreeRowObject.LINE_CONN_IMG;
Iterator colChildren = objTreeModel.getTreeDataModel().getChildren(objParent);
- for(Iterator iter = colChildren; iter.hasNext();)
+ for (Iterator iter = colChildren; iter.hasNext();)
{
Object objChild = iter.next();
- Object objChildUID = objTreeModel.getTreeDataModel().getUniqueKey(objChild, objParentUID);
+ Object objChildUID = objTreeModel.getTreeDataModel().getUniqueKey(
+ objChild,
+ objParentUID);
boolean bChildLast = !iter.hasNext();
if (bChildLast)
nRowPossiotionType = TreeRowObject.LAST_ROW;
- else nRowPossiotionType = TreeRowObject.MIDDLE_ROW;
- walkTree(arrAllExpandedNodes, objChild, objChildUID, nDepth + 1, objTreeModel, nRowPossiotionType,
- arrConnectImagesNew, bChildLast);
+ else
+ nRowPossiotionType = TreeRowObject.MIDDLE_ROW;
+ walkTree(
+ arrAllExpandedNodes,
+ objChild,
+ objChildUID,
+ nDepth + 1,
+ objTreeModel,
+ nRowPossiotionType,
+ arrConnectImagesNew,
+ bChildLast);
}
}
}
@@ -170,8 +201,8 @@
}
/*
- * public ITableModel getTableModel() { if(m_objTableModel == null){
- * m_objTableModel = createTableModel(); } return m_objTableModel; }
+ * public ITableModel getTableModel() { if(m_objTableModel == null){ m_objTableModel =
+ * createTableModel(); } return m_objTableModel; }
*/
public ITableModel getTableModel()
{
@@ -184,7 +215,8 @@
Object[] arrAllExpandedNodes = new Object[arrAllNodes.size()];
arrAllNodes.toArray(arrAllExpandedNodes);
- SimpleTableModel objTableModel = new SimpleTableModel(arrAllExpandedNodes, getTableColunms());
+ SimpleTableModel objTableModel = new SimpleTableModel(arrAllExpandedNodes,
+ getTableColunms());
objTableModel.getPagingState().setPageSize(getEntriesPerTablePage());
return objTableModel;
@@ -196,7 +228,8 @@
arrColumnsList.add(new TreeTableColumn("Name", false, null));
List arrTableColunms = getTableColumnsParameter();
- if (arrTableColunms != null) arrColumnsList.addAll(arrTableColunms);
+ if (arrTableColunms != null)
+ arrColumnsList.addAll(arrTableColunms);
ITableColumn[] arrColumns = new ITableColumn[arrColumnsList.size()];
arrColumnsList.toArray(arrColumns);
@@ -220,8 +253,8 @@
{
SimpleListTableDataModel objDataModel = new SimpleListTableDataModel(generateNodeList());
SimpleTableColumnModel objColumnModel = new SimpleTableColumnModel(getTableColunms());
- SimpleTableSessionStateManager objStateManager = new SimpleTableSessionStateManager(objDataModel,
- objColumnModel);
+ SimpleTableSessionStateManager objStateManager = new SimpleTableSessionStateManager(
+ objDataModel, objColumnModel);
return objStateManager;
// return NullTableSessionStateManager.NULL_STATE_MANAGER;
}
@@ -232,7 +265,8 @@
*/
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
- Object objExistedTreeModelSource = cycle.getAttribute(ITreeRowSource.TREE_ROW_SOURCE_ATTRIBUTE);
+ Object objExistedTreeModelSource = cycle
+ .getAttribute(ITreeRowSource.TREE_ROW_SOURCE_ATTRIBUTE);
cycle.setAttribute(ITreeRowSource.TREE_ROW_SOURCE_ATTRIBUTE, this);
super.renderComponent(writer, cycle);
@@ -246,7 +280,8 @@
*/
public void renderBody(IMarkupWriter writer, IRequestCycle cycle)
{
- Object objExistedTreeModelSource = cycle.getAttribute(ITreeRowSource.TREE_ROW_SOURCE_ATTRIBUTE);
+ Object objExistedTreeModelSource = cycle
+ .getAttribute(ITreeRowSource.TREE_ROW_SOURCE_ATTRIBUTE);
cycle.setAttribute(ITreeRowSource.TREE_ROW_SOURCE_ATTRIBUTE, this);
super.renderBody(writer, cycle);
@@ -265,4 +300,4 @@
}
public abstract boolean getShowRootNode();
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableNodeViewDelegator.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableNodeViewDelegator.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableNodeViewDelegator.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableNodeViewDelegator.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,22 +23,23 @@
/**
* @author ceco
*/
-public abstract class TreeTableNodeViewDelegator extends BaseComponent implements ITableRendererListener
-{
+public abstract class TreeTableNodeViewDelegator extends BaseComponent implements ITableRendererListener{
- public TreeTableNodeViewDelegator()
- {
-
- }
-
- /**
- * @see org.apache.tapestry.contrib.table.model.ITableRendererListener#initializeRenderer(org.apache.tapestry.IRequestCycle,
- * org.apache.tapestry.contrib.table.model.ITableModelSource,
- * org.apache.tapestry.contrib.table.model.ITableColumn,
- * java.lang.Object)
- */
- public void initializeRenderer(IRequestCycle arg0, ITableModelSource arg1, ITableColumn arg2, Object arg3)
- {
- }
+ /**
+ *
+ */
+ public TreeTableNodeViewDelegator() {
+ super();
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.table.model.ITableRendererListener#initializeRenderer(org.apache.tapestry.IRequestCycle, org.apache.tapestry.contrib.table.model.ITableModelSource, org.apache.tapestry.contrib.table.model.ITableColumn, java.lang.Object)
+ */
+ public void initializeRenderer(
+ IRequestCycle arg0,
+ ITableModelSource arg1,
+ ITableColumn arg2,
+ Object arg3) {
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableValueRenderSource.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableValueRenderSource.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableValueRenderSource.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/components/table/TreeTableValueRenderSource.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -27,42 +27,53 @@
*/
public class TreeTableValueRenderSource implements ITableRendererSource
{
-
- private static final long serialVersionUID = 3237638859391458116L;
-
- private ComponentTableRendererSource m_objComponentRenderer;
- private ComponentAddress m_objComponentAddress = null;
-
- public TreeTableValueRenderSource()
- {
- m_objComponentRenderer = null;
- }
-
- public TreeTableValueRenderSource(ComponentAddress objComponentAddress)
- {
- m_objComponentAddress = objComponentAddress;
- }
-
- /**
- * @see org.apache.tapestry.contrib.table.model.ITableRendererSource#getRenderer(IRequestCycle,
- * ITableModelSource, ITableColumn, Object)
- */
- public IRender getRenderer(IRequestCycle objCycle, ITableModelSource objSource, ITableColumn objColumn,
- Object objRow)
- {
- synchronized(this)
- {
- if (m_objComponentRenderer == null)
- {
-
- ComponentAddress objAddress = m_objComponentAddress;
- if (m_objComponentAddress == null)
- objAddress = new ComponentAddress("contrib:TreeTableNodeViewPage", "treeTableNodeViewDelegator");
- m_objComponentRenderer = new ComponentTableRendererSource(objAddress);
- }
- }
-
- return m_objComponentRenderer.getRenderer(objCycle, objSource, objColumn, objRow);
- }
+ private static final long serialVersionUID = 3237638859391458116L;
+
+ private ComponentTableRendererSource m_objComponentRenderer;
+ private ComponentAddress m_objComponentAddress = null;
+
+ public TreeTableValueRenderSource()
+ {
+ m_objComponentRenderer = null;
+ }
+
+ public TreeTableValueRenderSource(ComponentAddress objComponentAddress)
+ {
+ m_objComponentAddress = objComponentAddress;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.table.model.ITableRendererSource#getRenderer(IRequestCycle, ITableModelSource, ITableColumn, Object)
+ */
+ public IRender getRenderer(
+ IRequestCycle objCycle,
+ ITableModelSource objSource,
+ ITableColumn objColumn,
+ Object objRow)
+ {
+ if (m_objComponentRenderer == null)
+ {
+ synchronized (this)
+ {
+ if (m_objComponentRenderer == null)
+ {
+
+ ComponentAddress objAddress = m_objComponentAddress;
+ if(m_objComponentAddress == null)
+ objAddress = new ComponentAddress(
+ "contrib:TreeTableNodeViewPage",
+ "treeTableNodeViewDelegator");
+ m_objComponentRenderer =
+ new ComponentTableRendererSource(objAddress);
+ }
+ }
+ }
+
+ return m_objComponentRenderer.getRenderer(
+ objCycle,
+ objSource,
+ objColumn,
+ objRow);
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ISessionStoreManager.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ISessionStoreManager.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ISessionStoreManager.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ISessionStoreManager.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,10 +20,7 @@
* @author ceco
*/
-public interface ISessionStoreManager
-{
-
- Object getSessionState(IPage objPage, String strSessionStateID);
-
- Object setSessionState(IPage objPage, String strSessionStateID, Object objSessionState);
+public interface ISessionStoreManager {
+ Object getSessionState(IPage objPage, String strSessionStateID);
+ Object setSessionState(IPage objPage, String strSessionStateID, Object objSessionState);
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeDataModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeDataModel.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeDataModel.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeDataModel.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,76 +17,56 @@
import java.util.Iterator;
/**
- * The interface that defines a suitable data model for a
- * <code>TreeView component</code>.
+ * The interface that defines a suitable data model for a <code>TreeView component</code>.
*
* @author ceco
*/
public interface ITreeDataModel
{
-
- /**
- * Returns the root node of the tree.
- */
- Object getRoot();
-
- /**
- * Returns the number of children of parent node.
- *
- * @param objParent
- * is the parent object whose nr of children are sought
- */
- int getChildCount(Object objParent);
-
- /**
- * Get an iterator to the Collection of children belonging to the parent
- * node object.
- *
- * @param objParent
- * is the parent object whose children are requested
- */
- Iterator getChildren(Object objParent);
-
- /**
- * Get the actual node object based on some identifier (for example an UUID).
- *
- * @param objUniqueKey
- * is the unique identifier of the node object being retrieved
- * @return the instance of the node object identified by the key
- */
- Object getObject(Object objUniqueKey);
-
- /**
- * Get the unique identifier (UUID) of the node object with a certain parent
- * node.
- *
- * @param objTarget
- * is the Object whose identifier is required
- * @param objParentUniqueKey
- * is the unique id of the parent of objTarget
- * @return the unique identifier of objTarget
- */
- Object getUniqueKey(Object objTarget, Object objParentUniqueKey);
-
- /**
- * Get the unique identifier of the parent of an object.
- *
- * @param objChildUniqueKey
- * is the identifier of the Object for which the parent
- * identifier is sought
- * @return the identifier (possibly UUID) of the parent of objChildUniqueKey
- */
- Object getParentUniqueKey(Object objChildUniqueKey);
-
- /**
- * Check to see (on the basis of some node object identifier) whether the
- * parent node is indeed the parent of the object.
- *
- * @param objChildUniqueKey
- * is the identifier of the object whose parent is being checked
- * @param objParentUniqueKey
- * is the identifier of the parent which is to be checked against
- */
- boolean isAncestorOf(Object objChildUniqueKey, Object objParentUniqueKey);
-
+ /**
+ * Returns the root node of the tree
+ */
+ Object getRoot();
+
+ /**
+ * Returns the number of children of parent node.
+ * @param objParent is the parent object whose nr of children are sought
+ */
+ int getChildCount(Object objParent);
+
+ /**
+ * Get an iterator to the Collection of children belonging to the parent node object
+ * @param objParent is the parent object whose children are requested
+ */
+ Iterator getChildren(Object objParent);
+
+ /**
+ * Get the actual node object based on some identifier (for example an UUID)
+ * @param objUniqueKey is the unique identifier of the node object being retrieved
+ * @return the instance of the node object identified by the key
+ */
+ Object getObject(Object objUniqueKey);
+
+ /**
+ * Get the unique identifier (UUID) of the node object with a certain parent node
+ * @param objTarget is the Object whose identifier is required
+ * @param objParentUniqueKey is the unique id of the parent of objTarget
+ * @return the unique identifier of objTarget
+ */
+ Object getUniqueKey(Object objTarget, Object objParentUniqueKey);
+
+ /**
+ * Get the unique identifier of the parent of an object
+ * @param objChildUniqueKey is the identifier of the Object for which the parent identifier is sought
+ * @return the identifier (possibly UUID) of the parent of objChildUniqueKey
+ */
+ Object getParentUniqueKey(Object objChildUniqueKey);
+
+ /**
+ * Check to see (on the basis of some node object identifier) whether the parent node is indeed the parent of the object
+ * @param objChildUniqueKey is the identifier of the object whose parent is being checked
+ * @param objParentUniqueKey is the identifier of the parent which is to be checked against
+ */
+ boolean isAncestorOf(Object objChildUniqueKey, Object objParentUniqueKey);
+
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeModel.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeModel.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeModel.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,10 +17,7 @@
/**
* @author ceco
*/
-public interface ITreeModel
-{
-
- ITreeDataModel getTreeDataModel();
-
- ITreeStateModel getTreeStateModel();
+public interface ITreeModel {
+ ITreeDataModel getTreeDataModel();
+ ITreeStateModel getTreeStateModel();
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeModelSource.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeModelSource.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeModelSource.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeModelSource.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -21,11 +21,9 @@
*/
public interface ITreeModelSource extends IComponent
{
+ final static String TREE_MODEL_SOURCE_ATTRIBUTE = "org.apache.tapestry.contrib.tree.model.ITreeModelSource";
- String TREE_MODEL_SOURCE_ATTRIBUTE = "org.apache.tapestry.contrib.tree.model.ITreeModelSource";
-
- ITreeModel getTreeModel();
-
- ITreeStateListener getTreeStateListener();
+ ITreeModel getTreeModel();
+ ITreeStateListener getTreeStateListener();
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeNode.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeNode.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeNode.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeNode.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,9 +23,9 @@
public interface ITreeNode extends Serializable
{
-
+
/**
- * Returns the <code>Collection</code> of children.
+ * Returns the <code>Collection</code> of children.
*/
Collection getChildren();
@@ -41,8 +41,7 @@
ITreeNode getParent();
/**
- * Returns the true if current node contains received children, otherwise
- * return false.
+ * Returns the true if current node contains received children, otherwise return false;
*/
boolean containsChild(ITreeNode node);
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeNodeManager.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeNodeManager.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeNodeManager.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeNodeManager.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,8 +20,6 @@
/**
* @author ceco
*/
-public interface ITreeNodeManager
-{
-
- IRender getRenderer(Object objUniqueKey, ITreeComponent objTreeComponent);
+public interface ITreeNodeManager {
+ IRender getRenderer(Object objUniqueKey, ITreeComponent objTreeComponent);
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeRowSource.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeRowSource.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeRowSource.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeRowSource.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,20 +15,21 @@
package org.apache.tapestry.contrib.tree.model;
/**
- * A Tapestry component that provides the current row value. This interface is
- * used for obtaining the row source by components wrapped by the row source
+ * A Tapestry component that provides the current row value.
+ * This interface is used for obtaining the row source by components
+ * wrapped by the row source
*
* @author tsvetelin
*/
public interface ITreeRowSource
{
-
- String TREE_ROW_SOURCE_ATTRIBUTE = "org.apache.tapestry.contrib.tree.model.ITreeRowSource";
-
- /**
- * Method getTreeRow.
- *
- * @return Object the current tree row object.
- */
- TreeRowObject getTreeRow();
+ final static String TREE_ROW_SOURCE_ATTRIBUTE = "org.apache.tapestry.contrib.tree.model.ITreeRowSource";
+
+ /**
+ * Method getTreeRow
+ * @return Object the current tree row object.
+ */
+ TreeRowObject getTreeRow();
+ //Object getTreeRowNodeUID();
+ //int getTreeNodeDeep();
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeSessionStateManager.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeSessionStateManager.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeSessionStateManager.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeSessionStateManager.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,13 +14,12 @@
package org.apache.tapestry.contrib.tree.model;
+
+
/**
* @author ceco
*/
-public interface ITreeSessionStateManager
-{
-
- Object getSessionState(ITreeModel objModel);
-
- ITreeModel getModel(Object objSessionState);
+public interface ITreeSessionStateManager {
+ Object getSessionState(ITreeModel objModel);
+ ITreeModel getModel(Object objSessionState);
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeStateListener.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeStateListener.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeStateListener.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeStateListener.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,8 +17,6 @@
/**
* @author ceco
*/
-public interface ITreeStateListener
-{
-
- void treeStateChanged(TreeStateEvent objEvent);
+public interface ITreeStateListener {
+ void treeStateChanged(TreeStateEvent objEvent);
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeStateModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeStateModel.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeStateModel.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/ITreeStateModel.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,27 +20,20 @@
* @author ceco
*/
-public interface ITreeStateModel
-{
-
- Set getExpandSelection();
-
- /*
- * Return the selected node unique key
- */
- Object getSelectedNode();
-
- void setSelectedNode(Object objUniqueKey);
-
- void expand(Object objUniqueKey);
-
- void expandPath(Object objUniqueKey);
-
- void collapse(Object objUniqueKey);
-
- void collapsePath(Object objUniqueKey);
-
- boolean isUniqueKeyExpanded(Object objUniqueKey);
-
- void resetState();
+public interface ITreeStateModel {
+ Set getExpandSelection();
+ /*
+ * Return the selected node unique key
+ */
+ Object getSelectedNode();
+ public void setSelectedNode(Object objUniqueKey);
+
+ void expand(Object objUniqueKey);
+ void expandPath(Object objUniqueKey);
+ void collapse(Object objUniqueKey);
+ void collapsePath(Object objUniqueKey);
+
+ boolean isUniqueKeyExpanded(Object objUniqueKey);
+
+ void resetState();
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/TreeRowObject.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/TreeRowObject.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/TreeRowObject.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/TreeRowObject.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,72 +17,60 @@
/**
* @author ceco
*/
-public class TreeRowObject
-{
+public class TreeRowObject {
+ public static final int FIRST_ROW = 1;
+ public static final int MIDDLE_ROW = 2;
+ public static final int LAST_ROW = 3;
+ public static final int FIRST_LAST_ROW = 4;
- public static final int FIRST_ROW = 1;
- public static final int MIDDLE_ROW = 2;
- public static final int LAST_ROW = 3;
- public static final int FIRST_LAST_ROW = 4;
-
- public static final int EMPTY_CONN_IMG = 1;
- public static final int LINE_CONN_IMG = 2;
+ public static final int EMPTY_CONN_IMG = 1;
+ public static final int LINE_CONN_IMG = 2;
private Object m_objTreeNode = null;
- private Object m_objTreeNodeUID = null;
- private int m_nTreeRowDepth;
- private boolean m_bLeaf = false;
- private int m_nTreeRowPossiotionType = MIDDLE_ROW;
- private int[] m_nLineConnImages;
-
- public TreeRowObject(Object objTreeNode, Object objTreeNodeUID, int nTreeRowDepth, boolean bLeaf,
- int nTreeRowPossiotionType, int[] nLineConnImages)
- {
- super();
- m_objTreeNode = objTreeNode;
- m_objTreeNodeUID = objTreeNodeUID;
- m_nTreeRowDepth = nTreeRowDepth;
- m_bLeaf = bLeaf;
- m_nTreeRowPossiotionType = nTreeRowPossiotionType;
- m_nLineConnImages = nLineConnImages;
- }
-
- public Object getTreeNode()
- {
- return m_objTreeNode;
- }
-
- public Object getTreeNodeUID()
- {
- return m_objTreeNodeUID;
- }
-
- public int getTreeRowDepth()
- {
- return m_nTreeRowDepth;
- }
-
- /**
- * @return Returns the leaf.
- */
- public boolean getLeaf()
- {
- return m_bLeaf;
- }
-
- /**
- * @return Returns the treeRowPossiotionType.
- */
- public int getTreeRowPossiotionType()
- {
- return m_nTreeRowPossiotionType;
- }
-
- /**
- * @return Returns the lineConnImages.
- */
- public int[] getLineConnImages()
- {
- return m_nLineConnImages;
- }
+ private Object m_objTreeNodeUID = null;
+ private int m_nTreeRowDepth;
+ private boolean m_bLeaf = false;
+ private int m_nTreeRowPossiotionType = MIDDLE_ROW;
+ private int[] m_nLineConnImages;
+
+ public TreeRowObject(Object objTreeNode, Object objTreeNodeUID, int nTreeRowDepth, boolean bLeaf, int nTreeRowPossiotionType, int[] nLineConnImages) {
+ super();
+ m_objTreeNode = objTreeNode;
+ m_objTreeNodeUID = objTreeNodeUID;
+ m_nTreeRowDepth = nTreeRowDepth;
+ m_bLeaf = bLeaf;
+ m_nTreeRowPossiotionType = nTreeRowPossiotionType;
+ m_nLineConnImages = nLineConnImages;
+ }
+
+ public Object getTreeNode() {
+ return m_objTreeNode;
+ }
+
+ public Object getTreeNodeUID() {
+ return m_objTreeNodeUID;
+ }
+
+ public int getTreeRowDepth() {
+ return m_nTreeRowDepth;
+ }
+
+ /**
+ * @return Returns the leaf.
+ */
+ public boolean getLeaf() {
+ return m_bLeaf;
+ }
+ /**
+ * @return Returns the treeRowPossiotionType.
+ */
+ public int getTreeRowPossiotionType() {
+ return m_nTreeRowPossiotionType;
+ }
+ /**
+ * @return Returns the lineConnImages.
+ */
+ public int[] getLineConnImages() {
+ return m_nLineConnImages;
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/TreeStateEvent.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/TreeStateEvent.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/TreeStateEvent.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/model/TreeStateEvent.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,50 +17,42 @@
/**
* @author ceco
*/
-public class TreeStateEvent
-{
-
- public static final int SELECTED_NODE_CHANGED = 1;
- public static final int NODE_EXPANDED = 2;
- public static final int NODE_COLLAPSED = 4;
-
- private int m_nEventType;
- private transient ITreeStateModel m_objTreeStateModel = null;
- private transient Object m_objNodeUID = null;
-
- /**
- * Constructor for TreeStateEvent.
- */
- public TreeStateEvent(int nEventType, Object objNodeUID, ITreeStateModel objTreeStateModel)
- {
- super();
- m_nEventType = nEventType;
- m_objNodeUID = objNodeUID;
- m_objTreeStateModel = objTreeStateModel;
- }
-
- /**
- * Returns the EventType.
- *
- * @return int
- */
- public int getEventType()
- {
- return m_nEventType;
- }
-
- public boolean isEvent(int nEventType)
- {
- return (getEventType() & nEventType) > 0;
- }
-
- public Object getNodeUID()
- {
- return m_objNodeUID;
- }
-
- public ITreeStateModel getTreeStateModel()
- {
- return m_objTreeStateModel;
- }
+public class TreeStateEvent {
+ public static final int SELECTED_NODE_CHANGED = 1;
+ public static final int NODE_EXPANDED = 2;
+ public static final int NODE_COLLAPSED = 4;
+
+ private int m_nEventType;
+ private transient ITreeStateModel m_objTreeStateModel = null;
+ private transient Object m_objNodeUID = null;
+
+ /**
+ * Constructor for TreeStateEvent.
+ */
+ public TreeStateEvent(int nEventType, Object objNodeUID, ITreeStateModel objTreeStateModel) {
+ super();
+ m_nEventType = nEventType;
+ m_objNodeUID = objNodeUID;
+ m_objTreeStateModel = objTreeStateModel;
+ }
+
+ /**
+ * Returns the EventType.
+ * @return int
+ */
+ public int getEventType() {
+ return m_nEventType;
+ }
+
+ public boolean isEvent(int nEventType){
+ return (getEventType() & nEventType) > 0;
+ }
+
+ public Object getNodeUID() {
+ return m_objNodeUID;
+ }
+
+ public ITreeStateModel getTreeStateModel() {
+ return m_objTreeStateModel;
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/FullTreeSessionStateManager.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/FullTreeSessionStateManager.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/FullTreeSessionStateManager.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/FullTreeSessionStateManager.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,31 +20,27 @@
/**
* @author ceco
*/
-public class FullTreeSessionStateManager implements ITreeSessionStateManager
-{
+public class FullTreeSessionStateManager implements ITreeSessionStateManager {
- /**
- * Constructor for FullTreeSessionStateManager.
- */
- public FullTreeSessionStateManager()
- {
- super();
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeSessionStateManager#getSessionState(ITreeModel)
- */
- public Object getSessionState(ITreeModel objModel)
- {
- return objModel;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeSessionStateManager#getModel(Object)
- */
- public ITreeModel getModel(Object objSessionState)
- {
- return (ITreeModel)objSessionState;
- }
+ /**
+ * Constructor for FullTreeSessionStateManager.
+ */
+ public FullTreeSessionStateManager() {
+ super();
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeSessionStateManager#getSessionState(ITreeModel)
+ */
+ public Object getSessionState(ITreeModel objModel) {
+ return objModel;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeSessionStateManager#getModel(Object)
+ */
+ public ITreeModel getModel(Object objSessionState) {
+ return (ITreeModel)objSessionState;
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/NullSessionStateManager.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/NullSessionStateManager.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/NullSessionStateManager.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/NullSessionStateManager.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,31 +20,27 @@
/**
* @author ceco
*/
-public class NullSessionStateManager implements ITreeSessionStateManager
-{
+public class NullSessionStateManager implements ITreeSessionStateManager {
- /**
- * Constructor for NullSessionStateManager.
- */
- public NullSessionStateManager()
- {
- super();
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeSessionStateManager#getSessionState(ITreeModel)
- */
- public Object getSessionState(ITreeModel objModel)
- {
- return null;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeSessionStateManager#getModel(Object)
- */
- public ITreeModel getModel(Object objSessionState)
- {
- return null;
- }
+ /**
+ * Constructor for NullSessionStateManager.
+ */
+ public NullSessionStateManager() {
+ super();
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeSessionStateManager#getSessionState(ITreeModel)
+ */
+ public Object getSessionState(ITreeModel objModel) {
+ return null;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeSessionStateManager#getModel(Object)
+ */
+ public ITreeModel getModel(Object objSessionState) {
+ return null;
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleNodeRenderFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleNodeRenderFactory.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleNodeRenderFactory.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleNodeRenderFactory.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,25 +23,32 @@
/**
* @author ceco
*/
-public class SimpleNodeRenderFactory implements INodeRenderFactory
-{
+public class SimpleNodeRenderFactory implements INodeRenderFactory {
-
- /**
- * @see INodeRenderFactory#getRender
- */
- public IRender getRenderByID(Object objUniqueKey, ITreeModelSource objTreeModelSource, IRequestCycle cycle)
- {
- Object objValue = objTreeModelSource.getTreeModel().getTreeDataModel().getObject(objUniqueKey);
- return getRender(objValue, objTreeModelSource, cycle);
- }
-
- /**
- * @see INodeRenderFactory#getRender
- */
- public IRender getRender(Object objValue, ITreeModelSource objTreeModelSource, IRequestCycle objCycle)
- {
- return new RenderString(objValue.toString());
- }
+ /**
+ * Constructor for SimpleNodeRenderFactory.
+ */
+ public SimpleNodeRenderFactory() {
+ super();
+ }
+
+ /**
+ * @see INodeRenderFactory#getRender
+ */
+ public IRender getRenderByID(
+ Object objUniqueKey,
+ ITreeModelSource objTreeModelSource,
+ IRequestCycle cycle)
+ {
+ Object objValue = objTreeModelSource.getTreeModel().getTreeDataModel().getObject(objUniqueKey);
+ return getRender(objValue, objTreeModelSource, cycle);
+ }
+
+ /**
+ * @see INodeRenderFactory#getRender
+ */
+ public IRender getRender(Object objValue, ITreeModelSource objTreeModelSource, IRequestCycle objCycle) {
+ return new RenderString(objValue.toString());
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleSessionStateManager.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleSessionStateManager.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleSessionStateManager.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleSessionStateManager.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,31 +20,27 @@
/**
* @author ceco
*/
-public class SimpleSessionStateManager implements ITreeSessionStateManager
-{
+public class SimpleSessionStateManager implements ITreeSessionStateManager {
- /**
- * Constructor for SimpleSessionStateManager.
- */
- public SimpleSessionStateManager()
- {
- super();
- }
-
- /**
- * @see ITreeSessionStateManager#getSessionState(ITreeModel)
- */
- public Object getSessionState(ITreeModel objModel)
- {
- return objModel;
- }
-
- /**
- * @see ITreeSessionStateManager#getModel(Object)
- */
- public ITreeModel getModel(Object objSessionState)
- {
- return (ITreeModel)objSessionState;
- }
+ /**
+ * Constructor for SimpleSessionStateManager.
+ */
+ public SimpleSessionStateManager() {
+ super();
+ }
+
+ /**
+ * @see ITreeSessionStateManager#getSessionState(ITreeModel)
+ */
+ public Object getSessionState(ITreeModel objModel) {
+ return objModel;
+ }
+
+ /**
+ * @see ITreeSessionStateManager#getModel(Object)
+ */
+ public ITreeModel getModel(Object objSessionState) {
+ return (ITreeModel)objSessionState;
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeDataModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeDataModel.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeDataModel.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeDataModel.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -27,100 +27,85 @@
*/
public class SimpleTreeDataModel implements ITreeDataModel, Serializable
{
-
- private static final long serialVersionUID = 9215832847660213349L;
-
- protected ITreeNode m_objRootNode;
-
- /**
- * Constructor for SimpleTreeDataModel.
- */
- public SimpleTreeDataModel(ITreeNode objRootNode)
- {
- super();
- m_objRootNode = objRootNode;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getRoot()
- */
- public Object getRoot()
- {
- return m_objRootNode;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getChildCount(Object)
- */
- public int getChildCount(Object objParent)
- {
- ITreeNode objParentNode = (ITreeNode)objParent;
-
- return objParentNode.getChildCount();
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getChildren(Object)
- */
- public Iterator getChildren(Object objParent)
- {
- ITreeNode objParentNode = (ITreeNode)objParent;
- return objParentNode.getChildren().iterator();
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getObject(Object)
- */
- public Object getObject(Object objUniqueKey)
- {
- if (objUniqueKey != null)
- {
- TreePath objPath = (TreePath)objUniqueKey;
- return objPath.getLastPathComponent();
- }
- return null;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getUniqueKey(Object,
- * Object)
- */
- public Object getUniqueKey(Object objTarget, Object objParentUniqueKey)
- {
- TreePath objPath = (TreePath)objParentUniqueKey;
- Object objTargetUID = null;
- if (objPath != null)
- {
- objTargetUID = objPath.pathByAddingChild(objTarget);
- }
- else
- {
- objTargetUID = new TreePath(objTarget);
- }
- return objTargetUID;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#isAncestorOf(Object,
- * Object)
- */
- public boolean isAncestorOf(Object objTargetUniqueKey, Object objParentUniqueKey)
- {
- TreePath objParentPath = (TreePath)objParentUniqueKey;
- TreePath objTargetPath = (TreePath)objTargetUniqueKey;
- boolean bResult = objParentPath.isDescendant(objTargetPath);
- return bResult;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getParentUniqueKey
- */
- public Object getParentUniqueKey(Object objChildUniqueKey)
- {
- TreePath objChildPath = (TreePath)objChildUniqueKey;
- TreePath objParentPath = objChildPath.getParentPath();
- if (objParentPath == null) return null;
- return objParentPath.getLastPathComponent();
- }
+ private static final long serialVersionUID = 9215832847660213349L;
+
+ protected ITreeNode m_objRootNode;
+ /**
+ * Constructor for SimpleTreeDataModel.
+ */
+ public SimpleTreeDataModel(ITreeNode objRootNode) {
+ super();
+ m_objRootNode = objRootNode;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getRoot()
+ */
+ public Object getRoot() {
+ return m_objRootNode;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getChildCount(Object)
+ */
+ public int getChildCount(Object objParent) {
+ ITreeNode objParentNode = (ITreeNode)objParent;
+
+ return objParentNode.getChildCount();
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getChildren(Object)
+ */
+ public Iterator getChildren(Object objParent) {
+ ITreeNode objParentNode = (ITreeNode)objParent;
+ return objParentNode.getChildren().iterator();
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getObject(Object)
+ */
+ public Object getObject(Object objUniqueKey) {
+ if(objUniqueKey != null) {
+ TreePath objPath = (TreePath)objUniqueKey;
+ return objPath.getLastPathComponent();
+ }
+ return null;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getUniqueKey(Object, Object)
+ */
+ public Object getUniqueKey(Object objTarget, Object objParentUniqueKey) {
+ TreePath objPath = (TreePath)objParentUniqueKey;
+ Object objTargetUID = null;
+ if(objPath != null){
+ objTargetUID = objPath.pathByAddingChild(objTarget);
+ }else{
+ objTargetUID = new TreePath(objTarget);
+ }
+ return objTargetUID;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#isAncestorOf(Object, Object)
+ */
+ public boolean isAncestorOf(Object objTargetUniqueKey, Object objParentUniqueKey) {
+ TreePath objParentPath = (TreePath)objParentUniqueKey;
+ TreePath objTargetPath = (TreePath)objTargetUniqueKey;
+ boolean bResult = objParentPath.isDescendant(objTargetPath);
+ return bResult;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getParentUniqueKey
+ */
+ public Object getParentUniqueKey(Object objChildUniqueKey) {
+ TreePath objChildPath = (TreePath)objChildUniqueKey;
+ TreePath objParentPath = objChildPath.getParentPath();
+ if(objParentPath == null)
+ return null;
+ return objParentPath.getLastPathComponent();
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeModel.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeModel.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeModel.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -25,41 +25,35 @@
*/
public class SimpleTreeModel implements ITreeModel, Serializable
{
-
- private static final long serialVersionUID = -6445877820084989017L;
-
- private ITreeDataModel m_objDataModel;
- private ITreeStateModel m_objTreeStateModel;
-
- /**
- * Constructor for SimpleTreeModel.
- */
- public SimpleTreeModel(ITreeDataModel objDataModel)
- {
- this(objDataModel, new SimpleTreeStateModel());
- }
-
- public SimpleTreeModel(ITreeDataModel objDataModel, ITreeStateModel objTreeStateModel)
- {
- super();
- m_objDataModel = objDataModel;
- m_objTreeStateModel = objTreeStateModel;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeModel#getTreeDataModel()
- */
- public ITreeDataModel getTreeDataModel()
- {
- return m_objDataModel;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeModel#getTreeStateModel()
- */
- public ITreeStateModel getTreeStateModel()
- {
- return m_objTreeStateModel;
- }
+ private static final long serialVersionUID = -6445877820084989017L;
+
+ private ITreeDataModel m_objDataModel;
+ private ITreeStateModel m_objTreeStateModel;
+
+ /**
+ * Constructor for SimpleTreeModel.
+ */
+ public SimpleTreeModel(ITreeDataModel objDataModel) {
+ this(objDataModel, new SimpleTreeStateModel());
+ }
+
+ public SimpleTreeModel(ITreeDataModel objDataModel, ITreeStateModel objTreeStateModel) {
+ super();
+ m_objDataModel = objDataModel;
+ m_objTreeStateModel = objTreeStateModel;
+ }
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeModel#getTreeDataModel()
+ */
+ public ITreeDataModel getTreeDataModel() {
+ return m_objDataModel;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeModel#getTreeStateModel()
+ */
+ public ITreeStateModel getTreeStateModel() {
+ return m_objTreeStateModel;
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeStateModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeStateModel.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeStateModel.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/SimpleTreeStateModel.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -25,99 +25,85 @@
*/
public class SimpleTreeStateModel implements ITreeStateModel, Serializable
{
-
- private static final long serialVersionUID = 9206852255511734400L;
-
- private Set m_setExpanded;
- private Object m_objSelectedNodeUID = null;
-
- /**
- * Constructor for SimpleTreeStateModel.
- */
- public SimpleTreeStateModel()
- {
- super();
- initialize();
- }
-
- private void initialize()
- {
- m_setExpanded = new HashSet();
- m_objSelectedNodeUID = null;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#getExpandSelection()
- */
- public Set getExpandSelection()
- {
- return m_setExpanded;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#expand(Object)
- */
- public void expand(Object objUniqueKey)
- {
- m_setExpanded.add(objUniqueKey);
- // setSelectedNode(objUniqueKey);
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#expandPath(Object)
- */
- public void expandPath(Object objUniqueKey)
- {
- m_setExpanded.add(objUniqueKey);
- // setSelectedNode(objUniqueKey);
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#collapse(Object)
- */
- public void collapse(Object objUniqueKey)
- {
- m_setExpanded.remove(objUniqueKey);
- // setSelectedNode(objUniqueKey);
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#collapsePath(Object)
- */
- public void collapsePath(Object objUniqueKey)
- {
- m_setExpanded.remove(objUniqueKey);
- // setSelectedNode(objUniqueKey);
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#isUniqueKeyExpanded(Object)
- */
- public boolean isUniqueKeyExpanded(Object objUniqueKey)
- {
- return m_setExpanded.contains(objUniqueKey);
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#getSelectedNode()
- */
- public Object getSelectedNode()
- {
- return m_objSelectedNodeUID;
- }
-
- public void setSelectedNode(Object objUniqueKey)
- {
- if (m_objSelectedNodeUID == null || !m_objSelectedNodeUID.equals(objUniqueKey))
- m_objSelectedNodeUID = objUniqueKey;
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#resetState()
- */
- public void resetState()
- {
- initialize();
- }
+ private static final long serialVersionUID = 9206852255511734400L;
+
+ private Set m_setExpanded;
+ private Object m_objSelectedNodeUID = null;
+
+ /**
+ * Constructor for SimpleTreeStateModel.
+ */
+ public SimpleTreeStateModel() {
+ super();
+ initialize();
+ }
+ private void initialize(){
+ m_setExpanded = new HashSet();
+ m_objSelectedNodeUID = null;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#getExpandSelection()
+ */
+ public Set getExpandSelection() {
+ return m_setExpanded;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#expand(Object)
+ */
+ public void expand(Object objUniqueKey) {
+ m_setExpanded.add(objUniqueKey);
+ //setSelectedNode(objUniqueKey);
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#expandPath(Object)
+ */
+ public void expandPath(Object objUniqueKey) {
+ m_setExpanded.add(objUniqueKey);
+ //setSelectedNode(objUniqueKey);
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#collapse(Object)
+ */
+ public void collapse(Object objUniqueKey) {
+ m_setExpanded.remove(objUniqueKey);
+ //setSelectedNode(objUniqueKey);
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#collapsePath(Object)
+ */
+ public void collapsePath(Object objUniqueKey) {
+ m_setExpanded.remove(objUniqueKey);
+ //setSelectedNode(objUniqueKey);
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#isUniqueKeyExpanded(Object)
+ */
+ public boolean isUniqueKeyExpanded(Object objUniqueKey) {
+ return m_setExpanded.contains(objUniqueKey);
+ }
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#getSelectedNode()
+ */
+ public Object getSelectedNode() {
+ return m_objSelectedNodeUID;
+ }
+
+ public void setSelectedNode(Object objUniqueKey){
+ if(m_objSelectedNodeUID == null || !m_objSelectedNodeUID.equals(objUniqueKey))
+ m_objSelectedNodeUID = objUniqueKey;
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeStateModel#resetState()
+ */
+ public void resetState() {
+ initialize();
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/TreeNode.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/TreeNode.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/TreeNode.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/tree/simple/TreeNode.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -27,98 +27,83 @@
*/
public class TreeNode implements IMutableTreeNode
{
-
- private static final long serialVersionUID = 677919478017303186L;
-
- protected Set m_setChildren;
- protected IMutableTreeNode m_objParentNode;
-
- /**
- * Constructor for TreeNode.
- */
- public TreeNode()
- {
- this(null);
- }
-
- public TreeNode(IMutableTreeNode parentNode)
- {
- super();
- m_objParentNode = parentNode;
- m_setChildren = new HashSet();
- }
-
- public int getChildCount()
- {
- return m_setChildren.size();
- }
-
- public ITreeNode getParent()
- {
- return m_objParentNode;
- }
-
- public boolean getAllowsChildren()
- {
- return true;
- }
-
- public boolean isLeaf()
- {
- return m_setChildren.size() == 0 ? true : false;
- }
-
- public Collection children()
- {
- return m_setChildren;
- }
-
- public void insert(IMutableTreeNode child)
- {
- child.setParent(this);
- m_setChildren.add(child);
- }
-
- public void remove(IMutableTreeNode node)
- {
- m_setChildren.remove(node);
- }
-
- public void removeFromParent()
- {
- m_objParentNode.remove(this);
- m_objParentNode = null;
- }
-
- public void setParent(IMutableTreeNode newParent)
- {
- m_objParentNode = newParent;
- }
-
- public void insert(Collection colChildren)
- {
- for(Iterator iter = colChildren.iterator(); iter.hasNext();)
- {
- IMutableTreeNode element = (IMutableTreeNode)iter.next();
- element.setParent(this);
- m_setChildren.add(element);
- }
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeNode#containsChild(ITreeNode)
- */
- public boolean containsChild(ITreeNode node)
- {
- return m_setChildren.contains(node);
- }
-
- /**
- * @see org.apache.tapestry.contrib.tree.model.ITreeNode#getChildren()
- */
- public Collection getChildren()
- {
- return m_setChildren;
- }
+ private static final long serialVersionUID = 677919478017303186L;
+
+ protected Set m_setChildren;
+ protected IMutableTreeNode m_objParentNode;
+
+ /**
+ * Constructor for TreeNode.
+ */
+ public TreeNode() {
+ this(null);
+ }
+ public TreeNode(IMutableTreeNode parentNode) {
+ super();
+ m_objParentNode = parentNode;
+ m_setChildren = new HashSet();
+ }
+
+
+ public int getChildCount() {
+ return m_setChildren.size();
+ }
+
+ public ITreeNode getParent() {
+ return m_objParentNode;
+ }
+
+ public boolean getAllowsChildren() {
+ return true;
+ }
+
+ public boolean isLeaf() {
+ return m_setChildren.size() == 0 ? true:false;
+ }
+
+ public Collection children() {
+ return m_setChildren;
+ }
+
+
+ public void insert(IMutableTreeNode child) {
+ child.setParent(this);
+ m_setChildren.add(child);
+ }
+
+ public void remove(IMutableTreeNode node) {
+ m_setChildren.remove(node);
+ }
+
+ public void removeFromParent() {
+ m_objParentNode.remove(this);
+ m_objParentNode = null;
+ }
+
+ public void setParent(IMutableTreeNode newParent) {
+ m_objParentNode = newParent;
+ }
+
+ public void insert(Collection colChildren){
+ for (Iterator iter = colChildren.iterator(); iter.hasNext();) {
+ IMutableTreeNode element = (IMutableTreeNode) iter.next();
+ element.setParent(this);
+ m_setChildren.add(element);
+ }
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeNode#containsChild(ITreeNode)
+ */
+ public boolean containsChild(ITreeNode node) {
+ return m_setChildren.contains(node);
+ }
+
+ /**
+ * @see org.apache.tapestry.contrib.tree.model.ITreeNode#getChildren()
+ */
+ public Collection getChildren() {
+ return m_setChildren;
+ }
}
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/DateField.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/DateField.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/DateField.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/DateField.java Sat Mar 11 12:54:27 2006
@@ -156,4 +156,4 @@
setDate((Date) value);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/NumericField.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/NumericField.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/NumericField.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/NumericField.java Sat Mar 11 12:54:27 2006
@@ -128,4 +128,4 @@
return validator;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/ValidatingTextField.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/ValidatingTextField.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/ValidatingTextField.java (original)
+++ jakarta/tapestry/trunk/contrib/src/java/org/apache/tapestry/contrib/valid/ValidatingTextField.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,8 +19,7 @@
import org.apache.tapestry.valid.ValidField;
/**
- * Backwards compatible version of the 1.0.7 ValidatingTextField component.
- * <table border=1>
+ * Backwards compatible version of the 1.0.7 ValidatingTextField component. <table border=1>
* <tr>
* <td>Parameter</td>
* <td>Type</td>
@@ -37,8 +36,7 @@
* <td> </td>
* <td>The text inside the text field.
* <p>
- * When the form is submitted, the binding is only updated if the value is
- * valid.</td>
+ * When the form is submitted, the binding is only updated if the value is valid.</td>
* </tr>
* <tr>
* <td>minimumLength</td>
@@ -46,12 +44,11 @@
* <td>R</td>
* <td>no</td>
* <td>0</td>
- * <td>The minimum length (number of characters read) for the field. The value
- * provided in the request is trimmed of leading and trailing whitespace.
+ * <td>The minimum length (number of characters read) for the field. The value provided in the
+ * request is trimmed of leading and trailing whitespace.
* <p>
- * If a field is not required and no value is given, then minimumLength is
- * ignored. Minimum length only applies if <em>some</em> non-null value is
- * given.</td>
+ * If a field is not required and no value is given, then minimumLength is ignored. Minimum length
+ * only applies if <em>some</em> non-null value is given.</td>
* </tr>
* <tr>
* <td>required</td>
@@ -59,8 +56,8 @@
* <td>R</td>
* <td>no</td>
* <td>false</td>
- * <td>If true, then a non-null value must be provided. A value consisting only
- * of whitespace is considered null.</td>
+ * <td>If true, then a non-null value must be provided. A value consisting only of whitespace is
+ * considered null.</td>
* </tr>
* <tr>
* <td>displayName</td>
@@ -68,8 +65,7 @@
* <td>R</td>
* <td>yes</td>
* <td> </td>
- * <td>A textual name for the field that is used when formulating error
- * messages.</td>
+ * <td>A textual name for the field that is used when formulating error messages.</td>
* </tr>
* </table>
* <p>
@@ -82,7 +78,6 @@
public abstract class ValidatingTextField extends ValidField
{
-
public abstract int getMinimumLength();
public abstract boolean isRequired();
@@ -108,21 +103,22 @@
*/
public void setValue(Object value)
{
- setText((String)value);
+ setText((String) value);
}
/**
- * Overrides {@link ValidField#getValidator()}to construct a validator on
- * the fly.
+ * Overrides {@link ValidField#getValidator()}to construct a validator on the fly.
*/
public IValidator getValidator()
{
StringValidator validator = new StringValidator();
- if (isParameterBound("required")) validator.setRequired(isRequired());
+ if (isParameterBound("required"))
+ validator.setRequired(isRequired());
- if (isParameterBound("minimumLength")) validator.setMinimumLength(getMinimumLength());
+ if (isParameterBound("minimumLength"))
+ validator.setMinimumLength(getMinimumLength());
return validator;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/contrib/src/test/org/apache/tapestry/contrib/components/TestDumpObject.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/contrib/src/test/org/apache/tapestry/contrib/components/TestDumpObject.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/contrib/src/test/org/apache/tapestry/contrib/components/TestDumpObject.java (original)
+++ jakarta/tapestry/trunk/contrib/src/test/org/apache/tapestry/contrib/components/TestDumpObject.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2005, 2006 The Apache Software Foundation
+// Copyright 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -28,21 +28,19 @@
import org.easymock.MockControl;
/**
- * Tests for {@link org.apache.tapestry.contrib.components.DumpObject}.
+ * Tests for {@link org.apache.tapestry.contrib.components.DumpObject}
*
* @author Howard Lewis Ship
* @since 4.0
*/
public class TestDumpObject extends HiveMindTestCase
{
-
/**
- * Reads the content of a file, and forms a string. Converts line-number
- * endings in the file into the correct platform value (this should help the
- * test run properly on both Windows and *nix).
+ * Reads the content of a file, and forms a string. Converts line-number endings in the file
+ * into the correct platform value (this should help the test run properly on both Windows and
+ * *nix).
*/
- private String contentsOf(String path)
- throws Exception
+ private String contentsOf(String path) throws Exception
{
String sep = System.getProperty("line.separator");
@@ -58,11 +56,12 @@
StringBuffer buffer = new StringBuffer();
- while(true)
+ while (true)
{
String line = lnr.readLine();
- if (line == null) break;
+ if (line == null)
+ break;
buffer.append(line);
buffer.append(sep);
@@ -78,9 +77,10 @@
Creator creator = new Creator();
Object object = new Object();
- DumpObject dumpObject = (DumpObject)creator.newInstance(DumpObject.class);
+ DumpObject dumpObject = (DumpObject) creator.newInstance(DumpObject.class);
- assertEquals("java.io.NotSerializableException: java.lang.Object", dumpObject.convert(object));
+ assertEquals("java.io.NotSerializableException: java.lang.Object", dumpObject
+ .convert(object));
}
public void testRewinding()
@@ -89,7 +89,7 @@
IRequestCycle cycle = newCycle(true);
Creator creator = new Creator();
- DumpObject dumpObject = (DumpObject)creator.newInstance(DumpObject.class);
+ DumpObject dumpObject = (DumpObject) creator.newInstance(DumpObject.class);
replayControls();
@@ -98,15 +98,14 @@
verifyControls();
}
- public void testNormal()
- throws Exception
+ public void testNormal() throws Exception
{
IMarkupWriter writer = newWriter();
IRequestCycle cycle = newCycle(false);
Creator creator = new Creator();
- DumpObject dumpObject = (DumpObject)creator.newInstance(DumpObject.class, new Object[] { "object",
- "a serialized string" });
+ DumpObject dumpObject = (DumpObject) creator.newInstance(DumpObject.class, new Object[]
+ { "object", "a serialized string" });
String expected = contentsOf("Normal.txt");
@@ -122,7 +121,7 @@
private IRequestCycle newCycle(boolean isRewinding)
{
MockControl control = newControl(IRequestCycle.class);
- IRequestCycle cycle = (IRequestCycle)control.getMock();
+ IRequestCycle cycle = (IRequestCycle) control.getMock();
cycle.isRewinding();
control.setReturnValue(isRewinding);
@@ -132,6 +131,6 @@
private IMarkupWriter newWriter()
{
- return (IMarkupWriter)newMock(IMarkupWriter.class);
+ return (IMarkupWriter) newMock(IMarkupWriter.class);
}
}
Modified: jakarta/tapestry/trunk/eclipse/Tapestry-Workbench.launch
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/eclipse/Tapestry-Workbench.launch?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/eclipse/Tapestry-Workbench.launch (original)
+++ jakarta/tapestry/trunk/eclipse/Tapestry-Workbench.launch Sat Mar 11 12:54:27 2006
@@ -4,11 +4,10 @@
<booleanAttribute key="yk-capture-cpu-on-exit" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.mortbay.jetty.Server"/>
<booleanAttribute key="yk-startup-with-sampling" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="src/config/jetty.xml"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.apache.tapestry.disable-caching=true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="src/config/jetty.xml"/>
<listAttribute key="org.eclipse.jdt.launching.SOURCE_PATH">
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="JRE_LIB" path="2" sourceAttachmentPath="JRE_SRC" sourceRootPath="JRE_SRCROOT" type="3"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/jakarta-tapestry/config" path="3" type="2"/> "/>
@@ -38,16 +37,24 @@
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="JDK_DIR/lib/tools.jar" path="3" type="3"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="JETTY_DIR/ext/ant.jar" path="3" type="3"/> "/>
</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dorg.apache.tapestry.disable-caching=false"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="jakarta-tapestry/examples/Workbench"/>
-<stringAttribute key="yk-snapshot-dir" value=""/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_SOURCE_PATH" value="false"/>
+<stringAttribute key="yk-snapshot-dir" value=""/>
<stringAttribute key="org.eclipse.debug.ui.target_run_perspective" value="perspective_default"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_SOURCE_PATH" value="false"/>
<booleanAttribute key="yk-capture-memory-on-exit" value="false"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="JRE_LIB" path="1" type="3"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry type="3" path="1" containerPath="JRE_LIB"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento project="jakarta-tapestry"/> </runtimeClasspathEntry> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.USER_LIBRARY/JETTY_DIR" path="3" type="4"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry type="3" path="3" containerPath="JETTY_DIR/lib/javax.servlet.jar"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry type="3" path="3" containerPath="JETTY_DIR/lib/org.mortbay.jetty.jar"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry type="3" path="3" containerPath="JETTY_DIR/lib/org.mortbay.jmx.jar"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry type="3" path="3" containerPath="JETTY_DIR/ext/ant.jar"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry type="3" path="3" containerPath="JETTY_DIR/ext/crimson.jar"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry type="3" path="3" containerPath="JETTY_DIR/ext/jasper-compiler.jar"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry type="3" path="3" containerPath="JETTY_DIR/ext/jasper-runtime.jar"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry type="3" path="3" containerPath="JETTY_DIR/ext/javax.xml.jaxp.jar"/> "/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jakarta-tapestry"/>
<stringAttribute key="org.eclipse.debug.ui.target_debug_perspective" value="perspective_default"/>
Modified: jakarta/tapestry/trunk/examples/TimeTracker/tapestry-timetrackerdb.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/tapestry-timetrackerdb.properties?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/tapestry-timetrackerdb.properties (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/tapestry-timetrackerdb.properties Sat Mar 11 12:54:27 2006
@@ -1,5 +1,5 @@
#HSQL Database Engine
-#Mon Mar 06 22:31:41 EST 2006
+#Sat Mar 11 15:26:47 EST 2006
hsqldb.script_format=0
runtime.gc_interval=0
sql.enforce_strict_size=false
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/ActivateCallback.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/ActivateCallback.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/ActivateCallback.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/ActivateCallback.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@
import org.apache.tapestry.callback.ICallback;
/**
- * Callback implementation for pages which implement the
- * {@link org.apache.tapestry.vlib.IActivate} interface.
+ * Callback implementation for pages which implement the {@link org.apache.tapestry.vlib.IActivate}
+ * interface.
*
* @author Howard Lewis Ship
* @since 3.0
@@ -27,10 +27,9 @@
public class ActivateCallback implements ICallback
{
-
private static final long serialVersionUID = 931074851273839081L;
-
- private String _pageName;
+
+ private String _pageName;
public ActivateCallback(IActivate page)
{
@@ -44,9 +43,9 @@
public void performCallback(IRequestCycle cycle)
{
- IActivate page = (IActivate)cycle.getPage(_pageName);
+ IActivate page = (IActivate) cycle.getPage(_pageName);
page.validate(cycle);
page.activate();
}
-}
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org