01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry.integration.app1.pages;
16:
17: import java.util.List;
18:
19: import org.apache.tapestry.ComponentResources;
20: import org.apache.tapestry.annotations.Inject;
21: import org.apache.tapestry.beaneditor.BeanModel;
22: import org.apache.tapestry.integration.app1.data.SimpleTrack;
23: import org.apache.tapestry.integration.app1.data.Track;
24: import org.apache.tapestry.integration.app1.services.MusicLibrary;
25: import org.apache.tapestry.services.BeanModelSource;
26:
27: public class SimpleTrackGridDemo {
28: @Inject
29: private MusicLibrary _library;
30:
31: @Inject
32: private BeanModelSource _beanModelSource;
33:
34: @Inject
35: private ComponentResources _resources;
36:
37: private SimpleTrack _track;
38:
39: public SimpleTrack getTrack() {
40: return _track;
41: }
42:
43: public void setTrack(SimpleTrack track) {
44: _track = track;
45: }
46:
47: public List<Track> getTracks() {
48: return _library.getTracks();
49: }
50:
51: public BeanModel getSimpleTrackModel() {
52: return _beanModelSource.create(SimpleTrack.class, false,
53: _resources);
54: }
55: }
|