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. More...
 
IPropertySettingsclone () const override
 Make a copy of the present type of validator. More...
 
bool isEnabled (const IPropertyManager *algo) const override
 Return true always as we only consider visible. More...
 
bool isVisible (const IPropertyManager *algo) const override
 Return true/false based on whether the other property satisfies the criterion. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
- Public Member Functions inherited from Mantid::Kernel::EnabledWhenProperty
virtual bool checkComparison (const IPropertyManager *algo) const
 Checks two EnabledWhenProperty objects match the logic operator specified and returns the result of both of them. More...
 
virtual bool checkCriterion (const IPropertyManager *algo) const
 Checks that the specified property matches the criteria given. More...
 
IPropertySettingsclone () const override
 Make a copy of the present type of validator. More...
 
 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. More...
 
 EnabledWhenProperty (const EnabledWhenProperty &other)
 Copy constructor. More...
 
 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. More...
 
 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. More...
 
bool isEnabled (const IPropertyManager *algo) const override
 Return true/false based on whether the other property satisfies the criterion. More...
 
bool isVisible (const IPropertyManager *algo) const override
 Return true always. More...
 
void modify_allowed_values (Property *const)
 Stub function to satisfy the interface. More...
 
- Public Member Functions inherited from Mantid::Kernel::IPropertySettings
virtual void applyChanges (const IPropertyManager *, Property *const)
 The function user have to overload it in their custom code to modify the property according to the changes to other properties. More...
 
virtual IPropertySettingsclone () const =0
 Make a copy of the present type of IPropertySettings. More...
 
 IPropertySettings ()=default
 Constructor. More...
 
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 More...
 
virtual bool isEnabled (const IPropertyManager *algo) const
 Is the property to be shown as "enabled" in the GUI. More...
 
virtual bool isVisible (const IPropertyManager *algo) const
 Is the property to be shown in the GUI? Default true. More...
 
virtual ~IPropertySettings ()=default
 Destructor. More...
 

Private Attributes

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

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. More...
 
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. More...
 
- 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. More...
 

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 20 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 33 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 50 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 64 of file VisibleWhenProperty.cpp.

References Mantid::Kernel::AND, 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 122 of file VisibleWhenProperty.cpp.

◆ 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 91 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 104 of file VisibleWhenProperty.cpp.

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

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 54 of file VisibleWhenProperty.h.

Referenced by checkComparison(), and isVisible().


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