NSRuleEditorDelegate Protocol Reference
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.6 and later. |
| Declared in | NSRuleEditor.h |
| Companion guides |
Overview
The NSRuleEditorDelegate protocol defines the optional methods implemented by delegates of NSRuleEditor objects.
Tasks
Providing Data
-
– ruleEditor:child:forCriterion:withRowType:required method -
– ruleEditor:displayValueForCriterion:inRow:required method -
– ruleEditor:numberOfChildrenForCriterion:withRowType:required method -
– ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:
Monitoring Row Changes
Instance Methods
ruleEditor:child:forCriterion:withRowType:
Returns the child of a given item at a given index. (required)
Parameters
- editor
The rule editor that sent the message.
- index
The index of the requested child criterion. This value must be in the range from
0up to (but not including) the number of children, as reported by the delegate inruleEditor:numberOfChildrenForCriterion:withRowType:.- criterion
The parent of the requested child, or
nilif the rule editor is requesting a root criterion.- rowType
The type of the row.
Return Value
An object representing the requested child (or root) criterion. This object is used by the delegate to represent that position in the tree, and is passed as a parameter in subsequent calls to the delegate.
Special Considerations
The delegate must implement this method.
Availability
- Available in OS X v10.5 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSRuleEditor.hruleEditor:displayValueForCriterion:inRow:
Returns the value for a given criterion. (required)
Parameters
- editor
The rule editor that sent the message.
- criterion
The criterion for which the value is required.
- row
The row number of criterion.
Return Value
The value for criterion.
Discussion
The value should be an instance of NSString, NSView, or NSMenuItem. If the value is an NSView or NSMenuItem, you must ensure it is unique for every invocation of this method; that is, do not return a particular instance of NSView or NSMenuItem more than once.
Special Considerations
The delegate must implement this method.
Availability
- Available in OS X v10.5 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSRuleEditor.hruleEditor:numberOfChildrenForCriterion:withRowType:
Returns the number of child items of a given criterion or row type. (required)
Parameters
- editor
The rule editor that sent the message.
- criterion
The criterion for which the number of children is required.
- rowType
The type of row of criterion.
Return Value
The number of child items of criterion. If criterion is nil, return the number of root criteria for the row type rowType.
Special Considerations
The delegate must implement this method.
Availability
- Available in OS X v10.5 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSRuleEditor.hruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:
Returns a dictionary representing the parts of the predicate determined by the given criterion and value.
Parameters
- editor
The rule editor that sent the message.
- criterion
The criterion for which the predicate parts are required.
- value
The display value.
- row
The row number of criterion.
Return Value
A dictionary representing the parts of the predicate determined by the given criterion and value. The keys of the dictionary should be the string constants specified in Predicate Part Keys with corresponding appropriate values.
Availability
- Available in OS X v10.5 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSRuleEditor.hruleEditorRowsDidChange:
Notifies the receiver that a rule editor’s rows changed.
Parameters
- notification
A notification named
NSRuleEditorRowsDidChangeNotification.
Discussion
If the delegate implements this method, NSRuleEditor automatically registers its delegate to receive NSRuleEditorRowsDidChangeNotification notifications.
Availability
- Available in OS X v10.5 and later.
- Available as part of an informal protocol prior to OS X v10.6.
Declared In
NSRuleEditor.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-04-30)