01: /*
02: * (C) Copyright SimulacraMedia 2003. All rights reserved.
03: *
04: * Created on 05-Jan-2005
05: *
06: */
07: package org.openharmonise.him.actions.rules;
08:
09: import org.openharmonise.vfs.VirtualFile;
10:
11: /**
12: * FIXME - Matthew Large DIDN'T GIVE ME A DESCRIPTION!!
13: * @author Matthew Large
14: * @version $Revision: 1.1 $
15: *
16: */
17: public class ParentPathEquals implements EnableRule {
18:
19: boolean m_bComparator = true;
20:
21: /**
22: * Path to check against.
23: */
24: private String m_sPath = null;
25:
26: /**
27: * Constructs a new parent path equals rule.
28: *
29: * @param sPath Path to check against
30: */
31: public ParentPathEquals(String sPath) {
32: super ();
33: this .m_sPath = sPath;
34: }
35:
36: /* (non-Javadoc)
37: * @see com.simulacramedia.contentmanager.actions.rules.EnableRule#isEnabled(com.simulacramedia.vfs.VirtualFile)
38: */
39: public boolean isEnabled(VirtualFile vfFile) {
40: boolean bEnabled = false;
41:
42: if (vfFile != null
43: && vfFile.getFilePath().equalsIgnoreCase(this .m_sPath)) {
44: bEnabled = true;
45: }
46:
47: return this .m_bComparator == bEnabled;
48: }
49:
50: /* (non-Javadoc)
51: * @see com.simulacramedia.contentmanager.actions.rules.EnableRule#setResultComparator(boolean)
52: */
53: public void setResultComparator(boolean bComparator) {
54: this.m_bComparator = bComparator;
55: }
56:
57: }
|