/*
* The contents of this file are subject to the
* Mozilla Public License Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights and
* limitations under the License.
*
* The Initial Developer of the Original Code is Simulacra Media Ltd.
* Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
*
* All Rights Reserved.
*
* Contributor(s):
*/
package org.openharmonise.him.actions.rules;
import org.openharmonise.vfs.*;
/**
* Implementors of this interface acts as templates for rules
* which are used to check if actions are enabled.
*
* @author Matthew Large
* @version $Revision: 1.1 $
*
*/
public interface EnableRule {
/**
* Checks if an action is enabled base on the rule, its parameters
* and the current context.
*
* @param vfFile Current context virtual file
* @return true if the rule is passed
*/
public boolean isEnabled(VirtualFile vfFile);
/**
* Sets the results comparator. By default {@link EnableRule#isEnabled(VirtualFile)}
* will return true if the rule has a positive result, i.e. the comparator
* is <code>true</code> by default. Setting the result comparator to false
* will make {@link EnableRule#isEnabled(VirtualFile)} return true for a
* negative result from the rule.
*
* @param bComparator true to have {@link EnableRule#isEnabled(VirtualFile)} return the rule's actual result
*/
public void setResultComparator(boolean bComparator);
}
|