Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Kernel::VisibleWhenProperty Class Reference

Same as EnabledWhenProperty, but returns the value for the isVisible() property instead of the isEnabled() property. More...

#include <VisibleWhenProperty.h>

Inheritance diagram for Mantid::Kernel::VisibleWhenProperty:
Mantid::Kernel::EnabledWhenProperty Mantid::Kernel::IPropertySettings

Public Member Functions

virtual bool checkComparison (const IPropertyManager *algo) const override
 Checks two VisisbleWhenProperty objects to determine the result of both of them.
 
IPropertySettingsclone () const override
 Make a copy of the present type of validator.
 
std::vector< std::string > dependsOn (const std::string &thisProp) const override
 Other properties that this property depends on.
 
bool isEnabled (const IPropertyManager *algo) const override
 Return true always as we only consider visible.
 
bool isVisible (const IPropertyManager *algo) const override
 Return true/false based on whether the other property satisfies the criterion.
 
 VisibleWhenProperty (const std::string &otherPropName, ePropertyCriterion when, const std::string &value="")
 Constructs a VisibleWhenProperty object which checks the property with name given and if it matches the criteria makes it visible.
 
 VisibleWhenProperty (const VisibleWhenProperty &conditionOne, const VisibleWhenProperty &conditionTwo, eLogicOperator logicOperator)
 Constructs a VisibleWhenProperty object which copies two already constructed VisibleWhenProperty objects and returns the result of both of them with the specified logic operator.
 
 VisibleWhenProperty (std::shared_ptr< VisibleWhenProperty > &&conditionOne, std::shared_ptr< VisibleWhenProperty > &&conditionTwo, eLogicOperator logicOperator)
 Constructs a VisibleWhenProperty object which takes ownership of two already constructed VisibleWhenProperty objects and returns the result of both of them with the specified logic operator.
 
- Public Member Functions inherited from Mantid::Kernel::EnabledWhenProperty
virtual bool checkCriterion (const IPropertyManager *algo) const
 Checks that the specified property matches the criteria given.
 
 EnabledWhenProperty (const EnabledWhenProperty &conditionOne, const EnabledWhenProperty &conditionTwo, eLogicOperator logicOperator)
 Constructs a EnabledWhenProperty object which copies two already constructed EnabledWhenProperty objects and returns the result of both of them with the specified logic operator.
 
 EnabledWhenProperty (const EnabledWhenProperty &other)
 Copy constructor.
 
 EnabledWhenProperty (const std::string &otherPropName, const ePropertyCriterion when, const std::string &value="")
 Constructs a EnabledWhenProperty object which checks the property with name given and if it matches the criteria enables it.
 
 EnabledWhenProperty (std::shared_ptr< EnabledWhenProperty > &&conditionOne, std::shared_ptr< EnabledWhenProperty > &&conditionTwo, eLogicOperator logicOperator)
 Constructs a EnabledWhenProperty object which takes ownership of two already constructed EnabledWhenProperty objects and returns the result of both of them with the specified logic operator.
 
- Public Member Functions inherited from Mantid::Kernel::IPropertySettings
virtual bool applyChanges (const IPropertyManager *algo, const std::string &currentPropName)
 Overload this virtual function in order to modify the current property based on changes to other properties.
 
 IPropertySettings ()=default
 Constructor.
 
virtual bool isConditionChanged (const IPropertyManager *algo, const std::string &changedPropName="") const
 to verify if the properties, this one depends on have changed or other special condition occurs which needs the framework to react to
 
virtual ~IPropertySettings ()=default
 Destructor.
 

Private Attributes

std::shared_ptr< ComparisonDetails< VisibleWhenProperty > > m_comparisonDetails = nullptr
 Hold a copy of any existing VisibleWhenPropertyObjects.
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::Kernel::EnabledWhenProperty
 EnabledWhenProperty ()=default
 Protected Constructor for derived classes to skip setting up the comparator in the base class as they will handle it.
 
std::string getPropertyValue (const IPropertyManager *algo) const
 Checks the algorithm and property are both valid and attempts to get the value associated with the property.
 
- Protected Member Functions inherited from Mantid::Kernel::IPropertySettings
 IPropertySettings (const IPropertySettings &)=default
 
- Protected Attributes inherited from Mantid::Kernel::EnabledWhenProperty
std::shared_ptr< PropertyDetailsm_propertyDetails = nullptr
 Holds the various details used within the comparison.
 

Detailed Description

Same as EnabledWhenProperty, but returns the value for the isVisible() property instead of the isEnabled() property.

Definition at line 20 of file VisibleWhenProperty.h.

Constructor & Destructor Documentation

◆ VisibleWhenProperty() [1/3]

Mantid::Kernel::VisibleWhenProperty::VisibleWhenProperty ( const std::string &  otherPropName,
ePropertyCriterion  when,
const std::string &  value = "" 
)

Constructs a VisibleWhenProperty object which checks the property with name given and if it matches the criteria makes it visible.

Constructor.

Parameters
otherPropName:: Name of the OTHER property that we will check.
when:: Criterion to evaluate
value:: For the IS_EQUAL_TO or IS_NOT_EQUAL_TO condition, the value (as string) to check for

Definition at line 21 of file VisibleWhenProperty.cpp.

◆ VisibleWhenProperty() [2/3]

Mantid::Kernel::VisibleWhenProperty::VisibleWhenProperty ( const VisibleWhenProperty conditionOne,
const VisibleWhenProperty conditionTwo,
eLogicOperator  logicOperator 
)

Constructs a VisibleWhenProperty object which copies two already constructed VisibleWhenProperty objects and returns the result of both of them with the specified logic operator.

Multiple conditions constructor - takes two VisibleWhenProperty objects and returns the product of them with the specified logic operator.

Parameters
conditionOne:: First VisibleWhenProperty object to use
conditionTwo:: Second VisibleWhenProperty object to use
logicOperator:: The logic operator to apply across both conditions

Definition at line 34 of file VisibleWhenProperty.cpp.

◆ VisibleWhenProperty() [3/3]

Mantid::Kernel::VisibleWhenProperty::VisibleWhenProperty ( std::shared_ptr< VisibleWhenProperty > &&  conditionOne,
std::shared_ptr< VisibleWhenProperty > &&  conditionTwo,
eLogicOperator  logicOperator 
)

Constructs a VisibleWhenProperty object which takes ownership of two already constructed VisibleWhenProperty objects and returns the result of both of them with the specified logic operator.

Multiple conditions constructor - takes two shared pointers to VisibleWhenProperty objects and returns the product of them with the specified logic operator.

Parameters
conditionOne:: First VisibleWhenProperty object to use
conditionTwo:: Second VisibleWhenProperty object to use
logicOperator:: The logic operator to apply across both conditions

Definition at line 51 of file VisibleWhenProperty.cpp.

Member Function Documentation

◆ checkComparison()

bool Mantid::Kernel::VisibleWhenProperty::checkComparison ( const IPropertyManager algo) const
overridevirtual

Checks two VisisbleWhenProperty objects to determine the result of both of them.

Checks if the user specified combination of visible criterion returns a true or false value.

Parameters
algo:: Pointer to the algorithm containing the property
Returns
true if user specified combination was true.
Exceptions
Ifany problems was found

Reimplemented from Mantid::Kernel::EnabledWhenProperty.

Definition at line 65 of file VisibleWhenProperty.cpp.

References Mantid::Kernel::AND, isVisible(), m_comparisonDetails, Mantid::Kernel::OR, and Mantid::Kernel::XOR.

Referenced by isVisible().

◆ clone()

IPropertySettings * Mantid::Kernel::VisibleWhenProperty::clone ( ) const
overridevirtual

Make a copy of the present type of validator.

Clones the current VisibleWhenProperty object and returns a pointer to the new object.

The caller is responsible for deleting this pointer when finished

Returns
Pointer to cloned VisisbleWhenProperty object

Reimplemented from Mantid::Kernel::EnabledWhenProperty.

Definition at line 141 of file VisibleWhenProperty.cpp.

◆ dependsOn()

std::vector< std::string > Mantid::Kernel::VisibleWhenProperty::dependsOn ( const std::string &  thisProp) const
overridevirtual

Other properties that this property depends on.

Reimplemented from Mantid::Kernel::EnabledWhenProperty.

Definition at line 117 of file VisibleWhenProperty.cpp.

References m_comparisonDetails, and Mantid::Kernel::EnabledWhenProperty::m_propertyDetails.

◆ isEnabled()

bool Mantid::Kernel::VisibleWhenProperty::isEnabled ( const IPropertyManager algo) const
overridevirtual

Return true always as we only consider visible.

Returns true always in VisibleWhenProperty as we only consider visibility case.

Parameters
algo:: The pointer to the algorithm containing this property
Returns
:: True - Property is always enabled

Reimplemented from Mantid::Kernel::EnabledWhenProperty.

Definition at line 92 of file VisibleWhenProperty.cpp.

References UNUSED_ARG.

◆ isVisible()

bool Mantid::Kernel::VisibleWhenProperty::isVisible ( const IPropertyManager algo) const
overridevirtual

Return true/false based on whether the other property satisfies the criterion.

Returns true or false depending on whether the property or combination of properties specified satisfies the criterion.

Parameters
algo:: Pointer to the algorithm containing the property
Returns
:: True if conditions satisfied else false
Exceptions
:On an error condition such as property not being found

Reimplemented from Mantid::Kernel::EnabledWhenProperty.

Definition at line 105 of file VisibleWhenProperty.cpp.

References checkComparison(), Mantid::Kernel::EnabledWhenProperty::checkCriterion(), m_comparisonDetails, and Mantid::Kernel::EnabledWhenProperty::m_propertyDetails.

Referenced by checkComparison().

Member Data Documentation

◆ m_comparisonDetails

std::shared_ptr<ComparisonDetails<VisibleWhenProperty> > Mantid::Kernel::VisibleWhenProperty::m_comparisonDetails = nullptr
private

Hold a copy of any existing VisibleWhenPropertyObjects.

Definition at line 57 of file VisibleWhenProperty.h.

Referenced by checkComparison(), dependsOn(), and isVisible().


The documentation for this class was generated from the following files: