annotate src/main/java/org/ssdt_ohio/devel/forms/components/Layout.java @ 0:f4f8570d1c56

initial OTP form
author smith@nwoca.org
date Mon, 12 Nov 2012 16:29:11 +0000
parents
children
rev   line source
0
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
1 package org.ssdt_ohio.devel.forms.components;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
2
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
3 import com.trsvax.bootstrap.annotations.Exclude;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
4 import org.apache.tapestry5.*;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
5 import org.apache.tapestry5.annotations.*;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
6 import org.apache.tapestry5.ioc.annotations.*;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
7 import org.apache.tapestry5.BindingConstants;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
8 import org.apache.tapestry5.SymbolConstants;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
9
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
10 @Exclude(stylesheet = {"core"})
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
11 @Import(stylesheet = {"classpath:/com/trsvax/bootstrap/assets/bootstrap/css/bootstrap.css",
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
12 "classpath:/com/trsvax/bootstrap/assets/bootstrap/css/bootstrap-responsive.css",
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
13 "context:layout/layout.css"},
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
14 library = {"classpath:/com/trsvax/bootstrap/assets/bootstrap/js/bootstrap.js"})
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
15 public class Layout
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
16 {
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
17 /**
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
18 * The page title, for the <title> element and the <h1> element.
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
19 */
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
20 @Property
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
21 @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
22 private String title;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
23
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
24 @Property
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
25 private String pageName;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
26
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
27 @Inject
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
28 private ComponentResources resources;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
29
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
30 @Property
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
31 @Inject
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
32 @Symbol(SymbolConstants.APPLICATION_VERSION)
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
33 private String appVersion;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
34
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
35
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
36 public String getClassForPageName()
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
37 {
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
38 return resources.getPageName().equalsIgnoreCase(pageName)
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
39 ? "current_page_item"
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
40 : null;
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
41 }
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
42
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
43 public String[] getPageNames()
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
44 {
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
45 return new String[]{"Index", "OneTwentyPayment"};
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
46 }
f4f8570d1c56 initial OTP form
smith@nwoca.org
parents:
diff changeset
47 }