[jboss-cvs] jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay ...
Shane Bryzak
sbryzak at redhat.com
Thu Apr 19 00:35:52 EDT 2007
User: sbryzak2
Date: 07/04/19 00:35:52
Modified: examples/seambay/src/org/jboss/seam/example/seambay
Account.java Auction.java AuctionSearchAction.java
Log:
detail screen improvements
Revision Changes Path
1.2 +11 -0 jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/Account.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Account.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/Account.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- Account.java 16 Apr 2007 03:57:49 -0000 1.1
+++ Account.java 19 Apr 2007 04:35:52 -0000 1.2
@@ -17,6 +17,7 @@
private int feedbackCount;
private float feedbackScore;
private Date memberSince;
+ private String location;
@Id @GeneratedValue
public Integer getAccountId()
@@ -68,4 +69,14 @@
{
this.memberSince = memberSince;
}
+
+ public String getLocation()
+ {
+ return location;
+ }
+
+ public void setLocation(String location)
+ {
+ this.location = location;
+ }
}
1.8 +37 -2 jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/Auction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Auction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/Auction.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- Auction.java 16 Apr 2007 03:57:49 -0000 1.7
+++ Auction.java 19 Apr 2007 04:35:52 -0000 1.8
@@ -29,6 +29,7 @@
private String description;
private Date endDate;
private AuctionImage image;
+ private Account highBidder;
private int bids;
private double price;
@@ -112,6 +113,16 @@
this.image = image;
}
+ public Account getHighBidder()
+ {
+ return highBidder;
+ }
+
+ public void setHighBidder(Account highBidder)
+ {
+ this.highBidder = highBidder;
+ }
+
public int getBids()
{
return bids;
@@ -141,8 +152,8 @@
timeLeft -= hours * 60 * 60;
int minutes = (int) Math.floor(timeLeft / 60);
- timeLeft -= minutes * 60;
- int seconds = (int) timeLeft;
+// timeLeft -= minutes * 60;
+// int seconds = (int) timeLeft;
StringBuilder sb = new StringBuilder();
@@ -158,6 +169,30 @@
return sb.toString();
}
+ @Transient
+ public String getDaysHoursLeft()
+ {
+ long timeLeft = getTimeLeft() / 1000;
+
+ int days = (int) Math.floor(timeLeft / (60 * 60 * 24));
+
+ timeLeft -= days * 24 * 60 * 60;
+ int hours = (int) Math.floor(timeLeft / (60 * 60));
+
+ StringBuilder sb = new StringBuilder();
+
+ if (days > 0)
+ sb.append(String.format("%d days ", days));
+
+ if (hours > 0)
+ sb.append(String.format("%d hour", hours));
+
+ if (hours > 1)
+ sb.append('s');
+
+ return sb.toString();
+ }
+
public double getPrice()
{
return price;
1.9 +10 -0 jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionSearchAction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AuctionSearchAction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionSearchAction.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- AuctionSearchAction.java 17 Apr 2007 05:38:21 -0000 1.8
+++ AuctionSearchAction.java 19 Apr 2007 04:35:52 -0000 1.9
@@ -153,4 +153,14 @@
{
this.searchCategory = category;
}
+
+ public Integer getSelectedCategoryId()
+ {
+ return searchCategory != null ? searchCategory.getCategoryId() : null;
+ }
+
+ public void setSelectedCategoryId(Integer categoryId)
+ {
+ selectCategory(entityManager.find(Category.class, categoryId));
+ }
}
More information about the jboss-cvs-commits
mailing list