KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > actions > rules > ParentPathEquals


1 /*
2  * (C) Copyright SimulacraMedia 2003. All rights reserved.
3  *
4  * Created on 05-Jan-2005
5  *
6  */

7 package org.openharmonise.him.actions.rules;
8
9 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 JavaDoc 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 JavaDoc 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 && vfFile.getFilePath().equalsIgnoreCase(this.m_sPath)) {
43             bEnabled = true;
44         }
45
46         return this.m_bComparator==bEnabled;
47     }
48
49     /* (non-Javadoc)
50      * @see com.simulacramedia.contentmanager.actions.rules.EnableRule#setResultComparator(boolean)
51      */

52     public void setResultComparator(boolean bComparator) {
53         this.m_bComparator = bComparator;
54     }
55
56 }
57
Popular Tags