Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /XspfManager/XspfMRuleEditorDelegate.m

Parent Directory Parent Directory | Revision Log Revision Log


Revision 134 - (hide annotations) (download)
Mon Dec 7 11:06:29 2009 UTC (14 years, 4 months ago) by masaki
File size: 18591 byte(s)
[New] 数値による日付の条件を表示するようにした。
1 masaki 120 //
2     // XspfMRuleEditorDelegate.m
3     // XspfManager
4     //
5     // Created by Hori,Masaki on 09/11/28.
6     // Copyright 2009 masakih. All rights reserved.
7     //
8    
9     #import "XspfMRuleEditorDelegate.h"
10    
11     #import "XspfMRuleEditorRow.h"
12    
13     @implementation XspfMRuleEditorDelegate
14 masaki 125
15     static NSString *XspfMREDRowsKey = @"rows";
16     static NSString *XspfMREDCriteriaKey = @"criteria";
17     static NSString *XspfMREDDisplayValuesKey = @"displayValues";
18     static NSString *XspfMREDRowTypeKey = @"rowType";
19     static NSString *XspfMREDSubrowsKey = @"subrows";
20     static NSString *XspfMREDValueKey = @"value";
21     static NSString *XspfMREDPredicateRowsKey = @"predicateRows";
22     static NSString *XspfMREDNameKey = @"name";
23    
24     static NSString *XspfMStringPredicateIsEqualOperator = @"is";
25     static NSString *XspfMStringPredicateIsNotEqualOperator = @"is not";
26     static NSString *XspfMStringPredicateContainsOperator = @"contains";
27     static NSString *XspfMStringPredicateBeginsWithOperator = @"begins with";
28     static NSString *XspfMStringPredicateEndsWithOperator = @"ends with";
29    
30     //static NSString *XspfMAbDatePredicatePicker01 = @"date";
31     //static NSString *XspfMAbDatePredicatePicker02 = @"beginDate";
32     //static NSString *XspfMAbDatePredicatePicker03 = @"endDate";
33     //static NSString *XspfMAbDatePredicateIsEqualOperator = @"is the date";
34     //static NSString *XspfMAbDatePredicateLessThanOperator = @"is after the date";
35     //static NSString *XspfMAbDatePredicateGreaterThanOperator = @"is before the date";
36     //static NSString *XspfMAbDatePredicateBetweenOperator = @"is in the range";
37     //static NSString *XspfMAbDatePredicateAndField = @"andField";
38    
39    
40    
41 masaki 124 - (NSExpression *)rangeDateFromDisplayValues:(NSArray *)displayValues
42     {
43     id field01 = nil;
44     id field02 = nil;
45    
46     Class datepickerclass = [NSDatePicker class];
47     for(id v in displayValues) {
48     if([v isKindOfClass:datepickerclass]) {
49     if([v tag] == 0) {
50     field01 = v;
51     } else {
52     field02 = v;
53     }
54     }
55     }
56    
57     if(!field01 || !field02) return nil;
58    
59     id value01, value02;
60     value01 = [field01 dateValue]; value02 = [field02 dateValue];
61     if([value01 compare:value02] == NSOrderedDescending) {
62     id t = value02;
63     value02 = value01;
64     value01 = t;
65     }
66    
67     id expression01, expression02;
68 masaki 133 expression01 = [NSExpression expressionForConstantValue:value01];
69     expression02 = [NSExpression expressionForConstantValue:value02];
70 masaki 124
71     return [NSExpression expressionForAggregate:[NSArray arrayWithObjects:expression01, expression02, nil]];
72     }
73 masaki 132 - (NSExpression *)relatedDate:(NSNumber *)typeValue
74     {
75     NSString *variable = nil;
76     NSInteger type = [typeValue integerValue];
77     switch(type) {
78     case 0:
79     variable = @"TODAY";
80     break;
81     case 1:
82     variable = @"YESTERDAY";
83     break;
84     case 2:
85     variable = @"THISWEEK";
86     break;
87     case 3:
88     variable = @"LASTWEEK";
89     break;
90     }
91    
92     return [NSExpression expressionForVariable:variable];
93     }
94    
95 masaki 124 - (NSView *)textField
96     {
97     id text = [[[NSTextField alloc] initWithFrame:NSMakeRect(0,0,100,19)] autorelease];
98     [[text cell] setControlSize:NSSmallControlSize];
99     [text setFont:[NSFont controlContentFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
100 masaki 126 [text setStringValue:@"1234567890"];
101 masaki 124 [text sizeToFit];
102     [text setStringValue:@""];
103     [text setDelegate:self];
104    
105     return text;
106     }
107     - (NSView *)datePicker
108     {
109     id date = [[[NSDatePicker alloc] initWithFrame:NSMakeRect(0,0,100,19)] autorelease];
110     [[date cell] setControlSize:NSSmallControlSize];
111     [date setFont:[NSFont controlContentFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
112     [date setDatePickerElements:NSYearMonthDayDatePickerElementFlag];
113     [date setDrawsBackground:YES];
114     [date setDateValue:[NSDate dateWithTimeIntervalSinceNow:0.0]];
115     [date sizeToFit];
116     [date setDelegate:self];
117    
118     return date;
119     }
120     - (NSView *)ratingIndicator
121     {
122     id rate = [[[NSLevelIndicator alloc] initWithFrame:NSMakeRect(0,0,100,19)] autorelease];
123     id cell = [rate cell];
124     [cell setControlSize:NSSmallControlSize];
125     [rate setFont:[NSFont controlContentFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
126     [rate setMinValue:0];
127     [rate setMaxValue:5];
128     [cell setLevelIndicatorStyle:NSRatingLevelIndicatorStyle];
129     [cell setEditable:YES];
130     [rate sizeToFit];
131    
132     return rate;
133     }
134     - (NSView *)numberField
135     {
136 masaki 134 id text = [[[NSTextField alloc] initWithFrame:NSMakeRect(0,0,100,19)] autorelease];
137     [[text cell] setControlSize:NSSmallControlSize];
138     [text setFont:[NSFont controlContentFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]];
139     [text setStringValue:@"123"];
140     NSNumberFormatter *formatter = [[[NSNumberFormatter alloc] init] autorelease];
141     [formatter setNumberStyle:NSNumberFormatterDecimalStyle];
142     [formatter setMinimum:[NSNumber numberWithInt:0]];
143     [text setFormatter:formatter];
144     [text sizeToFit];
145     [text setStringValue:@"1"];
146     [text setDelegate:self];
147    
148     return text;
149 masaki 124 }
150    
151 masaki 128
152 masaki 124 - (NSDictionary *)buildRows:(NSArray *)template
153     {
154     NSMutableDictionary *result = [NSMutableDictionary dictionary];
155     for(id row in template) {
156 masaki 125 id criteria = [row valueForKey:XspfMREDCriteriaKey];
157     id name = [row valueForKey:XspfMREDNameKey];
158 masaki 124 [result setObject:criteria forKey:name];
159     }
160    
161     return result;
162     }
163 masaki 126 - (id)criteriaWithKeyPath:(NSString *)keypath
164     {
165     NSString *key = nil;
166     if([keypath isEqualToString:@"title"]) {
167     key = @"String";
168     } else if([keypath isEqualToString:@"rating"]) {
169     key = @"Rate";
170     }
171     if(key) {
172     id row = [rowTemplate valueForKey:key];
173 masaki 133 id c = [[[row objectAtIndex:0] mutableCopy] autorelease];
174 masaki 126 [c setValue:keypath forKey:XspfMREDValueKey];
175     return [NSArray arrayWithObject:c];
176     }
177    
178     if([[NSArray arrayWithObjects:@"lastPlayDate", @"modificationDate", @"creationDate", nil] containsObject:keypath]) {
179 masaki 132 id keys = [NSArray arrayWithObjects:@"AbDate", /*@"RlDate",*/ nil];
180 masaki 126 id result = [NSMutableArray array];
181     for(key in keys) {
182     id row = [rowTemplate valueForKey:key];
183 masaki 133 id c = [[[row objectAtIndex:0] mutableCopy] autorelease];
184 masaki 126 [c setValue:keypath forKey:XspfMREDValueKey];
185     [result addObject:c];
186     }
187    
188     return result;
189     }
190    
191     return nil;
192     }
193 masaki 120 - (void)awakeFromNib
194     {
195     if(!compound) {
196     compound = [[XspfMCompound alloc] init];
197     }
198 masaki 124
199     rowIDs = [[NSMutableArray array] retain];
200     rowFields = [[NSMutableDictionary dictionary] retain];
201    
202     NSBundle *m = [NSBundle mainBundle];
203     NSString *path = [m pathForResource:@"LibraryRowTemplate" ofType:@"plist"];
204     NSArray *rowsTemplate = [NSArray arrayWithContentsOfFile:path];
205     if(!rowsTemplate) {
206     exit(12345);
207 masaki 120 }
208 masaki 124
209     rowTemplate = [[self buildRows:rowsTemplate] retain];
210    
211     // NSLog(@"rowTemplate =>\n%@", rowTemplate);
212    
213     NSMutableArray *newRows = [NSMutableArray array];
214    
215 masaki 126 id c = [self criteriaWithKeyPath:@"title"];
216     if(c) [newRows addObjectsFromArray:c];
217 masaki 124
218     for(id keyPath in [NSArray arrayWithObjects:@"lastPlayDate", @"modificationDate", @"creationDate", nil]) {
219 masaki 126 c = [self criteriaWithKeyPath:keyPath];
220     if(c) [newRows addObjectsFromArray:c];
221 masaki 124 }
222    
223 masaki 126 c = [self criteriaWithKeyPath:@"rating"];
224     if(c) [newRows addObjectsFromArray:c];
225 masaki 124
226     rows = [newRows retain];
227 masaki 125
228    
229    
230     ////
231     predicateRows = [[NSMutableArray alloc] init];
232     [ruleEditor bind:XspfMREDRowsKey toObject:self withKeyPath:XspfMREDPredicateRowsKey options:nil];
233 masaki 120 }
234    
235 masaki 127 - (NSArray *)displayValuesWithPredicate:(NSComparisonPredicate *)predicate
236     {
237     id value02 = nil; id value03 = nil;
238     id leftKeyPath = [[predicate leftExpression] keyPath];
239    
240     switch([predicate predicateOperatorType]) {
241     case NSEqualToPredicateOperatorType:
242     value02 = XspfMStringPredicateIsEqualOperator;
243     break;
244     case NSNotEqualToPredicateOperatorType:
245     value02 = XspfMStringPredicateIsNotEqualOperator;
246     break;
247     case NSContainsPredicateOperatorType:
248     value02 = XspfMStringPredicateContainsOperator;
249     break;
250     case NSBeginsWithPredicateOperatorType:
251     value02 = XspfMStringPredicateBeginsWithOperator;
252     break;
253     case NSEndsWithPredicateOperatorType:
254     value02 = XspfMStringPredicateEndsWithOperator;
255     break;
256     }
257     id rightConstant = [[predicate rightExpression] constantValue];
258     value03 = [self textField];
259     [value03 setObjectValue:rightConstant];
260    
261     id disp = [NSArray arrayWithObjects:leftKeyPath, value02, value03, nil];
262    
263     return disp;
264     }
265     - (NSArray *)ratingDisplayValuesWithPredicate:(NSComparisonPredicate *)predicate
266     {
267     id value02 = nil; id value03 = nil;
268     id leftKeyPath = [[predicate leftExpression] keyPath];
269    
270     switch([predicate predicateOperatorType]) {
271     case NSEqualToPredicateOperatorType:
272     value02 = XspfMStringPredicateIsEqualOperator;
273     break;
274     case NSGreaterThanPredicateOperatorType:
275     value02 = @"is greater than";
276     break;
277     case NSLessThanPredicateOperatorType:
278     value02 = @"is less than";
279     break;
280     }
281     id rightConstant = [[predicate rightExpression] constantValue];
282     value03 = [self ratingIndicator];
283     [value03 setObjectValue:rightConstant];
284    
285     id disp = [NSArray arrayWithObjects:leftKeyPath, value02, value03, nil];
286    
287     return disp;
288     }
289 masaki 132 - (NSArray *)dateRangeDisplayValuesWithPredicate:(NSComparisonPredicate *)predicate
290     {
291     id leftKeyPath = [[predicate leftExpression] keyPath];
292     id rightVar = [[predicate rightExpression] variable];
293    
294     id value02 = nil;
295     id value03 = nil;
296     id value04 = nil;
297     id value05 = nil;
298     id value06 = nil;
299     id value07 = nil;
300    
301     if([rightVar isEqualToString:@"TODAY"]) {
302     value02 = @"is today";
303     } else if([rightVar isEqualToString:@"YESTERDAY"]) {
304     value02 = @"is yesterday";
305     } else if([rightVar isEqualToString:@"THISWEEK"]) {
306     value02 = @"is this week";
307     } else if([rightVar isEqualToString:@"LASTWEEK"]) {
308     value02 = @"is last week";
309     }
310    
311     return [NSArray arrayWithObjects:leftKeyPath, value02, value03, value04, value05, value06, value07, nil];
312     }
313    
314 masaki 127 - (NSArray *)dateDisplayValuesWithPredicate:(NSComparisonPredicate *)predicate
315     {
316     id value02 = nil; id value03 = nil;
317     id leftKeyPath = [[predicate leftExpression] keyPath];
318    
319     switch([predicate predicateOperatorType]) {
320     case NSEqualToPredicateOperatorType:
321     value02 = @"is the date";
322     break;
323     case NSGreaterThanPredicateOperatorType:
324     value02 = @"is after the date";
325     break;
326     case NSLessThanPredicateOperatorType:
327     value02 = @"is before the date";
328     break;
329     case NSBetweenPredicateOperatorType:
330     return [self dateRangeDisplayValuesWithPredicate:predicate];
331    
332     }
333     id rightConstant = [[predicate rightExpression] constantValue];
334     value03 = [self datePicker];
335     [value03 setObjectValue:rightConstant];
336    
337     id disp = [NSArray arrayWithObjects:leftKeyPath, value02, value03, nil];
338    
339     return disp;
340     }
341    
342 masaki 125 - (id)buildRowsFromPredicate:(id)predicate
343     {
344     if([predicate isKindOfClass:[NSCompoundPredicate class]]) {
345     id subrows = [NSMutableArray array];
346    
347     id value = nil;
348     switch([predicate compoundPredicateType]) {
349     case NSNotPredicateType:
350     // ?
351     break;
352     case NSAndPredicateType:
353     value = @"All";
354     break;
355     case NSOrPredicateType:
356     value = @"Any";
357     break;
358     }
359    
360     #warning MUST IMPLEMENT!!
361     NSArray *sub = [predicate subpredicates];
362     for(id p in sub) {
363     [subrows addObject:[self buildRowsFromPredicate:p]];
364     }
365    
366     id criteria = [NSArray arrayWithObjects:value, @"of the following are true", nil];
367 masaki 127 id type = [NSNumber numberWithInt:NSRuleEditorRowTypeCompound];
368 masaki 125
369     id result = [NSMutableDictionary dictionaryWithObjectsAndKeys:
370     criteria, XspfMREDCriteriaKey,
371     criteria, XspfMREDDisplayValuesKey,
372     type, XspfMREDRowTypeKey,
373     subrows, XspfMREDSubrowsKey,
374     nil];
375    
376     return result;
377     } else if([predicate isKindOfClass:[NSComparisonPredicate class]]) {
378     id leftKeyPath = [[predicate leftExpression] keyPath];
379     if(!leftKeyPath) return [NSArray array];
380 masaki 128
381     NSArray *disp = nil;
382 masaki 127 if([leftKeyPath isEqualToString:@"title"]) {
383 masaki 128 disp = [self displayValuesWithPredicate:predicate];
384 masaki 125 }
385 masaki 127 if([leftKeyPath isEqualToString:@"rating"]) {
386 masaki 128 disp = [self ratingDisplayValuesWithPredicate:predicate];
387 masaki 127 }
388 masaki 132 if([[NSArray arrayWithObjects:@"lastPlayDate", @"modificationDate", @"creationDate", nil] containsObject:leftKeyPath]) {
389 masaki 128 disp = [self dateDisplayValuesWithPredicate:predicate];
390     }
391    
392     if(disp) {
393 masaki 127 NSArray *row = [self criteriaWithKeyPath:leftKeyPath];
394     NSMutableDictionary *criterion = [NSMutableDictionary dictionaryWithObjectsAndKeys:
395     row, XspfMREDCriteriaKey,
396     disp, XspfMREDDisplayValuesKey,
397     [NSNumber numberWithInt:NSRuleEditorRowTypeSimple], XspfMREDRowTypeKey,
398     nil];
399     return criterion;
400     }
401 masaki 125
402     } else if([predicate isKindOfClass:[NSPredicate class]]) {
403     NSLog(@"--> %@", predicate);
404     } else {
405     NSLog(@"???predicate class is %@", NSStringFromClass([predicate class]));
406     }
407    
408     return [NSArray array];
409     }
410 masaki 123 - (void)setPredicate:(id)predicate
411     {
412 masaki 126 NSLog(@"predicate -> (%@) %@", NSStringFromClass([predicate class]), predicate);
413 masaki 123
414 masaki 125 id hoge = [self buildRowsFromPredicate:predicate];
415     id new = [NSArray arrayWithObject:hoge];
416    
417     [self willChangeValueForKey:XspfMREDPredicateRowsKey];
418     [predicateRows release];
419     predicateRows = [new retain];
420     [self didChangeValueForKey:XspfMREDPredicateRowsKey];
421     [ruleEditor reloadCriteria];
422 masaki 123 }
423 masaki 125 - (void)setPredicateRows:(id)p
424     {
425     NSLog(@"new -> %@", p);
426     [predicateRows release];
427     predicateRows = [p retain];
428     }
429    
430     #pragma mark#### NSRleEditor Delegate ####
431 masaki 124 - (NSInteger)ruleEditor:(NSRuleEditor *)editor
432     numberOfChildrenForCriterion:(id)criterion
433     withRowType:(NSRuleEditorRowType)rowType
434     {
435     NSInteger result = 0;
436    
437     if(rowType == NSRuleEditorRowTypeCompound) {
438     return [compound numberOfChildrenForChild:criterion];
439     }
440    
441     if(!criterion) {
442     result = [rows count];
443     } else {
444 masaki 125 result = [[criterion valueForKey:XspfMREDCriteriaKey] count];
445 masaki 124 }
446    
447     // NSLog(@"numner\tcriterion -> %@, type -> %d, result -> %d", criterion, rowType, result);
448    
449     return result;
450     }
451    
452     - (id)ruleEditor:(NSRuleEditor *)editor
453     child:(NSInteger)index
454     forCriterion:(id)criterion
455     withRowType:(NSRuleEditorRowType)rowType
456     {
457     id result = nil;
458    
459     if(rowType == NSRuleEditorRowTypeCompound) {
460     return [compound childForChild:criterion atIndex:index];
461     }
462    
463     if(!criterion) {
464     result = [rows objectAtIndex:index];
465     } else {
466 masaki 125 result = [[criterion valueForKey:XspfMREDCriteriaKey] objectAtIndex:index];
467 masaki 124 }
468    
469     // NSLog(@"child\tindex -> %d, criterion -> %@, type -> %d, result -> %@", index, criterion, rowType, result);
470    
471     return result;
472     }
473     - (id)ruleEditor:(NSRuleEditor *)editor
474     displayValueForCriterion:(id)criterion
475     inRow:(NSInteger)row
476     {
477     id result = nil;
478    
479     NSRuleEditorRowType rowType = [editor rowTypeForRow:row];
480     if(rowType == NSRuleEditorRowTypeCompound) {
481     return [compound displayValueForChild:criterion];
482     }
483    
484     if(!criterion) {
485     //
486     } else {
487 masaki 125 result = [criterion valueForKey:XspfMREDValueKey];
488 masaki 124 }
489    
490 masaki 132 if([result isEqualToString:@"separator"]) {
491     return [NSMenuItem separatorItem];
492     }
493    
494 masaki 124 // create or find field object.
495     do {
496     Class searchClass = Nil;
497     SEL defaultSEL = Nil;
498     NSInteger tag = 0;
499    
500 masaki 125 if([result hasPrefix:@"textField"]) {
501 masaki 124 searchClass = [NSTextField class];
502     defaultSEL = @selector(textField);
503     } else if([result hasPrefix:@"dateField"]) {
504     searchClass = [NSDatePicker class];
505     defaultSEL = @selector(datePicker);
506     if(![result isEqualToString:@"dateField"]) { // result == dateField02
507     tag = 1000;
508     }
509     } else if([result hasPrefix:@"rateField"]) {
510     searchClass = [NSLevelIndicator class];
511     defaultSEL = @selector(ratingIndicator);
512 masaki 134 } else if([result hasPrefix:@"numberField"]) {
513     searchClass = [NSTextField class];
514     defaultSEL = @selector(numberField);
515     if([result isEqualToString:@"numberField"]) {
516     tag = 2000;
517     } else { // result == numberField02
518     tag = 2100;
519     }
520 masaki 124 }
521     if(!searchClass) break;
522    
523     id displayValues = [editor displayValuesForRow:row];
524     id field = nil;
525     for(id v in displayValues) {
526     if([v isKindOfClass:searchClass] && [v tag] == tag) {
527     field = v;
528     }
529     }
530     result = field ? field :[self performSelector:defaultSEL];
531     if(tag != 0) [result setTag:tag];
532     } while(NO);
533    
534     // NSLog(@"display\tcriterion -> %@, row -> %d, result -> %@", criterion, row, result);
535    
536     return result;
537     }
538     - (NSDictionary *)ruleEditor:(NSRuleEditor *)editor
539     predicatePartsForCriterion:(id)criterion
540     withDisplayValue:(id)displayValue
541     inRow:(NSInteger)row
542     {
543     id result = nil;
544    
545     NSRuleEditorRowType rowType = [editor rowTypeForRow:row];
546     if(rowType == NSRuleEditorRowTypeCompound) {
547     return [compound predicateForChild:criterion withDisplayValue:displayValue];
548     }
549    
550 masaki 132 if([criterion valueForKey:@"XspfMIgnoreExpression"]) return nil;
551    
552 masaki 124 result = [NSMutableDictionary dictionary];
553 masaki 132
554 masaki 124 if([criterion valueForKey:@"NSRuleEditorPredicateOperatorType"]) {
555     [result setValue:[criterion valueForKey:@"NSRuleEditorPredicateOperatorType"] forKey:@"NSRuleEditorPredicateOperatorType"];
556     }
557     if([criterion valueForKey:@"NSRuleEditorPredicateOptions"]) {
558     [result setValue:[criterion valueForKey:@"NSRuleEditorPredicateOptions"] forKey:@"NSRuleEditorPredicateOptions"];
559     }
560     if([criterion valueForKey:@"NSRuleEditorPredicateLeftExpression"]) {
561     id value = [criterion valueForKey:@"NSRuleEditorPredicateLeftExpression"];
562     id exp = nil;
563 masaki 125 if([value isEqual:XspfMREDValueKey]) {
564 masaki 124 exp = [NSExpression expressionForKeyPath:displayValue];
565     } else {
566     exp = [NSExpression expressionForKeyPath:[criterion valueForKey:@"NSRuleEditorPredicateLeft"]];
567     }
568     if(exp) {
569     [result setValue:exp forKey:@"NSRuleEditorPredicateLeftExpression"];
570     }
571     }
572     if([criterion valueForKey:@"NSRuleEditorPredicateRightExpression"]) {
573     id selector = [criterion valueForKey:@"NSRuleEditorPredicateRightExpression"];
574     id exp = nil;
575     if(NSSelectorFromString(selector)) {
576     exp = [NSExpression expressionForConstantValue:[displayValue performSelector:NSSelectorFromString(selector)]];
577     } else {
578     exp = [NSExpression expressionForConstantValue:[criterion valueForKey:@"NSRuleEditorPredicateRightExpression"]];
579     }
580     if(exp) {
581     [result setValue:exp forKey:@"NSRuleEditorPredicateRightExpression"];
582     }
583     }
584     if([criterion valueForKey:@"XspfMPredicateRightExpression"]) {
585     SEL selector = NSSelectorFromString([criterion valueForKey:@"XspfMPredicateRightExpression"]);
586     id arg01 = [criterion valueForKey:@"XspfMRightExpressionArg01"];
587     // id arg02 = [criterion valueForKey:@"XspfMRightExpressionArg02"];
588    
589     if(arg01) {
590 masaki 132 if([arg01 isEqual:XspfMREDDisplayValuesKey]) {
591 masaki 124 arg01 = [editor displayValuesForRow:row];
592     }
593     id r = [self performSelector:selector withObject:arg01];
594     [result setValue:r forKey:@"NSRuleEditorPredicateRightExpression"];
595     } else {
596     id r = [self performSelector:selector];
597     [result setValue:r forKey:@"NSRuleEditorPredicateRightExpression"];
598     }
599     }
600    
601 masaki 125 // NSLog(@"predicate\tcriterion -> %@, value -> %@, row -> %d, result -> %@", criterion, displayValue, row, result);
602 masaki 124
603     return result;
604     }
605     - (void)ruleEditorRowsDidChange:(NSNotification *)notification
606     {
607     //
608     }
609    
610 masaki 120 @end

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26