Lines Matching refs:predicate
132 # spotlightFriendlyPredicate:predicate
134 # This method will "clean up" an NSPredicate to make it ready for Spotlight, or return nil if the predicate can't be cleaned.
138 # - Any compound predicate (other than NOT) must have at least two subpredicates
140 def spotlightFriendlyPredicate_(self, predicate):
141 if predicate == NSPredicate.predicateWithValue_(True) or predicate == NSPredicate.predicateWithValue_(False):
144 elif isinstance(predicate, NSCompoundPredicate):
146 type = predicate.compoundPredicateType()
148 for dirtySubpredicate in predicate.subpredicates():
165 return predicate
168 # createNewSearchForPredicate:predicate:withTitle
171 def createNewSearchForPredicate_withTitle_(self, predicate, title):
172 if predicate is not None:
179 predicate = NSCompoundPredicate.andPredicateWithSubpredicates_(
180 [addrBookPredicate, predicate])
182 self.query.setPredicate_(predicate)
188 # This method gets called whenever the predicate editor changes.
189 # It is the action of our predicate editor and the single plate for all our updates.
207 predicate = self.predicateEditor.objectValue()
210 predicate = self.spotlightFriendlyPredicate_(predicate)
211 if predicate is not None:
215 predicate, title % searchIndex)
232 # The autoresizing masks, by default, allows the NSTableView to grow and keeps the predicate editor fixed.
233 # We need to temporarily grow the predicate editor, and keep the NSTableView fixed, so we have to change the autoresizing masks.