|
Mantid
|
#include <SetDefaultWhenProperty.h>
Public Member Functions | |
| bool | applyChanges (const Mantid::Kernel::IPropertyManager *algo, const std::string ¤tPropName) override |
| If a new value should be set, the change is applied here. | |
| IPropertySettings * | clone () const override |
| Make a copy of the present type of IPropertySettings. | |
| std::vector< std::string > | dependsOn (const std::string &thisProp) const override |
| Other properties that this property depends on. | |
| bool | isConditionChanged (const IPropertyManager *algo, const std::string &changedPropName) const override |
| Return true when change criterion should be tested. | |
| SetDefaultWhenProperty (const std::string &watchedPropName, const std::function< bool(const Mantid::Kernel::IPropertyManager *, Property *, Property *)> &changeCriterion) | |
Constructs an SetDefaultWhenProperty instance which sets the dynamic-default value of a property when the changeCriterion function is satisfied. | |
Public Member Functions inherited from Mantid::Kernel::IPropertySettings | |
| IPropertySettings ()=default | |
| Constructor. | |
| virtual bool | isEnabled (const IPropertyManager *algo) const |
| Is the property to be shown as "enabled" in the GUI. | |
| virtual bool | isVisible (const IPropertyManager *algo) const |
| Is the property to be shown in the GUI? Default true. | |
| virtual | ~IPropertySettings ()=default |
| Destructor. | |
Private Attributes | |
| std::function< bool(const Mantid::Kernel::IPropertyManager *, Property *, Property *)> | m_changeCriterion |
| Criterion to determine if a new dynamic-default value should be set: in which case this function should modify the current property's value and return True, otherwise it should return False. | |
| std::string | m_watchedPropName |
| Name of the watched property. | |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::Kernel::IPropertySettings | |
| IPropertySettings (const IPropertySettings &)=default | |
Definition at line 21 of file SetDefaultWhenProperty.h.
|
inline |
Constructs an SetDefaultWhenProperty instance which sets the dynamic-default value of a property when the changeCriterion function is satisfied.
Definition at line 25 of file SetDefaultWhenProperty.h.
|
overridevirtual |
If a new value should be set, the change is applied here.
Return true if current property was changed.
Reimplemented from Mantid::Kernel::IPropertySettings.
Definition at line 42 of file SetDefaultWhenProperty.cpp.
References Mantid::Kernel::DateAndTimeHelpers::g_log, Mantid::Kernel::IPropertyManager::getPointerToProperty(), m_changeCriterion, m_watchedPropName, Mantid::Kernel::Property::setIsDynamicDefault(), and Mantid::Kernel::Logger::warning().
|
overridevirtual |
Make a copy of the present type of IPropertySettings.
Implements Mantid::Kernel::IPropertySettings.
Definition at line 78 of file SetDefaultWhenProperty.cpp.
|
overridevirtual |
Other properties that this property depends on.
Reimplemented from Mantid::Kernel::IPropertySettings.
Definition at line 72 of file SetDefaultWhenProperty.cpp.
References m_watchedPropName.
|
overridevirtual |
Return true when change criterion should be tested.
Return true if the changedPropName matches the watchedPropName.
| algo | :: Pointer to the algorithm containing the property |
| changedPropName | :: Name of the property that has just been changed |
Reimplemented from Mantid::Kernel::IPropertySettings.
Definition at line 36 of file SetDefaultWhenProperty.cpp.
References m_watchedPropName, and UNUSED_ARG.
|
private |
Criterion to determine if a new dynamic-default value should be set: in which case this function should modify the current property's value and return True, otherwise it should return False.
Definition at line 50 of file SetDefaultWhenProperty.h.
Referenced by applyChanges().
|
private |
Name of the watched property.
Definition at line 45 of file SetDefaultWhenProperty.h.
Referenced by applyChanges(), dependsOn(), and isConditionChanged().