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

Monitoring Row Changes

Instance Methods

ruleEditor:child:forCriterion:withRowType:

Returns the child of a given item at a given index. (required)

- (id)ruleEditor:(NSRuleEditor *)editor child:(NSInteger)index forCriterion:(id)criterion withRowType:(NSRuleEditorRowType)rowType
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 0 up to (but not including) the number of children, as reported by the delegate in ruleEditor:numberOfChildrenForCriterion:withRowType:.

criterion

The parent of the requested child, or nil if 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.h

ruleEditor:displayValueForCriterion:inRow:

Returns the value for a given criterion. (required)

- (id)ruleEditor:(NSRuleEditor *)editor displayValueForCriterion:(id)criterion inRow:(NSInteger)row
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.h

ruleEditor:numberOfChildrenForCriterion:withRowType:

Returns the number of child items of a given criterion or row type. (required)

- (NSInteger)ruleEditor:(NSRuleEditor *)editor numberOfChildrenForCriterion:(id)criterion withRowType:(NSRuleEditorRowType)rowType
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.h

ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:

Returns a dictionary representing the parts of the predicate determined by the given criterion and value.

- (NSDictionary *)ruleEditor:(NSRuleEditor *)editor predicatePartsForCriterion:(id)criterion withDisplayValue:(id)value inRow:(NSInteger)row
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.h

ruleEditorRowsDidChange:

Notifies the receiver that a rule editor’s rows changed.

- (void)ruleEditorRowsDidChange:(NSNotification *)notification
Parameters
notification

A notification namedNSRuleEditorRowsDidChangeNotification.

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