KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (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 http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * 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.him.actions.rules;
20
21 import org.openharmonise.vfs.*;
22
23 /**
24  * Implementors of this interface acts as templates for rules
25  * which are used to check if actions are enabled.
26  *
27  * @author Matthew Large
28  * @version $Revision: 1.1 $
29  *
30  */

31 public interface EnableRule {
32
33     /**
34      * Checks if an action is enabled base on the rule, its parameters
35      * and the current context.
36      *
37      * @param vfFile Current context virtual file
38      * @return true if the rule is passed
39      */

40     public boolean isEnabled(VirtualFile vfFile);
41     
42     /**
43      * Sets the results comparator. By default {@link EnableRule#isEnabled(VirtualFile)}
44      * will return true if the rule has a positive result, i.e. the comparator
45      * is <code>true</code> by default. Setting the result comparator to false
46      * will make {@link EnableRule#isEnabled(VirtualFile)} return true for a
47      * negative result from the rule.
48      *
49      * @param bComparator true to have {@link EnableRule#isEnabled(VirtualFile)} return the rule's actual result
50      */

51     public void setResultComparator(boolean bComparator);
52
53 }
54
Popular Tags