01: /*
02: * The contents of this file are subject to the
03: * Mozilla Public License Version 1.1 (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 http://www.mozilla.org/MPL/
06: *
07: * Software distributed under the License is distributed on an "AS IS"
08: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
09: * See the License for the specific language governing rights and
10: * limitations under the License.
11: *
12: * The Initial Developer of the Original Code is Simulacra Media Ltd.
13: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14: *
15: * All Rights Reserved.
16: *
17: * Contributor(s):
18: */
19: package org.openharmonise.workfloweditor.vfs;
20:
21: import org.openharmonise.him.*;
22: import org.openharmonise.vfs.*;
23: import org.openharmonise.vfs.servers.ServerList;
24: import org.openharmonise.workfloweditor.model.*;
25:
26: /**
27: * Virtual file system implementation of {@link org.openharmonise.workfloweditor.model.Role}.
28: *
29: * @author Matthew Large
30: * @version $Revision: 1.1 $
31: *
32: */
33: public class VFSRole extends Role {
34:
35: /**
36: * Full path to virtual file for role value.
37: */
38: private String m_sValuePath = null;
39:
40: /**
41: * Constructs a new virtual file system role.
42: *
43: * @param sValuePath Full path to virtual file for role value.
44: */
45: public VFSRole(String sValuePath) {
46: super ();
47: this .m_sValuePath = sValuePath;
48: this .setup();
49: }
50:
51: /**
52: * Configures the role.
53: *
54: */
55: private void setup() {
56: AbstractVirtualFileSystem vfs = ServerList.getInstance()
57: .getHarmoniseServer().getVFS();
58: VirtualFile vfFile = vfs.getVirtualFile(m_sValuePath)
59: .getResource();
60: this .setTitle(vfs.getVirtualFileSystemView().getDisplayName(
61: vfFile));
62: }
63:
64: private VFSRole() {
65: super ();
66: }
67:
68: /**
69: * Returns the full path to the virtual file for the role value.
70: *
71: * @return Full path
72: */
73: public String getValuePath() {
74: return this.m_sValuePath;
75: }
76: }
|