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 [9/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/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/KeyAllocatorBean.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/KeyAllocatorBean.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/KeyAllocatorBean.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/KeyAllocatorBean.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.
@@ -30,29 +30,26 @@
import org.apache.tapestry.contrib.ejb.XEJBException;
/**
- * Implementation of the {@link org.apache.tapestry.vlib.ejb.IKeyAllocator}
- * stateless session bean.
+ * Implementation of the {@link org.apache.tapestry.vlib.ejb.IKeyAllocator} stateless session bean.
* <p>
- * We're cheating a little; they KeyAllocator does have state, it just doesn't
- * get persisted ever. Since the operation on it is atomic ("gimme a key") it
- * doesn't need to have conversational state with its clients.
+ * We're cheating a little; they KeyAllocator does have state, it just doesn't get persisted ever.
+ * Since the operation on it is atomic ("gimme a key") it doesn't need to have conversational state
+ * with its clients.
* <p>
- * The KeyAllocator records in the database the "next key to allocate". When it
- * needs a key, it allocates a block of keys (by advancing the next key by a
- * some number).
+ * The KeyAllocator records in the database the "next key to allocate". When it needs a key, it
+ * allocates a block of keys (by advancing the next key by a some number).
* <p>
- * If the KeyAllocator instance is purged from the pool, then some number of
- * keys that it has allocated will be lost. Big deal.
+ * If the KeyAllocator instance is purged from the pool, then some number of keys that it has
+ * allocated will be lost. Big deal.
*
* @author Howard Lewis Ship
*/
public class KeyAllocatorBean implements SessionBean
{
-
private static final long serialVersionUID = -6783018767284081244L;
- private static final String PROPERTY_NAME = "next-key";
+ private static final String PROPERTY_NAME = "next-key";
/**
* List of Integer instances; these are keys acquired from the database.
@@ -61,8 +58,8 @@
private LinkedList keys;
/**
- * Number of keys to allocate from the database at a time. Set from the ENC
- * property "blockSize".
+ * Number of keys to allocate from the database at a time. Set from the ENC property
+ * "blockSize".
*/
private int blockSize = 0;
@@ -74,8 +71,7 @@
private DataSource dataSource;
/**
- * Activates the bean. Gets the block size and DataSource from the
- * environment.
+ * Activates the bean. Gets the block size and DataSource from the environment.
*/
public void ejbCreate()
@@ -87,7 +83,7 @@
try
{
initial = new InitialContext();
- environment = (Context)initial.lookup("java:comp/env");
+ environment = (Context) initial.lookup("java:comp/env");
}
catch (NamingException ex)
{
@@ -96,7 +92,7 @@
try
{
- blockSizeProperty = (Integer)environment.lookup("blockSize");
+ blockSizeProperty = (Integer) environment.lookup("blockSize");
}
catch (NamingException ex)
{
@@ -107,14 +103,15 @@
try
{
- dataSource = (DataSource)environment.lookup("jdbc/dataSource");
+ dataSource = (DataSource) environment.lookup("jdbc/dataSource");
}
catch (NamingException ex)
{
throw new XEJBException("Could not lookup data source.", ex);
}
- if (keys == null) keys = new LinkedList();
+ if (keys == null)
+ keys = new LinkedList();
}
/**
@@ -138,10 +135,9 @@
}
/**
- * Does nothing. This is invoked when the bean moves from the method ready
- * pool to the "does not exist" state. The EJB container will lost its
- * reference to the bean, and the garbage collector will take it (including
- * any keys it has cached from the database).
+ * Does nothing. This is invoked when the bean moves from the method ready pool to the "does not
+ * exist" state. The EJB container will lost its reference to the bean, and the garbage
+ * collector will take it (including any keys it has cached from the database).
*/
public void ejbRemove()
@@ -150,20 +146,20 @@
}
/**
- * Allocates a single key, going to the database only if it has no keys in
- * its internal cache.
+ * Allocates a single key, going to the database only if it has no keys in its internal cache.
*/
public Integer allocateKey()
{
- if (keys.isEmpty()) allocateBlock(1);
+ if (keys.isEmpty())
+ allocateBlock(1);
- return (Integer)keys.removeFirst();
+ return (Integer) keys.removeFirst();
}
/**
- * Allocates a block of keys, going to the database if there are
- * insufficient keys in its internal cache.
+ * Allocates a block of keys, going to the database if there are insufficient keys in its
+ * internal cache.
*/
public Integer[] allocateKeys(int count)
@@ -171,21 +167,22 @@
Integer[] result;
int i;
- if (keys.size() < count) allocateBlock(count);
+ if (keys.size() < count)
+ allocateBlock(count);
result = new Integer[count];
- for(i = 0; i < count; i++)
+ for (i = 0; i < count; i++)
{
- result[i] = (Integer)keys.removeFirst();
+ result[i] = (Integer) keys.removeFirst();
}
return result;
}
/**
- * Allocates a block of keys from the database. Allocates count keys, or the
- * configured block size, whichever is greater.
+ * Allocates a block of keys from the database. Allocates count keys, or the configured block
+ * size, whichever is greater.
* <p>
* It is assumed that this operation takes place within a transaction.
*/
@@ -224,12 +221,13 @@
// Now, take those keys and advance nextKey
- for(i = 0; i < allocationCount; i++)
+ for (i = 0; i < allocationCount; i++)
keys.add(new Integer(nextKey++));
// Update nextKey back to the database.
- statement = connection.prepareStatement("update PROP\n" + "set PROP_VALUE = ?\n" + "where NAME = ?");
+ statement = connection.prepareStatement("update PROP\n" + "set PROP_VALUE = ?\n"
+ + "where NAME = ?");
statement.setInt(1, nextKey);
statement.setString(2, PROPERTY_NAME);
@@ -297,4 +295,4 @@
throw new XEJBException("Unable to get database connection from pool.", ex);
}
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/OperationsBean.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/OperationsBean.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/OperationsBean.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/OperationsBean.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.
@@ -57,8 +57,7 @@
import org.apache.tapestry.vlib.ejb.SortOrdering;
/**
- * Implementation of the {@link org.apache.tapestry.vlib.ejb.IOperations}
- * stateless session bean.
+ * Implementation of the {@link org.apache.tapestry.vlib.ejb.IOperations} stateless session bean.
* <p>
* Implenents a number of stateless operations for the front end.
*
@@ -67,10 +66,9 @@
public class OperationsBean implements SessionBean
{
-
private static final long serialVersionUID = -3942706099570269035L;
- private transient Context _environment;
+ private transient Context _environment;
private transient IBookHome _bookHome;
@@ -85,9 +83,8 @@
private transient DataSource _dataSource;
/**
- * Sets up the bean. Locates the {@link DataSource} for the bean as
- * <code>jdbc/dataSource</code> within the ENC; this data source is later
- * used by {@link #getConnection()}.
+ * Sets up the bean. Locates the {@link DataSource} for the bean as <code>jdbc/dataSource</code>
+ * within the ENC; this data source is later used by {@link #getConnection()}.
*/
public void ejbCreate()
@@ -97,7 +94,7 @@
try
{
initial = new InitialContext();
- _environment = (Context)initial.lookup("java:comp/env");
+ _environment = (Context) initial.lookup("java:comp/env");
}
catch (NamingException e)
{
@@ -106,7 +103,7 @@
try
{
- _dataSource = (DataSource)_environment.lookup("jdbc/dataSource");
+ _dataSource = (DataSource) _environment.lookup("jdbc/dataSource");
}
catch (NamingException e)
{
@@ -145,15 +142,16 @@
* The {@link Book} value object is returned.
*/
- public Book borrowBook(Integer bookId, Integer borrowerId)
- throws FinderException, RemoteException, BorrowException
+ public Book borrowBook(Integer bookId, Integer borrowerId) throws FinderException,
+ RemoteException, BorrowException
{
IBookHome bookHome = getBookHome();
IPersonHome personHome = getPersonHome();
IBook book = bookHome.findByPrimaryKey(bookId);
- if (!book.getLendable()) throw new BorrowException("Book may not be borrowed.");
+ if (!book.getLendable())
+ throw new BorrowException("Book may not be borrowed.");
// Verify that the borrower exists.
@@ -178,8 +176,7 @@
* Adds a new book, verifying that the publisher and holder actually exist.
*/
- public Integer addBook(Map attributes)
- throws CreateException, RemoteException
+ public Integer addBook(Map attributes) throws CreateException, RemoteException
{
IBookHome home = getBookHome();
@@ -187,20 +184,20 @@
IBook book = home.create(attributes);
- return (Integer)book.getPrimaryKey();
+ return (Integer) book.getPrimaryKey();
}
/**
* Adds a book, which will be owned and held by the specified owner.
* <p>
- * The publisherName may either be the name of a known publisher, or a new
- * name. A new {@link IPublisher} will be created as necessary.
+ * The publisherName may either be the name of a known publisher, or a new name. A new
+ * {@link IPublisher} will be created as necessary.
* <p>
* Returns the newly created book, as a {@link Map} of attributes.
*/
- public Integer addBook(Map attributes, String publisherName)
- throws CreateException, RemoteException
+ public Integer addBook(Map attributes, String publisherName) throws CreateException,
+ RemoteException
{
IPublisher publisher = null;
IPublisherHome publisherHome = getPublisherHome();
@@ -213,11 +210,11 @@
}
catch (FinderException e)
{
- // Ignore, means that no publisher with the given name already
- // exists.
+ // Ignore, means that no publisher with the given name already exists.
}
- if (publisher == null) publisher = publisherHome.create(publisherName);
+ if (publisher == null)
+ publisher = publisherHome.create(publisherName);
attributes.put("publisherId", publisher.getPrimaryKey());
@@ -233,8 +230,7 @@
* The primary key of the book to update.
*/
- public void updateBook(Integer bookId, Map attributes)
- throws FinderException, RemoteException
+ public void updateBook(Integer bookId, Map attributes) throws FinderException, RemoteException
{
IBookHome bookHome = getBookHome();
@@ -259,7 +255,7 @@
*/
public void updateBook(Integer bookId, Map attributes, String publisherName)
- throws CreateException, FinderException, RemoteException
+ throws CreateException, FinderException, RemoteException
{
IPublisher publisher = null;
@@ -274,7 +270,8 @@
// Ignore, means we need to create the Publisher
}
- if (publisher == null) publisher = publisherHome.create(publisherName);
+ if (publisher == null)
+ publisher = publisherHome.create(publisherName);
// Don't duplicate all that other code!
@@ -283,8 +280,8 @@
updateBook(bookId, attributes);
}
- public void updatePerson(Integer personId, Map attributes)
- throws FinderException, RemoteException
+ public void updatePerson(Integer personId, Map attributes) throws FinderException,
+ RemoteException
{
IPersonHome home = getPersonHome();
@@ -315,9 +312,9 @@
set = statement.executeQuery();
- while(set.next())
+ while (set.next())
{
- Integer primaryKey = (Integer)set.getObject(1);
+ Integer primaryKey = (Integer) set.getObject(1);
String name = set.getString(2);
list.add(new Publisher(primaryKey, name));
@@ -335,13 +332,12 @@
// Convert from List to Publisher[]
- return (Publisher[])list.toArray(new Publisher[list.size()]);
+ return (Publisher[]) list.toArray(new Publisher[list.size()]);
}
/**
- * Fetchs all {@link IPerson} beans in the database and converts them to
- * {@link Person} objects. Returns the {@link Person}s sorted by last name,
- * then first.
+ * Fetchs all {@link IPerson} beans in the database and converts them to {@link Person} objects.
+ * Returns the {@link Person}s sorted by last name, then first.
*/
public Person[] getPersons()
@@ -365,7 +361,7 @@
Object[] columns = new Object[Person.N_COLUMNS];
- while(set.next())
+ while (set.next())
{
list.add(convertRowToPerson(set, columns));
}
@@ -379,7 +375,7 @@
close(connection, statement, set);
}
- return (Person[])list.toArray(new Person[list.size()]);
+ return (Person[]) list.toArray(new Person[list.size()]);
}
/**
@@ -389,8 +385,7 @@
* if the Person does not exist.
*/
- public Person getPerson(Integer personId)
- throws FinderException
+ public Person getPerson(Integer personId) throws FinderException
{
Connection connection = null;
IStatement statement = null;
@@ -412,7 +407,8 @@
set = statement.executeQuery();
- if (!set.next()) throw new FinderException("Person #" + personId + " does not exist.");
+ if (!set.next())
+ throw new FinderException("Person #" + personId + " does not exist.");
Object[] columns = new Object[Person.N_COLUMNS];
result = convertRowToPerson(set, columns);
@@ -430,8 +426,7 @@
return result;
}
- public Person login(String email, String password)
- throws RemoteException, LoginException
+ public Person login(String email, String password) throws RemoteException, LoginException
{
IPersonHome home = getPersonHome();
IPerson person = null;
@@ -446,18 +441,20 @@
throw new LoginException("Unknown e-mail address.", false);
}
- if (!person.getPassword().equals(password)) throw new LoginException("Invalid password.", true);
+ if (!person.getPassword().equals(password))
+ throw new LoginException("Invalid password.", true);
try
{
- result = getPerson((Integer)person.getPrimaryKey());
+ result = getPerson((Integer) person.getPrimaryKey());
}
catch (FinderException ex)
{
throw new LoginException("Could not read person.", false);
}
- if (result.isLockedOut()) throw new LoginException("You have been locked out of the Virtual Library.", false);
+ if (result.isLockedOut())
+ throw new LoginException("You have been locked out of the Virtual Library.", false);
// Set the last access time for any subsequent login.
@@ -466,8 +463,7 @@
return result;
}
- public Map getPersonAttributes(Integer personId)
- throws FinderException, RemoteException
+ public Map getPersonAttributes(Integer personId) throws FinderException, RemoteException
{
IPersonHome home = getPersonHome();
@@ -483,8 +479,7 @@
* if the Book does not exist.
*/
- public Book getBook(Integer bookId)
- throws FinderException
+ public Book getBook(Integer bookId) throws FinderException
{
Connection connection = null;
IStatement statement = null;
@@ -505,7 +500,8 @@
set = statement.executeQuery();
- if (!set.next()) throw new FinderException("Book " + bookId + " does not exist.");
+ if (!set.next())
+ throw new FinderException("Book " + bookId + " does not exist.");
Object[] columns = new Object[Book.N_COLUMNS];
result = convertRowToBook(set, columns);
@@ -523,8 +519,7 @@
return result;
}
- public Map getBookAttributes(Integer bookId)
- throws FinderException, RemoteException
+ public Map getBookAttributes(Integer bookId) throws FinderException, RemoteException
{
IBookHome home = getBookHome();
@@ -534,12 +529,12 @@
}
/**
- * Attempts to register a new user, first checking that the e-mail and names
- * are unique. Returns the primary key of the new {@link IPerson}.
+ * Attempts to register a new user, first checking that the e-mail and names are unique. Returns
+ * the primary key of the new {@link IPerson}.
*/
public Person registerNewUser(String firstName, String lastName, String email, String password)
- throws RegistrationException, CreateException, RemoteException
+ throws RegistrationException, CreateException, RemoteException
{
IPersonHome home;
@@ -560,7 +555,7 @@
IPerson person = home.create(attributes);
- Integer personId = (Integer)person.getPrimaryKey();
+ Integer personId = (Integer) person.getPrimaryKey();
try
{
@@ -572,8 +567,7 @@
}
}
- public Book deleteBook(Integer bookId)
- throws RemoveException, RemoteException
+ public Book deleteBook(Integer bookId) throws RemoveException, RemoteException
{
IBookHome home = getBookHome();
Book result = null;
@@ -597,12 +591,14 @@
* Transfers a number of books to a new owner.
*/
- public void transferBooks(Integer newOwnerId, Integer[] bookIds)
- throws FinderException, RemoteException
+ public void transferBooks(Integer newOwnerId, Integer[] bookIds) throws FinderException,
+ RemoteException
{
- if (bookIds == null) throw new RemoteException("Must supply non-null list of books to transfer.");
+ if (bookIds == null)
+ throw new RemoteException("Must supply non-null list of books to transfer.");
- if (newOwnerId == null) throw new RemoteException("Must provide an owner for the books.");
+ if (newOwnerId == null)
+ throw new RemoteException("Must provide an owner for the books.");
// Verify that the new owner exists.
@@ -613,7 +609,7 @@
IBookHome home = getBookHome();
- for(int i = 0; i < bookIds.length; i++)
+ for (int i = 0; i < bookIds.length; i++)
{
IBook book = home.findByPrimaryKey(bookIds[i]);
@@ -621,14 +617,14 @@
}
}
- public void updatePublishers(Publisher[] updated, Integer[] deleted)
- throws FinderException, RemoveException, RemoteException
+ public void updatePublishers(Publisher[] updated, Integer[] deleted) throws FinderException,
+ RemoveException, RemoteException
{
IPublisherHome home = getPublisherHome();
if (updated != null)
{
- for(int i = 0; i < updated.length; i++)
+ for (int i = 0; i < updated.length; i++)
{
IPublisher publisher = home.findByPrimaryKey(updated[i].getId());
publisher.setName(updated[i].getName());
@@ -637,22 +633,22 @@
if (deleted != null)
{
- for(int i = 0; i < deleted.length; i++)
+ for (int i = 0; i < deleted.length; i++)
{
home.remove(deleted[i]);
}
}
}
- public void updatePersons(Person[] updated, Integer[] resetPassword, String newPassword, Integer[] deleted,
- Integer adminId)
- throws FinderException, RemoveException, RemoteException
+ public void updatePersons(Person[] updated, Integer[] resetPassword, String newPassword,
+ Integer[] deleted, Integer adminId) throws FinderException, RemoveException,
+ RemoteException
{
IPersonHome home = getPersonHome();
int count = Tapestry.size(updated);
- for(int i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
Person u = updated[i];
IPerson person = home.findByPrimaryKey(u.getId());
@@ -663,7 +659,7 @@
count = Tapestry.size(resetPassword);
- for(int i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
IPerson person = home.findByPrimaryKey(resetPassword[i]);
@@ -678,17 +674,16 @@
moveBooksFromDeletedPersons(deleted, adminId);
}
- for(int i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
home.remove(deleted[i]);
}
/**
- * Invoked to update all books owned by people about to be deleted, to
- * reassign the books holder back to the owner.
+ * Invoked to update all books owned by people about to be deleted, to reassign the books holder
+ * back to the owner.
*/
- private void returnBooksFromDeletedPersons(Integer deletedPersonIds[])
- throws RemoveException
+ private void returnBooksFromDeletedPersons(Integer deletedPersonIds[]) throws RemoveException
{
StatementAssembly assembly = new StatementAssembly();
@@ -706,7 +701,7 @@
*/
private void moveBooksFromDeletedPersons(Integer deletedPersonIds[], Integer adminId)
- throws RemoveException
+ throws RemoveException
{
StatementAssembly assembly = new StatementAssembly();
@@ -721,8 +716,7 @@
}
- private void executeUpdate(StatementAssembly assembly)
- throws XRemoveException
+ private void executeUpdate(StatementAssembly assembly) throws XRemoveException
{
Connection connection = null;
IStatement statement = null;
@@ -757,8 +751,7 @@
* This works with queries generated by {@link #buildBaseBookQuery()}.
*/
- protected Book convertRowToBook(ResultSet set, Object[] columns)
- throws SQLException
+ protected Book convertRowToBook(ResultSet set, Object[] columns) throws SQLException
{
int column = 1;
@@ -767,9 +760,11 @@
columns[Book.DESCRIPTION_COLUMN] = set.getString(column++);
columns[Book.ISBN_COLUMN] = set.getString(column++);
columns[Book.OWNER_ID_COLUMN] = set.getObject(column++);
- columns[Book.OWNER_NAME_COLUMN] = buildName(set.getString(column++), set.getString(column++));
+ columns[Book.OWNER_NAME_COLUMN] = buildName(set.getString(column++), set
+ .getString(column++));
columns[Book.HOLDER_ID_COLUMN] = set.getObject(column++);
- columns[Book.HOLDER_NAME_COLUMN] = buildName(set.getString(column++), set.getString(column++));
+ columns[Book.HOLDER_NAME_COLUMN] = buildName(set.getString(column++), set
+ .getString(column++));
columns[Book.PUBLISHER_ID_COLUMN] = set.getObject(column++);
columns[Book.PUBLISHER_NAME_COLUMN] = set.getString(column++);
columns[Book.AUTHOR_COLUMN] = set.getString(column++);
@@ -782,27 +777,29 @@
private String buildName(String firstName, String lastName)
{
- if (firstName == null) return lastName;
+ if (firstName == null)
+ return lastName;
return firstName + " " + lastName;
}
/**
* All queries must use this exact set of select columns, so that
- * {@link #convertRow(ResultSet, Object[])} can build the correct
- * {@link Book} from each row.
+ * {@link #convertRow(ResultSet, Object[])} can build the correct {@link Book} from each row.
*/
- private static final String[] BOOK_SELECT_COLUMNS = { "book.BOOK_ID", "book.TITLE", "book.DESCRIPTION",
- "book.ISBN", "owner.PERSON_ID", "owner.FIRST_NAME", "owner.LAST_NAME", "holder.PERSON_ID",
- "holder.FIRST_NAME", "holder.LAST_NAME", "publisher.PUBLISHER_ID", "publisher.NAME", "book.AUTHOR",
+ private static final String[] BOOK_SELECT_COLUMNS =
+ { "book.BOOK_ID", "book.TITLE", "book.DESCRIPTION", "book.ISBN", "owner.PERSON_ID",
+ "owner.FIRST_NAME", "owner.LAST_NAME", "holder.PERSON_ID", "holder.FIRST_NAME",
+ "holder.LAST_NAME", "publisher.PUBLISHER_ID", "publisher.NAME", "book.AUTHOR",
"book.HIDDEN", "book.LENDABLE", "book.DATE_ADDED" };
- private static final String[] BOOK_ALIAS_COLUMNS = { "BOOK book", "PERSON owner", "PERSON holder",
- "PUBLISHER publisher" };
+ private static final String[] BOOK_ALIAS_COLUMNS =
+ { "BOOK book", "PERSON owner", "PERSON holder", "PUBLISHER publisher" };
- private static final String[] BOOK_JOINS = { "book.OWNER_ID = owner.PERSON_ID",
- "book.HOLDER_ID = holder.PERSON_ID", "book.PUBLISHER_ID = publisher.PUBLISHER_ID" };
+ private static final String[] BOOK_JOINS =
+ { "book.OWNER_ID = owner.PERSON_ID", "book.HOLDER_ID = holder.PERSON_ID",
+ "book.PUBLISHER_ID = publisher.PUBLISHER_ID" };
private static final Map BOOK_SORT_ASCENDING = new HashMap();
@@ -817,7 +814,8 @@
BOOK_SORT_ASCENDING.put(SortColumn.AUTHOR, "book.AUTHOR");
BOOK_SORT_DESCENDING.put(SortColumn.TITLE, "book.TITLE DESC");
- BOOK_SORT_DESCENDING.put(SortColumn.HOLDER, "holder.LAST_NAME DESC, holder.FIRST_NAME DESC");
+ BOOK_SORT_DESCENDING
+ .put(SortColumn.HOLDER, "holder.LAST_NAME DESC, holder.FIRST_NAME DESC");
BOOK_SORT_DESCENDING.put(SortColumn.OWNER, "owner.FIRST_NAME DESC, owner.LAST_NAME DESC");
BOOK_SORT_DESCENDING.put(SortColumn.PUBLISHER, "publisher.NAME DESC");
BOOK_SORT_DESCENDING.put(SortColumn.AUTHOR, "book.AUTHOR DESC");
@@ -840,14 +838,12 @@
}
/**
- * Adds a sort ordering clause to the statement. If ordering is null, orders
- * by book title.
+ * Adds a sort ordering clause to the statement. If ordering is null, orders by book title.
*
* @param assembly
* to update
* @param ordering
- * defines the column to sort on, and the order (ascending or
- * descending)
+ * defines the column to sort on, and the order (ascending or descending)
* @since 3.0
*/
@@ -861,7 +857,7 @@
Map sorts = ordering.isDescending() ? BOOK_SORT_DESCENDING : BOOK_SORT_ASCENDING;
- String term = (String)sorts.get(ordering.getColumn());
+ String term = (String) sorts.get(ordering.getColumn());
assembly.newLine("ORDER BY ");
assembly.add(term);
@@ -869,10 +865,12 @@
protected void addSubstringSearch(StatementAssembly assembly, String column, String value)
{
- if (value == null) return;
+ if (value == null)
+ return;
String trimmed = value.trim();
- if (trimmed.length() == 0) return;
+ if (trimmed.length() == 0)
+ return;
// Here's the McKoi dependency: LOWER() is a database-specific
// SQL function.
@@ -884,8 +882,8 @@
}
/**
- * Closes the resultSet (if not null), then the statement (if not null),
- * then the Connection (if not null). Exceptions are written to System.out.
+ * Closes the resultSet (if not null), then the statement (if not null), then the Connection (if
+ * not null). Exceptions are written to System.out.
*/
protected void close(Connection connection, IStatement statement, ResultSet resultSet)
@@ -938,7 +936,7 @@
{
Object raw = _environment.lookup("ejb/Person");
- _personHome = (IPersonHome)PortableRemoteObject.narrow(raw, IPersonHome.class);
+ _personHome = (IPersonHome) PortableRemoteObject.narrow(raw, IPersonHome.class);
}
catch (NamingException ex)
{
@@ -958,7 +956,9 @@
{
Object raw = _environment.lookup("ejb/Publisher");
- _publisherHome = (IPublisherHome)PortableRemoteObject.narrow(raw, IPublisherHome.class);
+ _publisherHome = (IPublisherHome) PortableRemoteObject.narrow(
+ raw,
+ IPublisherHome.class);
}
catch (NamingException e)
{
@@ -978,7 +978,7 @@
{
Object raw = _environment.lookup("ejb/Book");
- _bookHome = (IBookHome)PortableRemoteObject.narrow(raw, IBookHome.class);
+ _bookHome = (IBookHome) PortableRemoteObject.narrow(raw, IBookHome.class);
}
catch (NamingException e)
{
@@ -1025,8 +1025,7 @@
* This works with queries generated by {@link #buildBasePersonQuery()}.
*/
- protected Person convertRowToPerson(ResultSet set, Object[] columns)
- throws SQLException
+ protected Person convertRowToPerson(ResultSet set, Object[] columns) throws SQLException
{
int column = 1;
@@ -1041,14 +1040,13 @@
return new Person(columns);
}
- private Boolean getBoolean(ResultSet set, int index)
- throws SQLException
+ private Boolean getBoolean(ResultSet set, int index) throws SQLException
{
return set.getBoolean(index) ? Boolean.TRUE : Boolean.FALSE;
}
private void validateUniquePerson(String firstName, String lastName, String email)
- throws RegistrationException
+ throws RegistrationException
{
Connection connection = null;
IStatement statement = null;
@@ -1073,7 +1071,8 @@
statement = assembly.createStatement(connection);
set = statement.executeQuery();
- if (set.next()) throw new RegistrationException("Email address is already in use by another user.");
+ if (set.next())
+ throw new RegistrationException("Email address is already in use by another user.");
close(null, statement, set);
@@ -1091,7 +1090,8 @@
statement = assembly.createStatement(connection);
set = statement.executeQuery();
- if (set.next()) throw new RegistrationException("Name provided is already in use by another user.");
+ if (set.next())
+ throw new RegistrationException("Name provided is already in use by another user.");
}
catch (SQLException e)
@@ -1104,8 +1104,7 @@
}
}
- public Book returnBook(Integer bookId)
- throws RemoteException, FinderException
+ public Book returnBook(Integer bookId) throws RemoteException, FinderException
{
IBookHome bookHome = getBookHome();
IBook book = bookHome.findByPrimaryKey(bookId);
@@ -1117,4 +1116,4 @@
return getBook(bookId);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/PersonBean.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/PersonBean.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/PersonBean.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/PersonBean.java Sat Mar 11 12:54:27 2006
@@ -85,4 +85,4 @@
{
// Do nothing
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/PublisherBean.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/PublisherBean.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/PublisherBean.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/PublisherBean.java Sat Mar 11 12:54:27 2006
@@ -57,4 +57,4 @@
{
// Do nothing
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/context/WEB-INF/workbench.application
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/context/WEB-INF/workbench.application?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/context/WEB-INF/workbench.application (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/context/WEB-INF/workbench.application Sat Mar 11 12:54:27 2006
@@ -26,6 +26,7 @@
<meta key="org.apache.tapestry.component-class-packages" value="org.apache.tapestry.workbench.components"/>
<extension name="org.apache.tapestry.request-decoder" class="org.apache.tapestry.workbench.RequestDecoder"/>
-
+
<library id="contrib" specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>
+
</application>
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/Redirect.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/Redirect.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/Redirect.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/Redirect.java Sat Mar 11 12:54:27 2006
@@ -34,4 +34,4 @@
{
throw new RedirectException("http://jakarta.apache.org/tapestry");
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/RequestDecoder.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/RequestDecoder.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/RequestDecoder.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/RequestDecoder.java Sat Mar 11 12:54:27 2006
@@ -54,4 +54,4 @@
}
-}
+}
\ No newline at end of file
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=385164&r1=385163&r2=385164&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 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,19 +25,16 @@
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;
@@ -185,4 +182,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=385164&r1=385163&r2=385164&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 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,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,15 +29,14 @@
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=385164&r1=385163&r2=385164&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 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,16 +27,17 @@
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())
{
@@ -47,31 +48,29 @@
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
- }
-
- /**
- * {@inheritDoc}
- */
- public void writeLabelAttributes(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component)
- {
- if (isInError(component))
- {
- writer.attribute("class", "error");
- }
+ //just prevents font tags
}
-}
+
+ /**
+ * {@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/ChartAsset.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartAsset.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartAsset.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartAsset.java Sat Mar 11 12:54:27 2006
@@ -64,4 +64,4 @@
return null;
}
-}
+}
\ 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=385164&r1=385163&r2=385164&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 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,6 +21,7 @@
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;
@@ -36,8 +37,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
@@ -45,13 +46,11 @@
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)
@@ -88,10 +87,9 @@
}
/**
- * 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)
@@ -118,13 +116,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();
@@ -141,7 +139,8 @@
public void delete()
{
- if (getDelegate().getHasErrors()) return;
+ if (getDelegate().getHasErrors())
+ return;
List removeValues = getRemoveValues();
@@ -161,10 +160,9 @@
}
/**
- * 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()
@@ -188,13 +186,14 @@
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);
@@ -212,4 +211,4 @@
}
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartService.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartService.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartService.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartService.java Sat Mar 11 12:54:27 2006
@@ -134,4 +134,4 @@
{
_response = response;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/IChartProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/IChartProvider.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/IChartProvider.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/IChartProvider.java Sat Mar 11 12:54:27 2006
@@ -25,5 +25,5 @@
public interface IChartProvider
{
- Chart getChart();
-}
+ public Chart getChart();
+}
\ 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=385164&r1=385163&r2=385164&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 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,12 +25,11 @@
public class PlotValue implements Serializable
{
-
private static final long serialVersionUID = 4847193821463693432L;
- private String _name;
+ private String name;
- private int _value;
+ private int value;
public PlotValue()
{
@@ -38,28 +37,28 @@
public PlotValue(String name, int value)
{
- this._name = name;
- this._value = value;
+ this.name = name;
+ this.value = value;
}
public String getName()
{
- return _name;
+ return name;
}
public void setName(String name)
{
- this._name = name;
+ this.name = name;
}
public int getValue()
{
- return _value;
+ return value;
}
public void setValue(int value)
{
- this._value = value;
+ this.value = value;
}
public String toString()
@@ -67,11 +66,11 @@
StringBuffer buffer = new StringBuffer("PlotValue@");
buffer.append(Integer.toHexString(hashCode()));
buffer.append('[');
- buffer.append(_name);
+ buffer.append(name);
buffer.append(' ');
- buffer.append(_value);
+ buffer.append(value);
buffer.append(']');
return buffer.toString();
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/components/Border.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/components/Border.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/components/Border.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/components/Border.java Sat Mar 11 12:54:27 2006
@@ -134,4 +134,4 @@
cycle.activate(newPageName);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/fields/Fields.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/fields/Fields.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/fields/Fields.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/fields/Fields.java Sat Mar 11 12:54:27 2006
@@ -66,4 +66,4 @@
* @since 4.0
*/
public abstract IValidationDelegate getDelegate();
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/LocaleModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/LocaleModel.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/LocaleModel.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/LocaleModel.java Sat Mar 11 12:54:27 2006
@@ -75,4 +75,4 @@
return _locales.get(index);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/Localization.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/Localization.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/Localization.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/Localization.java Sat Mar 11 12:54:27 2006
@@ -54,4 +54,4 @@
return model;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/LocalizationChange.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/LocalizationChange.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/LocalizationChange.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/localization/LocalizationChange.java Sat Mar 11 12:54:27 2006
@@ -37,4 +37,4 @@
return localeName;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/Palette.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/Palette.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/Palette.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/Palette.java Sat Mar 11 12:54:27 2006
@@ -31,11 +31,6 @@
public abstract class Palette extends BasePage
{
- private IPropertySelectionModel colorModel;
-
- private String[] colors =
- { "Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet" };
-
public abstract List getSelectedColors();
@Persist("client:app")
@@ -71,6 +66,11 @@
return results;
}
+ private IPropertySelectionModel colorModel;
+
+ private String[] colors =
+ { "Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet" };
+
public IPropertySelectionModel getColorModel()
{
if (colorModel == null)
@@ -78,4 +78,4 @@
return colorModel;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/PaletteResults.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/PaletteResults.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/PaletteResults.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/palette/PaletteResults.java Sat Mar 11 12:54:27 2006
@@ -27,4 +27,4 @@
{
public abstract void setSelectedColors(List value);
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/LocaleList.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/LocaleList.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/LocaleList.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/LocaleList.java Sat Mar 11 12:54:27 2006
@@ -29,6 +29,10 @@
*/
public abstract class LocaleList extends BaseComponent
{
+
+ @Parameter(required = true)
+ public abstract ILocaleSelectionListener getLocaleSelectionListener();
+
// immutable values
private IPrimaryKeyConvertor m_objLocaleConvertor;
@@ -65,9 +69,6 @@
};
}
- @Parameter(required = true)
- public abstract ILocaleSelectionListener getLocaleSelectionListener();
-
public IPrimaryKeyConvertor getLocaleConvertor()
{
return m_objLocaleConvertor;
@@ -111,4 +112,4 @@
public abstract Set getSelectedLocales();
public abstract void setSelectedLocales(Set set);
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/LocaleSelection.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/LocaleSelection.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/LocaleSelection.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/table/LocaleSelection.java Sat Mar 11 12:54:27 2006
@@ -111,7 +111,7 @@
}
/**
- * A class defining the logic for getting the currency symbol from a locale.
+ * A class defining the logic for getting the currency symbol from a locale
*/
private static class CurrencyEvaluator implements ITableColumnEvaluator
{
@@ -134,7 +134,7 @@
}
/**
- * A class defining a column for displaying the date format.
+ * A class defining a column for displaying the date format
*/
private static class DateFormatColumn extends SimpleTableColumn
{
@@ -159,4 +159,4 @@
}
}
-}
+}
\ 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=385164&r1=385163&r2=385164&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 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,6 +14,7 @@
package org.apache.tapestry.workbench.table;
+import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
@@ -21,86 +22,86 @@
/**
* @author mindbridge
+ *
*/
-public final class VerbosityRating
+public class VerbosityRating implements Serializable
{
-
- /** @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);
- // }
+ 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);
+ }
}
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=385164&r1=385163&r2=385164&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 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.
@@ -91,24 +91,22 @@
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();
}
});
@@ -124,7 +122,7 @@
if (m_objSelectedFolderSource == null)
{
IBinding objBinding = getBinding("selectedFolderSource");
- m_objSelectedFolderSource = (ISelectedFolderSource)objBinding.getObject();
+ m_objSelectedFolderSource = (ISelectedFolderSource) objBinding.getObject();
}
return m_objSelectedFolderSource;
}
@@ -132,7 +130,7 @@
public void resetState()
{
initialize();
- Table objTable = (Table)getComponent("table");
+ Table objTable = (Table) getComponent("table");
objTable.reset();
}
@@ -140,4 +138,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=385164&r1=385163&r2=385164&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 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.
@@ -39,7 +39,6 @@
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
{
@@ -55,7 +54,7 @@
public abstract IEngineService getAssetService();
/**
- * Injected.
+ * Injected
*
* @since 4.0
*/
@@ -205,4 +204,4 @@
return objSelectedNode.toString();
}
-}
+}
\ No newline at end of file
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=385164&r1=385163&r2=385164&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 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.
@@ -44,11 +44,9 @@
import org.apache.tapestry.workbench.tree.examples.fsmodel.IFileSystemTreeNode;
import org.apache.tapestry.workbench.tree.examples.fsmodel.NodeRenderFactory;
-/** @author mindbridge ? */
-public abstract class FileSystemTreeTable extends BasePage implements ISelectedFolderSource, ITreeStateListener,
- PageDetachListener
+public abstract class FileSystemTreeTable extends BasePage implements ISelectedFolderSource,
+ ITreeStateListener, PageDetachListener
{
-
private ITreeSessionStateManager m_objTreeSessionStateManager = null;
private ITreeDataModel m_objDataModel;
@@ -60,7 +58,7 @@
private ArrayList m_arrTableColumns = null;
/**
- * Injected.
+ * Injected
*
* @since 4.0
*/
@@ -90,7 +88,8 @@
}
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;
}
@@ -159,15 +158,14 @@
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();
}
});
@@ -180,16 +178,17 @@
*/
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();
}
@@ -199,7 +198,7 @@
*/
public void treeStateChanged(TreeStateEvent objEvent)
{
- DirectoryTableView objDirectoryTableView = (DirectoryTableView)getComponent("directoryTableView");
+ DirectoryTableView objDirectoryTableView = (DirectoryTableView) getComponent("directoryTableView");
objDirectoryTableView.resetState();
}
@@ -218,18 +217,19 @@
*/
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=385164&r1=385163&r2=385164&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 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,15 +17,14 @@
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/SimpleTree.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/SimpleTree.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/SimpleTree.java (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/java/org/apache/tapestry/workbench/tree/examples/SimpleTree.java Sat Mar 11 12:54:27 2006
@@ -33,7 +33,7 @@
private ITreeModel treeModel;
- private Object _value;
+ private Object value;
public SimpleTree()
{
@@ -43,7 +43,7 @@
{
super.detach();
treeDataModel = null;
- _value = null;
+ value = null;
}
public void init()
@@ -89,7 +89,7 @@
*/
public Object getValue()
{
- return _value;
+ return value;
}
/**
@@ -100,6 +100,6 @@
*/
public void setValue(Object value)
{
- this._value = value;
+ this.value = value;
}
-}
+}
\ No newline at end of file
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=385164&r1=385163&r2=385164&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 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.
@@ -22,44 +22,39 @@
*/
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());
@@ -67,11 +62,9 @@
/**
* 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=385164&r1=385163&r2=385164&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 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,11 +19,8 @@
import org.apache.tapestry.contrib.tree.model.ITreeNode;
import org.apache.tapestry.engine.IEngineService;
-/** @author tsv? * */
public class Drive extends FolderObject
{
- private static final long serialVersionUID = -4098885307563692077L;
-
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=385164&r1=385163&r2=385164&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 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,12 +21,8 @@
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 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=385164&r1=385163&r2=385164&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 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.
@@ -22,12 +22,9 @@
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 transient AssetsHolder m_objAssetsHolder = null;
/**
@@ -49,12 +46,15 @@
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()
@@ -68,10 +68,13 @@
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;
}
@@ -142,9 +145,11 @@
*/
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;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org