Package org.openjump.core.ui.enablecheck
Class BooleanPropertyEnableCheck
- java.lang.Object
-
- org.openjump.core.ui.enablecheck.BooleanPropertyEnableCheck
-
- All Implemented Interfaces:
EnableCheck
public class BooleanPropertyEnableCheck extends Object implements EnableCheck
-
-
Constructor Summary
Constructors Constructor Description BooleanPropertyEnableCheck(Object object, String checkMethodName)BooleanPropertyEnableCheck(Object object, String checkMethodName, boolean expectedValue)BooleanPropertyEnableCheck(Object object, String checkMethodName, boolean expectedValue, String disabledMessage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringcheck(JComponent component)Returns a non-null value if the check failed.
-
-
-
Constructor Detail
-
BooleanPropertyEnableCheck
public BooleanPropertyEnableCheck(Object object, String checkMethodName)
- Parameters:
object- The object to invoke the method on.checkMethodName- The name of the check method which returns a boolean value.
-
BooleanPropertyEnableCheck
public BooleanPropertyEnableCheck(Object object, String checkMethodName, boolean expectedValue)
- Parameters:
object- The object to invoke the method on.checkMethodName- The name of the check method which returns a boolean value.expectedValue- The expected value to be returned for the check to be enabled.
-
BooleanPropertyEnableCheck
public BooleanPropertyEnableCheck(Object object, String checkMethodName, boolean expectedValue, String disabledMessage)
- Parameters:
object- The object to invoke the method on.checkMethodName- The name of the check method which returns a boolean value.expectedValue- The expected value to be returned for the check to be enabled.disabledMessage- error message if the condition is not fulfilled
-
-
Method Detail
-
check
public String check(JComponent component)
Description copied from interface:EnableCheckReturns a non-null value if the check failed. Sometimes the return value is used (for example, it is displayed as a tooltip for menu-items); sometimes it is not (for example, toolbar buttons don't do anything with the return value). An advanced use of an EnableCheck is simply to change some property of a menu item (such as the text), as it is called when menu items are displayed.- Specified by:
checkin interfaceEnableCheck- Returns:
- an error message if the check failed, or null if the check passed
-
-