Mac Developer Library

Developer

AppKit Framework Reference NSRuleEditorDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSRuleEditorDelegate

The NSRuleEditorDelegate protocol defines the optional methods implemented by delegates of NSRuleEditor objects.

Inheritance


Not Applicable

Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.6 and later.
  • Returns the child of a given item at a given index. (required)

    Declaration

    Swift

    func ruleEditor(_ editor: NSRuleEditor, child index: Int, forCriterion criterion: AnyObject?, withRowType rowType: NSRuleEditorRowType) -> AnyObject!

    Objective-C

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    Available as part of an informal protocol prior to OS X v10.6.

  • Returns the value for a given criterion. (required)

    Declaration

    Swift

    func ruleEditor(_ editor: NSRuleEditor, displayValueForCriterion criterion: AnyObject!, inRow row: Int) -> AnyObject!

    Objective-C

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    Available as part of an informal protocol prior to OS X v10.6.

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

    Declaration

    Swift

    func ruleEditor(_ editor: NSRuleEditor, numberOfChildrenForCriterion criterion: AnyObject!, withRowType rowType: NSRuleEditorRowType) -> Int

    Objective-C

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    Available as part of an informal protocol prior to OS X v10.6.

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

    Declaration

    Swift

    optional func ruleEditor(_ editor: NSRuleEditor, predicatePartsForCriterion criterion: AnyObject!, withDisplayValue value: AnyObject!, inRow row: Int) -> [NSObject : AnyObject]!

    Objective-C

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    Available as part of an informal protocol prior to OS X v10.6.