Class BooleanPropertyEnableCheck
java.lang.Object
org.openjump.core.ui.enablecheck.BooleanPropertyEnableCheck
- All Implemented Interfaces:
EnableCheck
-
Constructor Summary
ConstructorsConstructorDescriptionBooleanPropertyEnableCheck(Object object, String checkMethodName) BooleanPropertyEnableCheck(Object object, String checkMethodName, boolean expectedValue) BooleanPropertyEnableCheck(Object object, String checkMethodName, boolean expectedValue, String disabledMessage) -
Method Summary
Modifier and TypeMethodDescriptioncheck(JComponent component) Returns a non-null value if the check failed.
-
Constructor Details
-
BooleanPropertyEnableCheck
-
BooleanPropertyEnableCheck
- 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 Details
-
check
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
-