KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > workbench > tree > examples > fsmodel > AssetsHolder


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// 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.workbench.tree.examples.fsmodel;
16
17 import org.apache.hivemind.impl.DefaultClassResolver;
18 import org.apache.hivemind.util.ClasspathResource;
19 import org.apache.tapestry.asset.PrivateAsset;
20
21 /**
22  *
23  * @author ceco
24  *
25  */

26 public class AssetsHolder
27 {
28
29     private String JavaDoc m_strOpenAssetsURL;
30     private String JavaDoc m_strCloseAssetsURL;
31     private PrivateAsset m_objOpenAsset = null;
32     private PrivateAsset m_objCloseAsset = null;
33     /**
34      * Constructor for AssetsHolder.
35      */

36     public AssetsHolder(String JavaDoc strOpenAssetsURL, String JavaDoc strCloseAssetsURL)
37     {
38         super();
39         m_strOpenAssetsURL = strOpenAssetsURL;
40         m_strCloseAssetsURL = strCloseAssetsURL;
41     }
42
43     public PrivateAsset getAssetForOpenNode()
44     {
45         if (m_objOpenAsset == null)
46         {
47             //m_objOpenAsset = new PrivateAsset(m_strOpenAssetsURL);
48
m_objOpenAsset =
49                 new PrivateAsset(
50                     new ClasspathResource(new DefaultClassResolver(), m_strOpenAssetsURL),
51                     null);
52         }
53         return m_objOpenAsset;
54     }
55     public PrivateAsset getAssetForCloseNode()
56     {
57         if (m_objCloseAsset == null)
58         {
59             //m_objCloseAsset = new PrivateAsset(m_strCloseAssetsURL);
60
m_objCloseAsset =
61                 new PrivateAsset(
62                     new ClasspathResource(new DefaultClassResolver(), m_strCloseAssetsURL),
63                     null);
64         }
65         return m_objCloseAsset;
66     }
67
68 }
69
Popular Tags