You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2006/01/12 18:19:58 UTC
svn commit: r368416 [2/2] - in /jakarta/tapestry/trunk/examples:
Vlib/src/java/org/apache/tapestry/vlib/
Vlib/src/java/org/apache/tapestry/vlib/pages/
Vlib/src/java/org/apache/tapestry/vlib/pages/admin/
Vlib/src/java/org/apache/tapestry/vlib/services/ ...
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/Visit.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/Visit.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/Visit.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/Visit.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,16 +25,19 @@
public class Visit implements Serializable
{
+
private static final long serialVersionUID = -8506455811411321232L;
/**
- * The name of the page for which the corresponding tab should be visibly active.
+ * The name of the page for which the corresponding tab should be visibly
+ * active.
*/
private String _activeTabName = "Home";
/**
- * If true, then a detailed report about the request is appended to the bottom of each page.
+ * If true, then a detailed report about the request is appended to the
+ * bottom of each page.
*/
private boolean _requestDebug;
@@ -182,4 +185,4 @@
{
_zipCode = zipCode;
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/WorkbenchHomeService.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/WorkbenchHomeService.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/WorkbenchHomeService.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/WorkbenchHomeService.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,8 @@
import org.apache.tapestry.engine.HomeService;
/**
- * Special version of the home service used to reset the visit tab when re-entering the Tapestry
- * application from a static HTML page.
+ * Special version of the home service used to reset the visit tab when
+ * re-entering the Tapestry application from a static HTML page.
*
* @author Howard Lewis Ship
* @see Redirect
@@ -29,14 +29,15 @@
public class WorkbenchHomeService extends HomeService
{
- public void service(IRequestCycle cycle) throws IOException
+
+ public void service(IRequestCycle cycle)
+ throws IOException
{
- Visit visit = (Visit) cycle.getEngine().getVisit();
+ Visit visit = (Visit)cycle.getEngine().getVisit();
- if (visit != null)
- visit.setActiveTabName("Home");
+ if (visit != null) visit.setActiveTabName("Home");
super.service(cycle);
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/WorkbenchValidationDelegate.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/WorkbenchValidationDelegate.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/WorkbenchValidationDelegate.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/WorkbenchValidationDelegate.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,17 +27,16 @@
public class WorkbenchValidationDelegate extends ValidationDelegate
{
+
private static final long serialVersionUID = -4782900422264574280L;
- public void writeAttributes(IMarkupWriter writer, IRequestCycle cycle,
- IFormComponent component, IValidator validator)
+ public void writeAttributes(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component,
+ IValidator validator)
{
- if (isInError())
- writer.attribute("class", "field-error");
+ if (isInError()) writer.attribute("class", "field-error");
}
- public void writeSuffix(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component,
- IValidator validator)
+ public void writeSuffix(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component, IValidator validator)
{
if (isInError())
{
@@ -48,29 +47,31 @@
writer.attribute("width", 20);
}
}
-
+
/**
- * {@inheritDoc }
+ * {@inheritDoc}
*/
public void writeLabelPrefix(IFormComponent component, IMarkupWriter writer, IRequestCycle cycle)
{
- //just prevents font tags
+ // just prevents font tags
}
-
+
/**
- * {@inheritDoc }
+ * {@inheritDoc}
*/
public void writeLabelSuffix(IFormComponent component, IMarkupWriter writer, IRequestCycle cycle)
{
- //just prevents font tags
+ // just prevents font tags
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void writeLabelAttributes(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component)
+ {
+ if (isInError(component))
+ {
+ writer.attribute("class", "error");
+ }
}
-
- /**
- * {@inheritDoc}
- */
- public void writeLabelAttributes(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component) {
- if (isInError(component)) {
- writer.attribute("class", "error");
- }
- }
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartPage.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartPage.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartPage.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartPage.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,7 +21,6 @@
import org.apache.hivemind.HiveMind;
import org.apache.tapestry.IAsset;
-import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.event.PageBeginRenderListener;
import org.apache.tapestry.event.PageEvent;
import org.apache.tapestry.html.BasePage;
@@ -37,8 +36,8 @@
import org.jCharts.test.TestDataGenerator;
/**
- * Demonstrates more complex form handling (including loops and dynamic addition/deletion of rows)
- * as well as dynamic image generation using JCharts.
+ * Demonstrates more complex form handling (including loops and dynamic
+ * addition/deletion of rows) as well as dynamic image generation using JCharts.
*
* @author Howard Lewis Ship, Luis Neves
* @since 1.0.10
@@ -46,11 +45,13 @@
public abstract class ChartPage extends BasePage implements IChartProvider, PageBeginRenderListener
{
+
public abstract IValidationDelegate getDelegate();
/**
- * Invokes {@link #getPlotValues()}, which ensures that (on the very first request cycle), the
- * persistent values property is set <em>before</em> the page recorder is locked.
+ * Invokes {@link #getPlotValues()}, which ensures that (on the very first
+ * request cycle), the persistent values property is set <em>before</em>
+ * the page recorder is locked.
*/
public void pageBeginRender(PageEvent event)
@@ -87,9 +88,10 @@
}
/**
- * Invoked by the deleted checkbox (for each plotValue). If true, the the current plotValue is
- * added to the list of plotValues to remove (though the actual removing is done inside
- * {@link #delete(IRequestCycle)}, after the loop.
+ * Invoked by the deleted checkbox (for each plotValue). If true, the the
+ * current plotValue is added to the list of plotValues to remove (though
+ * the actual removing is done inside {@link #delete(IRequestCycle)}, after
+ * the loop.
*/
public void setMarkedForDeletion(boolean value)
@@ -116,13 +118,13 @@
}
/**
- * Listener method for the add button, adds an additional (blank) plot value.
+ * Listener method for the add button, adds an additional (blank) plot
+ * value.
*/
public void add()
{
- if (getDelegate().getHasErrors())
- return;
+ if (getDelegate().getHasErrors()) return;
List plotValues = getPlotValues();
@@ -139,8 +141,7 @@
public void delete()
{
- if (getDelegate().getHasErrors())
- return;
+ if (getDelegate().getHasErrors()) return;
List removeValues = getRemoveValues();
@@ -160,9 +161,10 @@
}
/**
- * This method is invoked by the service (in a seperate request cycle from all the form handling
- * stuff). The {@link #getChartImageAsset()}method provides an {@link IAsset}that is handled
- * by the {@link ChartService}, and the asset encodes the identity of this page.
+ * This method is invoked by the service (in a seperate request cycle from
+ * all the form handling stuff). The {@link #getChartImageAsset()}method
+ * provides an {@link IAsset}that is handled by the {@link ChartService},
+ * and the asset encodes the identity of this page.
*/
public Chart getChart()
@@ -186,14 +188,13 @@
String[] labels = new String[count];
PieChart2DProperties properties = new PieChart2DProperties();
- for (int i = 0; i < count; i++)
+ for(int i = 0; i < count; i++)
{
- PlotValue pv = (PlotValue) plotValues.get(i);
+ PlotValue pv = (PlotValue)plotValues.get(i);
String name = pv.getName();
- if (HiveMind.isBlank(name))
- name = "<New>";
+ if (HiveMind.isBlank(name)) name = "<New>";
data[i] = new Double(pv.getValue()).doubleValue();
labels[i] = new String(name);
@@ -211,4 +212,4 @@
}
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/PlotValue.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/PlotValue.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/PlotValue.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/PlotValue.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,9 +25,10 @@
public class PlotValue implements Serializable
{
+
private static final long serialVersionUID = 4847193821463693432L;
- private String name;
+ private String name;
private int value;
@@ -73,4 +74,4 @@
return buffer.toString();
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/VerbosityRating.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/VerbosityRating.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/VerbosityRating.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/VerbosityRating.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,7 +14,6 @@
package org.apache.tapestry.workbench.table;
-import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
@@ -22,86 +21,86 @@
/**
* @author mindbridge
- *
*/
-public class VerbosityRating implements Serializable
+public final class VerbosityRating
{
- private static final long serialVersionUID = 1L;
-
- /**
- * Method calculateVerbosity.
- * Please note that this method is relatively slow
- * It should not be used often, unless for fun :)
- * @param objLocale
- * @return int
- */
- public static int calculateVerbosity(Locale objLocale)
- {
- int nWeekDayVerbosity = calculateWeekDayVerbosity(objLocale);
- int nMonthVerbosity = calculateMonthVerbosity(objLocale);
- return nWeekDayVerbosity + nMonthVerbosity;
- }
-
- public static int calculateWeekDayVerbosity(Locale objLocale)
- {
- SimpleDateFormat objWeekDay = new SimpleDateFormat("EEEE", objLocale);
-
- GregorianCalendar objCalendar = new GregorianCalendar();
- objCalendar.set(Calendar.YEAR, 2000);
- objCalendar.set(Calendar.MONTH, 0);
- objCalendar.set(Calendar.DATE, 1);
-
- int nCount = 0;
- for (int i = 0; i < 7; i++)
- {
- String strWeekDay = objWeekDay.format(objCalendar.getTime());
- nCount += strWeekDay.length();
- objCalendar.add(Calendar.DATE, 1);
- }
-
- return nCount;
- }
-
- public static int calculateMonthVerbosity(Locale objLocale)
- {
- SimpleDateFormat objMonth = new SimpleDateFormat("MMMM", objLocale);
-
- GregorianCalendar objCalendar = new GregorianCalendar();
- objCalendar.set(Calendar.YEAR, 2000);
- objCalendar.set(Calendar.MONTH, 0);
- objCalendar.set(Calendar.DATE, 1);
-
- int nCount = 0;
- for (int i = 0; i < 12; i++)
- {
- String strMonth = objMonth.format(objCalendar.getTime());
- nCount += strMonth.length();
- objCalendar.add(Calendar.MONTH, 1);
- }
-
- return nCount;
- }
-
- public static void main(String[] arrArgs)
- {
- int nMax = 0;
- int nMin = 1000;
-
- System.out.println("Starting");
-
- Locale[] arrLocales = Locale.getAvailableLocales();
- for (int i = 0; i < arrLocales.length; i++)
- {
- Locale objLocale = arrLocales[i];
- int nRating = calculateVerbosity(objLocale);
- if (nRating > nMax)
- nMax = nRating;
- if (nRating < nMin)
- nMin = nRating;
- }
-
- System.out.println("Min: " + nMin);
- System.out.println("Max: " + nMax);
- }
+
+ /** @since 4.1 */
+ private VerbosityRating()
+ {
+ }
+
+ /**
+ * Method calculateVerbosity. Please note that this method is relatively
+ * slow It should not be used often, unless for fun :)
+ *
+ * @param objLocale
+ * @return int
+ */
+ public static int calculateVerbosity(Locale objLocale)
+ {
+ int nWeekDayVerbosity = calculateWeekDayVerbosity(objLocale);
+ int nMonthVerbosity = calculateMonthVerbosity(objLocale);
+ return nWeekDayVerbosity + nMonthVerbosity;
+ }
+
+ public static int calculateWeekDayVerbosity(Locale objLocale)
+ {
+ SimpleDateFormat objWeekDay = new SimpleDateFormat("EEEE", objLocale);
+
+ GregorianCalendar objCalendar = new GregorianCalendar();
+ objCalendar.set(Calendar.YEAR, 2000);
+ objCalendar.set(Calendar.MONTH, 0);
+ objCalendar.set(Calendar.DATE, 1);
+
+ int nCount = 0;
+ for(int i = 0; i < 7; i++)
+ {
+ String strWeekDay = objWeekDay.format(objCalendar.getTime());
+ nCount += strWeekDay.length();
+ objCalendar.add(Calendar.DATE, 1);
+ }
+
+ return nCount;
+ }
+
+ public static int calculateMonthVerbosity(Locale objLocale)
+ {
+ SimpleDateFormat objMonth = new SimpleDateFormat("MMMM", objLocale);
+
+ GregorianCalendar objCalendar = new GregorianCalendar();
+ objCalendar.set(Calendar.YEAR, 2000);
+ objCalendar.set(Calendar.MONTH, 0);
+ objCalendar.set(Calendar.DATE, 1);
+
+ int nCount = 0;
+ for(int i = 0; i < 12; i++)
+ {
+ String strMonth = objMonth.format(objCalendar.getTime());
+ nCount += strMonth.length();
+ objCalendar.add(Calendar.MONTH, 1);
+ }
+
+ return nCount;
+ }
+
+ // public static void main(String[] arrArgs)
+ // {
+ // int nMax = 0;
+ // int nMin = 1000;
+ //
+ // System.out.println("Starting");
+ //
+ // Locale[] arrLocales = Locale.getAvailableLocales();
+ // for(int i = 0; i < arrLocales.length; i++) {
+ // Locale objLocale = arrLocales[i];
+ // int nRating = calculateVerbosity(objLocale);
+ // if (nRating > nMax) nMax = nRating;
+ // if (nRating < nMin) nMin = nRating;
+ // }
+ //
+ // System.out.println("Min: " + nMin);
+ // System.out.println("Max: " + nMax);
+ // }
}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/DirectoryTableView.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/DirectoryTableView.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/DirectoryTableView.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/DirectoryTableView.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -91,22 +91,24 @@
ArrayList arrColumnsList = new ArrayList();
arrColumnsList.add(new SimpleTableColumn("Name", true)
{
+
private static final long serialVersionUID = -5394217017984056107L;
- public Object getColumnValue(Object objValue)
+ public Object getColumnValue(Object objValue)
{
- SFObject objSFObject = (SFObject) objValue;
+ SFObject objSFObject = (SFObject)objValue;
return objSFObject.getName();
}
});
arrColumnsList.add(new SimpleTableColumn("Date", true)
{
+
private static final long serialVersionUID = -3258043732869364037L;
- public Object getColumnValue(Object objValue)
+ public Object getColumnValue(Object objValue)
{
- SFObject objSFObject = (SFObject) objValue;
+ SFObject objSFObject = (SFObject)objValue;
return objSFObject.getDate();
}
});
@@ -122,7 +124,7 @@
if (m_objSelectedFolderSource == null)
{
IBinding objBinding = getBinding("selectedFolderSource");
- m_objSelectedFolderSource = (ISelectedFolderSource) objBinding.getObject();
+ m_objSelectedFolderSource = (ISelectedFolderSource)objBinding.getObject();
}
return m_objSelectedFolderSource;
}
@@ -130,7 +132,7 @@
public void resetState()
{
initialize();
- Table objTable = (Table) getComponent("table");
+ Table objTable = (Table)getComponent("table");
objTable.reset();
}
@@ -138,4 +140,4 @@
{
return getSelectedFolderSource().getSelectedNodeName();
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/FileSystemTree.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/FileSystemTree.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/FileSystemTree.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/FileSystemTree.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -39,6 +39,7 @@
import org.apache.tapestry.workbench.tree.examples.fsmodel.FolderObject;
import org.apache.tapestry.workbench.tree.examples.fsmodel.NodeRenderFactory;
+/** @author tsv? */
public abstract class FileSystemTree extends BasePage implements ISelectedFolderSource,
ITreeStateListener, PageDetachListener
{
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/FileSystemTreeTable.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/FileSystemTreeTable.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/FileSystemTreeTable.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/FileSystemTreeTable.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -44,9 +44,11 @@
import org.apache.tapestry.workbench.tree.examples.fsmodel.IFileSystemTreeNode;
import org.apache.tapestry.workbench.tree.examples.fsmodel.NodeRenderFactory;
-public abstract class FileSystemTreeTable extends BasePage implements ISelectedFolderSource,
- ITreeStateListener, PageDetachListener
+/** @author mindbridge ? */
+public abstract class FileSystemTreeTable extends BasePage implements ISelectedFolderSource, ITreeStateListener,
+ PageDetachListener
{
+
private ITreeSessionStateManager m_objTreeSessionStateManager = null;
private ITreeDataModel m_objDataModel;
@@ -88,8 +90,7 @@
}
else
{
- FolderObject objFolder = new FolderObject(null, new File(strRootDir), true,
- getAssetService());
+ FolderObject objFolder = new FolderObject(null, new File(strRootDir), true, getAssetService());
objFolder.reload();
objParent = objFolder;
}
@@ -158,14 +159,15 @@
m_arrTableColumns = new ArrayList();
m_arrTableColumns.add(new SimpleTableColumn("Date", true)
{
+
private static final long serialVersionUID = -8211004113105081255L;
public Object getColumnValue(Object objValue)
{
- TreeRowObject objRowObject = (TreeRowObject) objValue;
- // SFObject objSFObject = (SFObject)objRowObject.getTreeNode();
- IFileSystemTreeNode objFileSystemTreeNode = (IFileSystemTreeNode) objRowObject
- .getTreeNode();
+ TreeRowObject objRowObject = (TreeRowObject)objValue;
+ // SFObject objSFObject =
+ // (SFObject)objRowObject.getTreeNode();
+ IFileSystemTreeNode objFileSystemTreeNode = (IFileSystemTreeNode)objRowObject.getTreeNode();
return objFileSystemTreeNode.getDate();
}
});
@@ -178,17 +180,16 @@
*/
public Collection getSelectedFolderChildren()
{
- TreeTable objTreeTable = (TreeTable) getComponent("tree");
+ TreeTable objTreeTable = (TreeTable)getComponent("tree");
ITreeModelSource objTreeModelSource = objTreeTable.getTreeModelSource();
ITreeStateModel objTreeStateModel = objTreeModelSource.getTreeModel().getTreeStateModel();
Object objSelectedNodeUID = objTreeStateModel.getSelectedNode();
ITreeNode objSelectedNode = null;
if (objSelectedNodeUID != null)
- objSelectedNode = (ITreeNode) getTreeModel().getTreeDataModel().getObject(
- objSelectedNodeUID);
+ objSelectedNode = (ITreeNode)getTreeModel().getTreeDataModel().getObject(objSelectedNodeUID);
else
{
- objSelectedNode = (ITreeNode) getTreeModel().getTreeDataModel().getRoot();
+ objSelectedNode = (ITreeNode)getTreeModel().getTreeDataModel().getRoot();
}
return objSelectedNode.getChildren();
}
@@ -198,7 +199,7 @@
*/
public void treeStateChanged(TreeStateEvent objEvent)
{
- DirectoryTableView objDirectoryTableView = (DirectoryTableView) getComponent("directoryTableView");
+ DirectoryTableView objDirectoryTableView = (DirectoryTableView)getComponent("directoryTableView");
objDirectoryTableView.resetState();
}
@@ -217,19 +218,18 @@
*/
public String getSelectedNodeName()
{
- TreeTable objTreeTable = (TreeTable) getComponent("tree");
+ TreeTable objTreeTable = (TreeTable)getComponent("tree");
ITreeModelSource objTreeModelSource = objTreeTable.getTreeModelSource();
ITreeStateModel objTreeStateModel = objTreeModelSource.getTreeModel().getTreeStateModel();
Object objSelectedNodeUID = objTreeStateModel.getSelectedNode();
ITreeNode objSelectedNode = null;
if (objSelectedNodeUID != null)
- objSelectedNode = (ITreeNode) getTreeModel().getTreeDataModel().getObject(
- objSelectedNodeUID);
+ objSelectedNode = (ITreeNode)getTreeModel().getTreeDataModel().getObject(objSelectedNodeUID);
else
{
- objSelectedNode = (ITreeNode) getTreeModel().getTreeDataModel().getRoot();
+ objSelectedNode = (ITreeNode)getTreeModel().getTreeDataModel().getRoot();
}
return objSelectedNode.toString();
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/ISelectedFolderSource.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/ISelectedFolderSource.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/ISelectedFolderSource.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/ISelectedFolderSource.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,14 +17,15 @@
import java.util.Collection;
/**
- * All right reserved.
- * Copyright (c) by Rushmore Digital Ltd.
- *
- * Created on Sep 4, 2003
+ * All right reserved. Copyright (c) by Rushmore Digital Ltd. Created on Sep 4,
+ * 2003
*
* @author ceco
*/
-public interface ISelectedFolderSource {
- Collection getSelectedFolderChildren();
- String getSelectedNodeName();
+public interface ISelectedFolderSource
+{
+
+ Collection getSelectedFolderChildren();
+
+ String getSelectedNodeName();
}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/TestTreeNode.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/TestTreeNode.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/TestTreeNode.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/TestTreeNode.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -22,39 +22,44 @@
*/
public class TestTreeNode extends TreeNode
{
+
private static final long serialVersionUID = -2513375115143901815L;
-
- private String m_strValue;
+
+ private String m_strValue;
/**
* Constructor for TestTreeNode.
*/
- public TestTreeNode(String strValue) {
+ public TestTreeNode(String strValue)
+ {
this(null, strValue);
}
/**
* Constructor for TestTreeNode.
+ *
* @param parentNode
*/
- public TestTreeNode(IMutableTreeNode parentNode, String strValue) {
+ public TestTreeNode(IMutableTreeNode parentNode, String strValue)
+ {
super(parentNode);
m_strValue = strValue;
}
- public String toString(){
+ public String toString()
+ {
return m_strValue;
}
- public int hashCode(){
+ public int hashCode()
+ {
return m_strValue.hashCode();
}
- public boolean equals(Object objTarget){
- if(objTarget == this)
- return true;
- if(! (objTarget instanceof TestTreeNode))
- return false;
+ public boolean equals(Object objTarget)
+ {
+ if (objTarget == this) return true;
+ if (!(objTarget instanceof TestTreeNode)) return false;
TestTreeNode objTargetNode = (TestTreeNode)objTarget;
return this.getValue().equals(objTargetNode.getValue());
@@ -62,9 +67,11 @@
/**
* Returns the value.
+ *
* @return String
*/
- public String getValue() {
+ public String getValue()
+ {
return m_strValue;
}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/Drive.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/Drive.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/Drive.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/Drive.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,12 +19,12 @@
import org.apache.tapestry.contrib.tree.model.ITreeNode;
import org.apache.tapestry.engine.IEngineService;
+/** @author tsv? * */
public class Drive extends FolderObject
{
- /** serialver uid */
- private static final long serialVersionUID = -4098885307563692077L;
+ private static final long serialVersionUID = -4098885307563692077L;
- private String m_strType;
+ private String m_strType;
private String m_strLabel;
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileObject.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileObject.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileObject.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileObject.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,14 +21,13 @@
import org.apache.tapestry.contrib.tree.model.ITreeNode;
import org.apache.tapestry.engine.IEngineService;
+/** @author tsv? * */
public class FileObject extends SFObject
{
- /**
- *
- */
- private static final long serialVersionUID = -4552981105079058185L;
- private long m_lSize;
+ private static final long serialVersionUID = -4552981105079058185L;
+
+ private long m_lSize;
private final IEngineService _assetService;
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileSystem.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileSystem.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileSystem.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileSystem.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -22,15 +22,13 @@
import org.apache.tapestry.contrib.tree.model.ITreeNode;
import org.apache.tapestry.engine.IEngineService;
+/** @author tsv? */
public class FileSystem implements IFileSystemTreeNode
{
- /**
- *
- */
- private static final long serialVersionUID = -3895257178984217762L;
+ private static final long serialVersionUID = -3895257178984217762L;
- private transient AssetsHolder m_objAssetsHolder = null;
+ private transient AssetsHolder m_objAssetsHolder = null;
/**
* @associates <{Drive}>
@@ -51,15 +49,12 @@
m_vDrives = new Vector();
File[] arrFile = File.listRoots();
- if (arrFile != null)
- for (int i = 0; i < arrFile.length; i++)
- {
- File objFile = arrFile[i];
- boolean bFloppy = objFile.getAbsolutePath().startsWith("A:")
- || objFile.getAbsolutePath().startsWith("B:");
- if (!bFloppy)
- m_vDrives.addElement(new Drive(this, objFile, _assetService));
- }
+ if (arrFile != null) for(int i = 0; i < arrFile.length; i++)
+ {
+ File objFile = arrFile[i];
+ boolean bFloppy = objFile.getAbsolutePath().startsWith("A:") || objFile.getAbsolutePath().startsWith("B:");
+ if (!bFloppy) m_vDrives.addElement(new Drive(this, objFile, _assetService));
+ }
}
public Vector getDrives()
@@ -73,13 +68,10 @@
public int getChildNumber(Object objChild)
{
- for (int i = 0; i < m_vDrives.size(); i++)
+ for(int i = 0; i < m_vDrives.size(); i++)
{
Object objChildDrive = m_vDrives.elementAt(i);
- if (objChildDrive.equals(objChild))
- {
- return i;
- }
+ if (objChildDrive.equals(objChild)) { return i; }
}
return -1;
}
@@ -150,11 +142,9 @@
*/
public boolean equals(Object arg0)
{
- if (!(arg0 instanceof FileSystem))
- return false;
- FileSystem objFileSystem = (FileSystem) arg0;
- if (getName().equals(objFileSystem.getName()))
- return true;
+ if (!(arg0 instanceof FileSystem)) return false;
+ FileSystem objFileSystem = (FileSystem)arg0;
+ if (getName().equals(objFileSystem.getName())) return true;
return false;
}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileSystemDataModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileSystemDataModel.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileSystemDataModel.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FileSystemDataModel.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,70 +23,74 @@
/**
* @author ceco
*/
-public class FileSystemDataModel extends SimpleTreeDataModel
- implements Serializable
+public class FileSystemDataModel extends SimpleTreeDataModel implements Serializable
{
+
private static final long serialVersionUID = 2384273235598992452L;
- /**
+ /**
* Constructor for FileSystemDataModel.
+ *
* @param objRootNode
*/
- public FileSystemDataModel(ITreeNode objRootNode) {
+ public FileSystemDataModel(ITreeNode objRootNode)
+ {
super(objRootNode);
}
/**
* @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getObject(Object)
*/
- public Object getObject(Object objUniqueKey) {
+ public Object getObject(Object objUniqueKey)
+ {
return findNode(objUniqueKey, (IFileSystemTreeNode)getRoot());
}
- private IFileSystemTreeNode findNode(Object objUniqueKey,
- IFileSystemTreeNode objParentNode) {
- String strUniqueKey = (String) objUniqueKey;
+ private IFileSystemTreeNode findNode(Object objUniqueKey, IFileSystemTreeNode objParentNode)
+ {
+ String strUniqueKey = (String)objUniqueKey;
String strParentUniqueKey = objParentNode.getAbsolutePath();
- if (strUniqueKey.equals(strParentUniqueKey)) {
- return objParentNode;
- }
+ if (strUniqueKey.equals(strParentUniqueKey)) { return objParentNode; }
IFileSystemTreeNode obj = null;
- if(strUniqueKey.startsWith(strParentUniqueKey))
- {
- for (Iterator iter = objParentNode.getChildren().iterator(); iter.hasNext();) {
- IFileSystemTreeNode element = (IFileSystemTreeNode) iter.next();
- obj = findNode(objUniqueKey, element);
- if (obj != null) {
- break;
- }
- }
- }
+ if (strUniqueKey.startsWith(strParentUniqueKey))
+ {
+ for(Iterator iter = objParentNode.getChildren().iterator(); iter.hasNext();)
+ {
+ IFileSystemTreeNode element = (IFileSystemTreeNode)iter.next();
+ obj = findNode(objUniqueKey, element);
+ if (obj != null)
+ {
+ break;
+ }
+ }
+ }
return obj;
}
/**
- * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getUniqueKey(Object, Object)
+ * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getUniqueKey(Object,
+ * Object)
*/
- public Object getUniqueKey(Object objTarget, Object objParentUniqueKey) {
- IFileSystemTreeNode objNode = (IFileSystemTreeNode) objTarget;
+ public Object getUniqueKey(Object objTarget, Object objParentUniqueKey)
+ {
+ IFileSystemTreeNode objNode = (IFileSystemTreeNode)objTarget;
return objNode.getAbsolutePath();
}
/**
- * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#isAncestorOf(Object, Object)
+ * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#isAncestorOf(Object,
+ * Object)
*/
- public boolean isAncestorOf(Object objChildUniqueKey,
- Object objParentUniqueKey) {
+ public boolean isAncestorOf(Object objChildUniqueKey, Object objParentUniqueKey)
+ {
String strChildAbsolutePath = (String)objChildUniqueKey;
String strParentAbsolutePath = (String)objParentUniqueKey;
- if("".equals(strParentAbsolutePath)) {
- return true;
- }
+ if ("".equals(strParentAbsolutePath)) { return true; }
return strChildAbsolutePath.lastIndexOf(strParentAbsolutePath) > -1;
}
@@ -94,9 +98,9 @@
/**
* @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getParentUniqueKey(Object)
*/
- public Object getParentUniqueKey(Object objChildUniqueKey) {
- IFileSystemTreeNode objNode =
- (IFileSystemTreeNode) getObject(objChildUniqueKey);
+ public Object getParentUniqueKey(Object objChildUniqueKey)
+ {
+ IFileSystemTreeNode objNode = (IFileSystemTreeNode)getObject(objChildUniqueKey);
return objNode.getParent();
}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FolderObject.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FolderObject.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FolderObject.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/FolderObject.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -22,15 +22,13 @@
import org.apache.tapestry.contrib.tree.model.ITreeNode;
import org.apache.tapestry.engine.IEngineService;
+/** @author tsv? */
public class FolderObject extends SFObject
{
- /**
- *
- */
- private static final long serialVersionUID = 1889745019885512018L;
+ private static final long serialVersionUID = 1889745019885512018L;
- /**
+ /**
* @associates <{File}>
* @supplierCardinality 0..*
* @link aggregation
@@ -48,15 +46,13 @@
private final IEngineService _assetService;
- public FolderObject(ITreeNode objParent, File objFile, boolean bInvokeInit,
- IEngineService assetService)
+ public FolderObject(ITreeNode objParent, File objFile, boolean bInvokeInit, IEngineService assetService)
{
super(objParent, objFile);
_assetService = assetService;
- if (bInvokeInit)
- init();
+ if (bInvokeInit) init();
}
public void reload()
@@ -66,12 +62,9 @@
File[] arrFiles = getFile().listFiles();
- if (arrFiles == null)
- {
- return;
- }
+ if (arrFiles == null) { return; }
- for (int i = 0; i < arrFiles.length; i++)
+ for(int i = 0; i < arrFiles.length; i++)
{
if (arrFiles[i].isDirectory())
{
@@ -109,13 +102,10 @@
public int getChildNumber(Object objChild)
{
- for (int i = 0; i < m_vFolders.size(); i++)
+ for(int i = 0; i < m_vFolders.size(); i++)
{
Object objChildFolder = m_vFolders.elementAt(i);
- if (objChildFolder.equals(objChild))
- {
- return i;
- }
+ if (objChildFolder.equals(objChild)) { return i; }
}
return -1;
}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/NodeRenderFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/NodeRenderFactory.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/NodeRenderFactory.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/NodeRenderFactory.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -26,58 +26,61 @@
/**
* @author ceco
*/
-public class NodeRenderFactory implements INodeRenderFactory {
+public class NodeRenderFactory implements INodeRenderFactory
+{
/**
* Constructor for NodeRenderFactory.
*/
- public NodeRenderFactory() {
+ public NodeRenderFactory()
+ {
super();
}
- public IRender getRenderByID(Object objUniqueKey,
- ITreeModelSource objTreeModelSource,
- IRequestCycle objCycle) {
+ public IRender getRenderByID(Object objUniqueKey, ITreeModelSource objTreeModelSource, IRequestCycle objCycle)
+ {
Object objValue = objTreeModelSource.getTreeModel().getTreeDataModel().getObject(objUniqueKey);
return getRender(objValue, objTreeModelSource, objCycle);
}
- public IRender getRender(Object objValue,
- ITreeModelSource objTreeModelSource,
- IRequestCycle objCycle) {
+ public IRender getRender(Object objValue, ITreeModelSource objTreeModelSource, IRequestCycle objCycle)
+ {
return new CFileSystemRender(objValue, objTreeModelSource);
}
+ /** Renders a file system? */
+
+ public class CFileSystemRender implements IRender
+ {
- public class CFileSystemRender implements IRender{
private Object m_objNode;
private ITreeModelSource m_objTreeModelSource;
- public CFileSystemRender(Object objNode, ITreeModelSource objTreeModelSource) {
+ public CFileSystemRender(Object objNode, ITreeModelSource objTreeModelSource)
+ {
super();
m_objNode = objNode;
- m_objTreeModelSource = objTreeModelSource;
+ m_objTreeModelSource = objTreeModelSource;
}
- public boolean isOpen() {
- ITreeDataModel objDataModel =
- m_objTreeModelSource.getTreeModel().getTreeDataModel();
- ITreeStateModel objStateModel =
- m_objTreeModelSource.getTreeModel().getTreeStateModel();
+ public boolean isOpen()
+ {
+ ITreeDataModel objDataModel = m_objTreeModelSource.getTreeModel().getTreeDataModel();
+ ITreeStateModel objStateModel = m_objTreeModelSource.getTreeModel().getTreeStateModel();
Object objUniqueKey = objDataModel.getUniqueKey(m_objNode, null);
return objStateModel.isUniqueKeyExpanded(objUniqueKey);
}
- public boolean isSelected(){
- ITreeDataModel objDataModel =
- m_objTreeModelSource.getTreeModel().getTreeDataModel();
- ITreeStateModel objStateModel =
- m_objTreeModelSource.getTreeModel().getTreeStateModel();
+ public boolean isSelected()
+ {
+ ITreeDataModel objDataModel = m_objTreeModelSource.getTreeModel().getTreeDataModel();
+ ITreeStateModel objStateModel = m_objTreeModelSource.getTreeModel().getTreeStateModel();
Object objUniqueKey = objDataModel.getUniqueKey(m_objNode, null);
return objUniqueKey.equals(objStateModel.getSelectedNode());
}
- public void render(IMarkupWriter objWriter, IRequestCycle objCycle) {
+ public void render(IMarkupWriter objWriter, IRequestCycle objCycle)
+ {
PrivateAsset objAsset = getAsset();
objWriter.begin("img");
objWriter.attribute("border", "0");
@@ -93,16 +96,21 @@
objWriter.end();
}
- public IFileSystemTreeNode getNode(){
- return (IFileSystemTreeNode) m_objNode;
+ public IFileSystemTreeNode getNode()
+ {
+ return (IFileSystemTreeNode)m_objNode;
}
- private PrivateAsset getAsset(){
+ private PrivateAsset getAsset()
+ {
PrivateAsset objAsset;
- if (!isOpen()) {
+ if (!isOpen())
+ {
objAsset = getNode().getAssets().getAssetForCloseNode();
- } else {
+ }
+ else
+ {
objAsset = getNode().getAssets().getAssetForOpenNode();
}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/SFObject.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/SFObject.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/SFObject.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/fsmodel/SFObject.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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,116 +20,130 @@
import org.apache.tapestry.contrib.tree.model.ITreeNode;
-public abstract class SFObject implements IFileSystemTreeNode{
+/**
+ * @author tsv?
+ */
+public abstract class SFObject implements IFileSystemTreeNode
+{
+
protected File m_objFile;
protected ITreeNode m_objParent;
private Date m_objDate;
protected transient AssetsHolder m_objAssetsHolder = null;
- public SFObject(ITreeNode objParent, File objFile) {
+ public SFObject(ITreeNode objParent, File objFile)
+ {
m_objParent = objParent;
m_objFile = objFile;
-// init();
+ // init();
}
- protected void init() {
- if(m_objFile.isFile() || m_objFile.isDirectory())
- m_objDate = new Date(m_objFile.lastModified());
+ protected void init()
+ {
+ if (m_objFile.isFile() || m_objFile.isDirectory()) m_objDate = new Date(m_objFile.lastModified());
}
- public String getName() {
- if (m_objFile.getName().equals("")) {
- return m_objFile.toString();
- }
+ public String getName()
+ {
+ if (m_objFile.getName().equals("")) { return m_objFile.toString(); }
return m_objFile.getName();
}
- public Date getDate() {
+ public Date getDate()
+ {
return m_objDate;
}
- public Object getAttributes() {
+ public Object getAttributes()
+ {
return null;
}
- protected File getFile() {
+ protected File getFile()
+ {
return m_objFile;
}
/**
* @see org.apache.tapestry.contrib.tree.model.ITreeNode#getParent()
*/
- public ITreeNode getParent() {
+ public ITreeNode getParent()
+ {
return m_objParent;
}
/**
* @see org.apache.tapestry.contrib.tree.model.ITreeNode#containsChild(ITreeNode)
*/
- public boolean containsChild(ITreeNode node) {
+ public boolean containsChild(ITreeNode node)
+ {
return false;
}
/**
* @see org.apache.tapestry.contrib.tree.model.ITreeNode#getAllowsChildren()
*/
- public boolean getAllowsChildren() {
+ public boolean getAllowsChildren()
+ {
return false;
}
/**
* @see org.apache.tapestry.contrib.tree.model.ITreeNode#getChildCount()
*/
- public int getChildCount() {
+ public int getChildCount()
+ {
return 0;
}
/**
* @see org.apache.tapestry.contrib.tree.model.ITreeNode#getChildren()
*/
- public Collection getChildren() {
+ public Collection getChildren()
+ {
return null;
}
/**
* @see org.apache.tapestry.contrib.tree.model.ITreeNode#isLeaf()
*/
- public boolean isLeaf() {
+ public boolean isLeaf()
+ {
return false;
}
/**
* @see java.lang.Object#equals(Object)
*/
- public boolean equals(Object arg0) {
- if (!(arg0 instanceof SFObject)) {
- return false;
- }
+ public boolean equals(Object arg0)
+ {
+ if (!(arg0 instanceof SFObject)) { return false; }
SFObject objSF = (SFObject)arg0;
- if (getFile().equals(objSF.getFile())) {
- return true;
- }
+ if (getFile().equals(objSF.getFile())) { return true; }
return false;
}
/**
* @see java.lang.Object#hashCode()
*/
- public int hashCode() {
+ public int hashCode()
+ {
return m_objFile.hashCode();
}
/**
* @see java.lang.Object#toString()
*/
- public String toString() {
+ public String toString()
+ {
return getName();
}
/**
* @see org.apache.tapestry.workbench.tree.examples.fsmodel.IFileSystemTreeNode#getAbsolutePath()
*/
- public String getAbsolutePath() {
+ public String getAbsolutePath()
+ {
return getFile().getAbsolutePath();
}
}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/upload/Upload.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/upload/Upload.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/upload/Upload.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/upload/Upload.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -29,6 +29,11 @@
public abstract class Upload extends BasePage
{
+
+ private static final String[] BPL_OPTIONS = new String[] { "8", "16", "24", "32", "40", "48" };
+
+ private IPropertySelectionModel bplModel;
+
public abstract IUploadFile getFile();
public abstract boolean isShowAscii();
@@ -37,11 +42,6 @@
public abstract IValidationDelegate getDelegate();
- private static final String[] bytesPerLineOptions = new String[]
- { "8", "16", "24", "32", "40", "48" };
-
- private IPropertySelectionModel bplModel;
-
@InjectPage("UploadResults")
public abstract UploadResults getUploadResults();
@@ -56,9 +56,8 @@
public IPropertySelectionModel getBytesPerLineModel()
{
- if (bplModel == null)
- bplModel = new StringPropertySelectionModel(bytesPerLineOptions);
+ if (bplModel == null) bplModel = new StringPropertySelectionModel(BPL_OPTIONS);
return bplModel;
}
-}
\ No newline at end of file
+}
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/upload/UploadResults.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/upload/UploadResults.java?rev=368416&r1=368415&r2=368416&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/upload/UploadResults.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/upload/UploadResults.java Thu Jan 12 09:19:45 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005, 2006 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.
@@ -33,6 +33,7 @@
public abstract class UploadResults extends BasePage
{
+
public abstract void setFile(IUploadFile file);
public abstract void setFileDump(String fileDump);
@@ -57,12 +58,11 @@
byte[] buffer = new byte[1000];
- while (true)
+ while(true)
{
int length = in.read(buffer);
- if (length < 0)
- break;
+ if (length < 0) break;
out.write(buffer, 0, length);
}
@@ -133,4 +133,4 @@
}
}
}
-}
\ 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