forked from pmougin/F-Script
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathFSObjectBrowserView.m
2061 lines (1760 loc) · 85.8 KB
/
FSObjectBrowserView.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// FSObjectBrowserView.m Copyright (c) 2001-2009 Philippe Mougin.
// This software is open source. See the license.
#import "FSObjectBrowserView.h"
#import "FSObjectBrowserViewObjectInfo.h"
#import <objc/objc-class.h>
#import <objc/objc.h>
#import "FSCompiler.h"
#import "FSExecEngine.h"
#import "FSInterpreterPrivate.h"
#import "FSNSObject.h"
#import "FSArray.h"
#import "FSObjectBrowserCell.h"
#import "FSMiscTools.h"
#import "BlockStackElem.h"
#import "BlockPrivate.h"
#import "BlockInspector.h"
#import "FSMiscTools.h"
#import "FSNewlyAllocatedObjectHolder.h"
#import "ArrayRepId.h"
#import "FSObjectBrowserArgumentPanel.h"
#import "FScriptTextView.h"
#import "FSGenericObjectInspector.h"
#import "FSSystem.h"
#import "FSObjectBrowserButtonCtxBlock.h"
#import "FSObjectBrowserToolbarButton.h"
#import "FSNSString.h"
#import "FSIdentifierFormatter.h"
#import "FSCollectionInspector.h"
#import "FSBoolean.h"
#import "FSNamedNumber.h"
#import "PointerPrivate.h"
#import "FSObjectBrowserMatrix.h"
#import "PointerPrivate.h"
#import "FSObjectBrowserNamedObjectWrapper.h"
#import "FSVoid.h"
#import "FSAssociation.h"
#import "FSObjectBrowserBottomBarTextDisplay.h"
#define ESCAPE '\033'
const int FSObjectBrowserBottomBarHeight = 22;
static Class NSManagedObjectClass;
/*
static int compareClassesForAlphabeticalOrder(id class1, id class2, void *context)
{
NSString *class1String = printString(class1);
NSString *class2String = printString(class2);
if ([class1String hasPrefix:@"%"] && ![class2String hasPrefix:@"%"])
return NSOrderedDescending;
else if ([class2String hasPrefix:@"%"] && ![class1String hasPrefix:@"%"])
return NSOrderedAscending;
else
return [class1String compare:class2String];
}
*/
static FSObjectBrowserCell *addRowToMatrix(NSMatrix *matrix)
{
// Since we reuse cells when filtering (because we use renewRows:columns:), we must
// ensure that they are correctly set-up when reused. This is the job of this function.
FSObjectBrowserCell *cell;
// For an unknown reason, the following does not correctly maintain the selection:
// ***********
// int numberOfRows = [matrix numberOfRows];
// [matrix renewRows:numberOfRows+1 columns:1];
// cell = [matrix cellAtRow:numberOfRows column:0];
// ***********
// We do the folowing instead:
// ***********
[matrix addRow];
cell = [matrix cellAtRow:[matrix numberOfRows]-1 column:0];
// ***********
[cell setLeaf:NO];
[cell setEnabled:YES];
[cell setObjectValue:nil];
[cell setObjectBrowserCellType:FSOBUNKNOWN];
[cell setClassLabel:nil];
[cell setLabel:nil];
[cell setRepresentedObject:nil];
return cell;
}
NSInteger FSCompareClassNamesForAlphabeticalOrder(NSString *className1, NSString *className2, void *context)
{
if ([className1 hasPrefix:@"%"] && ![className2 hasPrefix:@"%"])
return NSOrderedDescending;
else if ([className2 hasPrefix:@"%"] && ![className1 hasPrefix:@"%"])
return NSOrderedAscending;
else
return [className1 caseInsensitiveCompare:className2];
}
static NSInteger FSCompareMethodsNamesForAlphabeticalOrder(NSString *m1, NSString *m2, void *context)
{
if ([m1 hasPrefix:@"_"] && ![m2 hasPrefix:@"_"])
return NSOrderedDescending;
else if ([m2 hasPrefix:@"_"] && ![m1 hasPrefix:@"_"])
return NSOrderedAscending;
else
return [m1 caseInsensitiveCompare:m2];
}
static NSString *printStringForObjectBrowser(id object)
{
NSString *entityName;
NSString *result = nil;
@try
{
if (NSManagedObjectClass && [object isKindOfClass:NSManagedObjectClass] && (entityName = [[object entity] name]) != nil)
{
result = [@"Managed object: " stringByAppendingString:entityName];
}
}
@catch (id exception)
{
result = [NSString stringWithFormat:@"*** Non printable object. The following exception was raised when "
@"trying to get a textual representation of the object: %@"
,FSErrorMessageFromException(exception)];
}
if (!result)
{
result = printStringLimited(object, 1000);
if ([result length] > 510)
result = [[result substringWithRange:NSMakeRange(0,500)] stringByAppendingString:@" ..."];
}
return result;
}
static NSString *humanReadableFScriptTypeDescriptionFromEncodedObjCType(const char *ptr)
{
while (*ptr == 'r' || *ptr == 'n' || *ptr == 'N' || *ptr == 'o' || *ptr == 'O' || *ptr == 'R' || *ptr == 'V')
ptr++;
if (strcmp(ptr,@encode(id)) == 0) return @"";
else if (strcmp(ptr,@encode(char)) == 0) return @"";
else if (strcmp(ptr,@encode(int)) == 0) return @"int";
else if (strcmp(ptr,@encode(short)) == 0) return @"short";
else if (strcmp(ptr,@encode(long)) == 0) return @"long";
else if (strcmp(ptr,@encode(long long)) == 0) return @"long long";
else if (strcmp(ptr,@encode(unsigned char)) == 0) return @"unsigned char";
else if (strcmp(ptr,@encode(unsigned short)) == 0) return @"unsigned short";
else if (strcmp(ptr,@encode(unsigned int)) == 0) return @"unsigned int";
else if (strcmp(ptr,@encode(unsigned long)) == 0) return @"unsigned long";
else if (strcmp(ptr,@encode(unsigned long long)) == 0) return @"unsigned long long";
else if (strcmp(ptr,@encode(float)) == 0) return @"float";
else if (strcmp(ptr,@encode(double)) == 0) return @"double";
else if (strcmp(ptr,@encode(char *)) == 0) return @"pointer";
else if (strcmp(ptr,@encode(SEL)) == 0) return @"SEL";
else if (strcmp(ptr,@encode(Class)) == 0) return @"Class";
else if (strcmp(ptr,@encode(NSRange)) == 0) return @"NSRange";
else if (strcmp(ptr,@encode(NSPoint)) == 0) return @"NSPoint";
else if (strcmp(ptr,@encode(NSSize)) == 0) return @"NSSize";
else if (strcmp(ptr,@encode(NSRect)) == 0) return @"NSRect";
else if (strcmp(ptr,@encode(CGPoint)) == 0) return @"CGPoint";
else if (strcmp(ptr,@encode(CGSize)) == 0) return @"CGSize";
else if (strcmp(ptr,@encode(CGRect)) == 0) return @"CGRect";
else if (strcmp(ptr,@encode(CGAffineTransform)) == 0) return @"CGAffineTransform";
else if (strcmp(ptr,@encode(_Bool)) == 0) return @"boolean";
else if (*ptr == '{')
{
NSMutableString *structName = [NSMutableString string];
ptr++;
while (isalnum(*ptr) || *ptr == '_')
{
[structName appendString:[[[NSString alloc] initWithBytes:ptr length:1 encoding:NSASCIIStringEncoding] autorelease]];
ptr++;
}
if (*ptr == '=' && ![structName isEqualToString:@""])
return [@"struct " stringByAppendingString:structName];
else
return @"";
}
else if (*ptr == '^')
{
NSString *pointed = humanReadableFScriptTypeDescriptionFromEncodedObjCType(++ptr);
if ([pointed isEqualToString:@""])
return @"pointer";
else
return [@"pointer to " stringByAppendingString:pointed];
}
else return @"";
}
static NSString *FScriptObjectTemplateForEncodedObjCType(const char *ptr)
{
while (*ptr == 'r' || *ptr == 'n' || *ptr == 'N' || *ptr == 'o' || *ptr == 'O' || *ptr == 'R' || *ptr == 'V')
ptr++;
/* if (strcmp(ptr,@encode(id)) == 0) return @"";
else if (strcmp(ptr,@encode(char)) == 0) return @"";
else if (strcmp(ptr,@encode(int)) == 0) return @"";
else if (strcmp(ptr,@encode(short)) == 0) return @"";
else if (strcmp(ptr,@encode(long)) == 0) return @"";
else if (strcmp(ptr,@encode(long long)) == 0) return @"";
else if (strcmp(ptr,@encode(unsigned char)) == 0) return @"";
else if (strcmp(ptr,@encode(unsigned short)) == 0) return @"";
else if (strcmp(ptr,@encode(unsigned int)) == 0) return @"";
else if (strcmp(ptr,@encode(unsigned long)) == 0) return @"";
else if (strcmp(ptr,@encode(unsigned long long)) == 0) return @"";
else if (strcmp(ptr,@encode(float)) == 0) return @"";
else if (strcmp(ptr,@encode(double)) == 0) return @"";
else if (strcmp(ptr,@encode(char *)) == 0) return @"";
#warning 64BIT: Inspect use of @encode
else*/ if (strcmp(ptr,@encode(SEL)) == 0) return @"#selector";
//else if (strcmp(ptr,@encode(Class)) == 0) return @"";
//else if (*ptr == '^') return @"";
else if (strcmp(ptr,@encode(NSRange)) == 0) return @"NSValue rangeWithLocation:0 length:0";
else if (strcmp(ptr,@encode(NSPoint)) == 0) return @"0<>0";
else if (strcmp(ptr,@encode(NSSize)) == 0) return @"NSValue sizeWithWidth:0 height:0";
else if (strcmp(ptr,@encode(NSRect)) == 0) return @"0<>0 extent:0<>0";
else if (strcmp(ptr,@encode(CGPoint)) == 0) return @"0<>0";
else if (strcmp(ptr,@encode(CGSize)) == 0) return @"NSValue sizeWithWidth:0 height:0";
else if (strcmp(ptr,@encode(CGRect)) == 0) return @"0<>0 extent:0<>0";
//else if (strcmp(ptr,@encode(_Bool)) == 0) return @"";
else return @"";
}
static NSMutableArray *customButtons = nil;
@interface FSObjectBrowserView() // Methods declaration to let the compiler know
- (void) fillMatrixForClassesBrowsing:(NSMatrix*)matrix;
- (void) fillMatrixForWorkspaceBrowsing:(NSMatrix*)matrix;
// - (void) fillMatrix:(NSMatrix *)matrix withMethodsAndPropertiesForObject:(id)object;
- (void) fillMatrix:(NSMatrix *)matrix withMethodsForObject:(id)object;
//- (void) fillMatrix:(NSMatrix *)matrix withPropertiesForObject:(id)object;
- (void) filter;
- (void) inspectAction:(id)sender;
- (id) selectedObject;
- (void) selectMethodNamed:(NSString *)methodName;
- (void) selfAction:(id)sender;
- (void) sendMessage:(SEL)selector withArguments:(FSArray *)arguments;
- (BOOL) sendMessageTo:(id)receiver selectorString:(NSString *)selectorStr arguments:(FSArray *)arguments putResultInMatrix:(NSMatrix *)matrix;
- (void) setFilterString:(NSString *)theFilterString;
- (void) setTitleOfLastColumn:(NSString *)title;
- (id) validSelectedObject;
@end
@implementation FSObjectBrowserView
+ (NSArray *)customButtons
{
return customButtons;
}
+ (void) initialize
{
static BOOL tooLate = NO;
if ( !tooLate )
{
int i;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *registrationDict = [NSMutableDictionary dictionary];
[registrationDict setObject:[NSNumber numberWithDouble:[[NSFont userFixedPitchFontOfSize:-1] pointSize]] forKey:@"FScriptFontSize"];
[defaults registerDefaults:registrationDict];
NSManagedObjectClass = NSClassFromString(@"NSManagedObject");
customButtons = [[NSMutableArray alloc] initWithCapacity:10];
for (i = 1; i < 11; i++)
{
FSObjectBrowserToolbarButton *button = [[FSObjectBrowserToolbarButton alloc] initWithFrame:NSMakeRect(0,0,80,20)];
NSString *buttonName = [defaults stringForKey:[NSString stringWithFormat:@"BigBrowserToolbarButtonCustom%dName",i]];
NSData *blockData = [defaults objectForKey:[NSString stringWithFormat:@"BigBrowserToolbarButtonCustom%dBlock",i]];
FSBlock *block = nil;
if (blockData)
{
@try
{
block = [[NSKeyedUnarchiver unarchiveObjectWithData:blockData] retain];
}
@catch (id exception)
{
NSLog(@"Problem while loading a block for an F-Script object browser custom button: %@", FSErrorMessageFromException(exception));
block = nil; // We will fall back to the default block template
}
}
if (!buttonName) buttonName = [NSString stringWithFormat:@"Custom%d", i];
if (!block)
{
NSString *blockSource;
if (i == 1)
{
buttonName = @"Example1";
blockSource = @"[:selectedObject|\n\n\"This block is an example illustrating the use of custom buttons in the object browser. This block prompts the user to save the selected object, and then returns a custom string.\"\n\nselectedObject save.\n'hello, I''m the result of the Example1 block !'\n]";
}
else if (i == 2)
{
buttonName = @"Example2";
blockSource = @"#isEqual:";
}
else if (i == 3)
{
buttonName = @"Example3";
blockSource = @"[\n\"This block is an example illustrating the use of custom buttons in the object browser. This block will simply open a standard about box.\"\n\nNSApplication sharedApplication orderFrontStandardAboutPanel:nil\n]";
}
else blockSource = @"[:selectedObject| selectedObject \"Define your custom block here.\"]";
block = [blockSource asBlock];
}
[button setIdentifier:[NSString stringWithFormat:@"Custom%d", i]];
[button setName:buttonName];
[button setBlock:block];
[button setAction:@selector(applyBlockAction:)];
[customButtons addObject:button];
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveCustomButtonsSettings:) name:NSApplicationWillTerminateNotification object:nil];
}
}
+ (void)saveCustomButtonsSettings
{
int i;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
for (i = 0; i < 10; i++)
{
[defaults setObject:[[customButtons objectAtIndex:i] name] forKey:[NSString stringWithFormat:@"BigBrowserToolbarButtonCustom%dName",i+1]];
[defaults setObject:[NSKeyedArchiver archivedDataWithRootObject:[[customButtons objectAtIndex:i] block]] forKey:[NSString stringWithFormat:@"BigBrowserToolbarButtonCustom%dBlock",i+1]];
}
[defaults synchronize];
}
+ (void)saveCustomButtonsSettings:(NSNotification *)aNotification
{
[self saveCustomButtonsSettings];
}
- (void)addBindingForObject:(id)object withName:(NSString *)name toMatrix:(NSMatrix *)matrix classLabel:(NSString *)classLabel selectedClassLabel:(NSString *)selectedClassLabel selectedLabel:(NSString *)selectedLabel selectedObject:(id)selectedObject
{
NSDictionary *infoForBinding = [object infoForBinding:name];
if (infoForBinding)
{
NSString *objectBoundLabel = @"Object bound";
NSString *keyPathBoundLabel = @"Key path bound";
NSString *valueClassLabel = @"Value class";
NSString *valueLabel = @"Value";
NSString *optionsLabel = @"Options";
id objectBound = [infoForBinding objectForKey:NSObservedObjectKey];
NSString *keyPathBound = [infoForBinding objectForKey:NSObservedKeyPathKey];
Class valueClass = [object respondsToSelector:@selector(valueClassForBinding:)] ? [object valueClassForBinding:name] : nil;
id value = [objectBound valueForKeyPath:keyPathBound];
NSDictionary *options = [infoForBinding objectForKey:NSOptionsKey];
NSString *objectBoundString = printString(objectBound);
NSString *keyPathBoundString = keyPathBound;
NSString *valueClassString = printString(valueClass);
NSString *valueString = printString(value);
NSString *optionsString = printString(options);
BOOL shouldDisplayBinding = [filterString isEqualToString:@""]
|| containsString(name , filterString, NSCaseInsensitiveSearch)
|| containsString(objectBoundLabel , filterString, NSCaseInsensitiveSearch)
|| containsString(objectBoundString , filterString, NSCaseInsensitiveSearch)
|| containsString(keyPathBoundLabel , filterString, NSCaseInsensitiveSearch)
|| containsString(keyPathBoundString, filterString, NSCaseInsensitiveSearch)
|| containsString(valueLabel , filterString, NSCaseInsensitiveSearch)
|| containsString(valueString , filterString, NSCaseInsensitiveSearch)
|| (valueClass != nil && containsString(valueClassLabel , filterString, NSCaseInsensitiveSearch))
|| (valueClass != nil && containsString(valueClassString , filterString, NSCaseInsensitiveSearch))
|| containsString(optionsLabel , filterString, NSCaseInsensitiveSearch)
|| containsString(optionsString , filterString, NSCaseInsensitiveSearch)
|| (selectedClassLabel == classLabel && ( (selectedObject == objectBound && selectedLabel == objectBoundLabel)
|| (selectedObject == keyPathBound && selectedLabel == keyPathBoundLabel)
|| (selectedObject == value && selectedLabel == valueLabel)
|| (valueClass != nil && selectedObject == valueClass && selectedLabel == valueClassLabel)
|| (selectedObject == options && selectedLabel == optionsLabel)));
if (shouldDisplayBinding)
{
[self addLabel:[NSString stringWithFormat:@"Binding: %@",name] toMatrix:matrix];
[self addObject:objectBound withLabel:objectBoundLabel toMatrix:matrix leaf:NO classLabel:classLabel selectedClassLabel:selectedClassLabel selectedLabel:selectedLabel selectedObject:selectedObject indentationLevel:1];
[self addObject:keyPathBound withLabel:keyPathBoundLabel toMatrix:matrix leaf:NO classLabel:classLabel selectedClassLabel:selectedClassLabel selectedLabel:selectedLabel selectedObject:selectedObject indentationLevel:1];
if (valueClass != nil) [self addObject:valueClass withLabel:valueClassLabel toMatrix:matrix leaf:NO classLabel:classLabel selectedClassLabel:selectedClassLabel selectedLabel:selectedLabel selectedObject:selectedObject indentationLevel:1];
[self addObject:value withLabel:valueLabel toMatrix:matrix leaf:NO classLabel:classLabel selectedClassLabel:selectedClassLabel selectedLabel:selectedLabel selectedObject:selectedObject indentationLevel:1];
[self addObject:options withLabel:optionsLabel toMatrix:matrix leaf:NO classLabel:classLabel selectedClassLabel:selectedClassLabel selectedLabel:selectedLabel selectedObject:selectedObject indentationLevel:1];
[self addBlankRowToMatrix:matrix];
}
}
}
- (void)addDictionary:(NSDictionary *)d withLabel:(NSString *)label toMatrix:(NSMatrix *)matrix classLabel:(NSString *)classLabel selectedClassLabel:(NSString *)selectedClassLabel selectedLabel:(NSString *)selectedLabel selectedObject:(id)selectedObject
{
if (d)
{
NSEnumerator *enumerator = [d keyEnumerator];
id key,value;
NSString *objectString;
NSUInteger count = [d count];
FSObjectBrowserCell *cell;
if (count != 0)
{
if ([self hasEmptyFilterString] || containsString(label, filterString, NSCaseInsensitiveSearch))
{
[self addLabel:label toMatrix:matrix];
while ((key = [enumerator nextObject]))
{
//[matrix addRow];
//cell = [matrix cellAtRow:[matrix numberOfRows]-1 column:0];
cell = addRowToMatrix(matrix);
value = [d objectForKey:key];
[cell setRepresentedObject:[FSAssociation associationWithKey:key value:value]];
objectString = [NSString stringWithFormat:@" %@ -> %@",printStringLimited(key,50),printStringLimited(value,1000)];
if ([objectString length] > 510)
objectString = [[objectString substringWithRange:NSMakeRange(0,500)] stringByAppendingString:@" ..."];
[cell setStringValue:objectString];
[cell setObjectBrowserCellType:FSOBOBJECT];
[cell setLabel:printString(key)];
[cell setClassLabel:@""];
if (value == selectedObject && [printString(key) isEqualToString:selectedLabel])
[matrix selectCellAtRow:[matrix numberOfRows]-1 column:0];
}
}
else
{
while ((key = [enumerator nextObject]) && !containsString(printString(key), filterString, NSCaseInsensitiveSearch) && !containsString(printString([d objectForKey:key]), filterString, NSCaseInsensitiveSearch) && !([d objectForKey:key] == selectedObject && [printString(key) isEqualToString:selectedLabel]));
if (key)
{
[self addLabel:label toMatrix:matrix];
while (key)
{
value = [d objectForKey:key];
BOOL addingSelectedObject = (value == selectedObject && [printString(key) isEqualToString:selectedLabel]);
if (containsString(printString(value), filterString, NSCaseInsensitiveSearch) || containsString(printString(key), filterString, NSCaseInsensitiveSearch) || addingSelectedObject)
{
//[matrix addRow];
//cell = [matrix cellAtRow:[matrix numberOfRows]-1 column:0];
cell = addRowToMatrix(matrix);
[cell setRepresentedObject:[FSAssociation associationWithKey:key value:value]];
objectString = [NSString stringWithFormat:@" %@ -> %@",printStringLimited(key,50),printStringLimited(value,1000)];
if ([objectString length] > 510)
objectString = [[objectString substringWithRange:NSMakeRange(0,500)] stringByAppendingString:@" ..."];
[cell setStringValue:objectString];
[cell setObjectBrowserCellType:FSOBOBJECT];
[cell setLabel:printString(key)];
[cell setClassLabel:@""];
if (addingSelectedObject)
[matrix selectCellAtRow:[matrix numberOfRows]-1 column:0];
}
key = [enumerator nextObject];
}
}
}
}
}
}
- (void) applyBlockAction:(id)sender
{
FSBlock *block = [sender block];
@try
{
[block compilIfNeeded];
}
@catch (id exception)
{
NSRunAlertPanel(@"Syntax Error", FSErrorMessageFromException(exception), @"OK", nil, nil,nil);
FSInspectBlocksInCallStackForException(exception);
return;
}
if ([block isCompact])
{
[self sendMessage:[block selector] withArguments:nil];
}
else
{
FSObjectBrowserButtonCtxBlock *contextualizedBlock;
SEL messageToArgumentSelector;
contextualizedBlock = [interpreter objectBrowserButtonCtxBlockFromString:[block printString]];
[contextualizedBlock setMaster:block];
if ([contextualizedBlock argumentCount] == 0)
{
FSInterpreterResult *interpreterResult = [contextualizedBlock executeWithArguments:[NSArray array]];
if (![interpreterResult isOK])
{
NSRunAlertPanel(@"Error", [interpreterResult errorMessage], @"OK", nil, nil,nil);
[interpreterResult inspectBlocksInCallStack];
return;
}
}
else if ((messageToArgumentSelector = [contextualizedBlock messageToArgumentSelector]) != (SEL)0 && messageToArgumentSelector != @selector(alloc) && messageToArgumentSelector != @selector(allocWithZone:))
{
NSString *methodName = [FSCompiler stringFromSelector:messageToArgumentSelector];
id selectedObject;
FSInterpreterResult *interpreterResult;
if ((selectedObject = [self validSelectedObject]) == nil)
{
NSBeep();
return;
}
[browser setDelegate:nil];
[self selectMethodNamed:methodName];
[browser setDelegate:self];
interpreterResult = [contextualizedBlock executeWithArguments:[NSArray arrayWithObject:selectedObject]];
if ([interpreterResult isOK])
[self fillMatrix:[browser matrixInColumn:[browser lastColumn]] withObject:[interpreterResult result]];
else
{
NSRunAlertPanel(@"Error", [interpreterResult errorMessage], @"OK", nil, nil,nil);
[interpreterResult inspectBlocksInCallStack];
return;
}
}
else
[self sendMessage:@selector(applyBlock:) withArguments:[FSArray arrayWithObject:contextualizedBlock]];
}
[browser scrollColumnToVisible:[browser lastColumn]];
[browser scrollColumnsLeftBy:1]; // Workaround for the call above to scrollColumnToVisible: not working as expected.
}
- (void)addBlankRowToMatrix:(NSMatrix *)matrix
{
NSBrowserCell *cell;
//[matrix addRow];
//cell = [matrix cellAtRow:[matrix numberOfRows]-1 column:0];
cell = addRowToMatrix(matrix);
[cell setLeaf:YES];
[cell setEnabled:NO];
}
- (void)addClassWithName:(NSString *)className toMatrix:(NSMatrix *)matrix label:(NSString *)label classLabel:(NSString *)classLabel indentationLevel:(NSUInteger)indentationLevel
{
FSObjectBrowserCell *cell = addRowToMatrix(matrix);
NSMutableString *cellString = [NSMutableString string];
[cell setLabel:label];
[cell setClassLabel:classLabel];
for (NSUInteger i = 0; i < indentationLevel; i++) [cellString appendString:@" "];
[cellString appendString:className];
[cell setStringValue:cellString];
[cell setObjectBrowserCellType:FSOBCLASS];
}
// Not tested
/*
- (void)addClassWithName:(NSString *)className withLabel:(NSString *)label toMatrix:(NSMatrix *)matrix classLabel:(NSString *)classLabel selectedClassLabel:(NSString *)selectedClassLabel selectedLabel:(NSString *)selectedLabel selectedObject:(id)selectedObject
{
BOOL hasEmptyFilterString = [filterString isEqualToString:@""];
BOOL addingSelectedObject = (selectedObject != nil && [selectedObject class] == selectedObject && [NSStringFromClass(selectedObject) isEqualToString:className] && [label isEqualToString:selectedLabel] && [classLabel isEqualToString:selectedClassLabel]);
if (hasEmptyFilterString || containsString(label, filterString, NSCaseInsensitiveSearch) || containsString(printString(object), filterString, NSCaseInsensitiveSearch) || addingSelectedObject)
{
[self addLabel:label toMatrix:matrix];
[self addClassWithName:className toMatrix:matrix label:label classLabel:classLabel indentationLevel:1];
if (addingSelectedObject)
[matrix selectCellAtRow:[matrix numberOfRows]-1 column:0];
}
}
*/
- (void)addClassesWithNames:(NSArray *)classNames withLabel:(NSString *)label toMatrix:(NSMatrix *)matrix classLabel:(NSString *)classLabel selectedClassLabel:(NSString *)selectedClassLabel selectedLabel:(NSString *)selectedLabel selectedObject:(id)selectedObject
{
if (classNames)
{
NSUInteger i;
NSUInteger count = [classNames count];
if (count != 0)
{
if ([self hasEmptyFilterString] || containsString(label, filterString, NSCaseInsensitiveSearch))
{
[self addLabel:label toMatrix:matrix];
for (i = 0; i < count; i++)
{
NSString *className = [classNames objectAtIndex:i];
[self addClassWithName:className toMatrix:matrix label:label classLabel:classLabel indentationLevel:1];
if (selectedObject != nil && [selectedObject class] == selectedObject && [NSStringFromClass(selectedObject) isEqualToString:className] && [label isEqualToString:selectedLabel] && [classLabel isEqualToString:selectedClassLabel])
[matrix selectCellAtRow:[matrix numberOfRows]-1 column:0];
}
}
else
{
i = 0;
while (i < count && !containsString([classNames objectAtIndex:i], filterString, NSCaseInsensitiveSearch) && !(selectedObject != nil && [selectedObject class] == selectedObject && [NSStringFromClass(selectedObject) isEqualToString:[classNames objectAtIndex:i]] && [label isEqualToString:selectedLabel] && [classLabel isEqualToString:selectedClassLabel]))
i++;
if (i < count)
{
[self addLabel:label toMatrix:matrix];
for (; i < count; i++)
{
BOOL addingSelectedObject = (selectedObject != nil && [selectedObject class] == selectedObject && [NSStringFromClass(selectedObject) isEqualToString:[classNames objectAtIndex:i]] && [label isEqualToString:selectedLabel] && [classLabel isEqualToString:selectedClassLabel]);
if (containsString([classNames objectAtIndex:i], filterString, NSCaseInsensitiveSearch) || addingSelectedObject)
{
[self addClassWithName:[classNames objectAtIndex:i] toMatrix:matrix label:label classLabel:classLabel indentationLevel:1];
if (addingSelectedObject)
[matrix selectCellAtRow:[matrix numberOfRows]-1 column:0];
}
}
}
}
}
}
}
- (void)addClassLabel:(NSString *)label toMatrix:(NSMatrix *)matrix color:(NSColor *)color
{
NSBrowserCell *cell;
NSDictionary *txtDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor whiteColor], NSForegroundColorAttributeName, color, NSBackgroundColorAttributeName, nil];
NSMutableAttributedString *attrStr = [[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@" %@ ", label] attributes:txtDict] autorelease];
[self addBlankRowToMatrix:matrix];
//[matrix addRow];
//cell = [matrix cellAtRow:[matrix numberOfRows]-1 column:0];
cell = addRowToMatrix(matrix);
[cell setLeaf:YES];
[cell setEnabled:NO];
[attrStr setAlignment:NSCenterTextAlignment range:NSMakeRange(0,[attrStr length])];
[cell setAttributedStringValue:attrStr];
}
- (void)addClassLabel:(NSString *)label toMatrix:(NSMatrix *)matrix
{
[self addClassLabel:label toMatrix:matrix color:[NSColor colorWithCalibratedRed:0.1 green:0.65 blue:0.12 alpha:1]];
}
- (void)addLabel:(NSString *)label toMatrix:(NSMatrix *)matrix indentationLevel:(NSUInteger)indentationLevel
{
NSBrowserCell *cell;
NSMutableString *cellString = [NSMutableString string];
//[matrix addRow];
//cell = [matrix cellAtRow:[matrix numberOfRows]-1 column:0];
cell = addRowToMatrix(matrix);
[cell setLeaf:YES];
[cell setEnabled:NO];
for (NSUInteger i = 0; i < indentationLevel; i++) [cellString appendString:@" "];
[cellString appendString:label];
[cell setStringValue:cellString];
}
- (void)addLabel:(NSString *)label toMatrix:(NSMatrix *)matrix
{
[self addLabel:label toMatrix:matrix indentationLevel:0];
}
- (void)addLabelAlone:(NSString *)label toMatrix:(NSMatrix *)matrix
{
if ( [self hasEmptyFilterString] || containsString(label, filterString, NSCaseInsensitiveSearch) )
{
[self addLabel:label toMatrix:matrix];
}
}
- (void)addObject:(id)object toMatrix:(NSMatrix *)matrix label:(NSString *)label classLabel:(NSString *)classLabel indentationLevel:(NSUInteger)indentationLevel leaf:(BOOL)leaf
{
FSObjectBrowserCell *cell;
NSString *objectString = printStringForObjectBrowser(object);
//[matrix addRow];
//cell = [matrix cellAtRow:[matrix numberOfRows]-1 column:0];
cell = addRowToMatrix(matrix);
if ([object isKindOfClass:[FSObjectBrowserNamedObjectWrapper class]]) [cell setRepresentedObject:[object object]];
else [cell setRepresentedObject:object];
[cell setLabel:label];
[cell setClassLabel:classLabel];
if (object == nil || leaf)
{
[cell setLeaf:YES];
}
NSMutableString *cellString = [NSMutableString string];
for (NSUInteger i = 0; i < indentationLevel; i++) [cellString appendString:@" "];
[cellString appendString:objectString];
if ([object isKindOfClass:[FSNewlyAllocatedObjectHolder class]])
{
NSColor *txtColor = [NSColor purpleColor];
NSDictionary *txtDict = [NSDictionary dictionaryWithObjectsAndKeys:txtColor, NSForegroundColorAttributeName, nil];
NSAttributedString *attrStr = [[[NSMutableAttributedString alloc] initWithString:cellString attributes:txtDict] autorelease];
[cell setAttributedStringValue:attrStr];
}
else
{
[cell setStringValue:cellString];
}
[cell setObjectBrowserCellType:FSOBOBJECT];
}
- (void)addObject:(id)object toMatrix:(NSMatrix *)matrix label:(NSString *)label classLabel:(NSString *)classLabel indentationLevel:(NSUInteger)indentationLevel
{
[self addObject:object toMatrix:matrix label:label classLabel:classLabel indentationLevel:indentationLevel leaf:NO];
}
- (void)addObject:(id)object toMatrix:(NSMatrix *)matrix label:(NSString *)label classLabel:(NSString *)classLabel
{
[self addObject:object toMatrix:matrix label:label classLabel:classLabel indentationLevel:1];
}
- (void)addObject:(id)object withLabel:(NSString *)label toMatrix:(NSMatrix *)matrix leaf:(BOOL)leaf classLabel:(NSString *)classLabel selectedClassLabel:(NSString *)selectedClassLabel selectedLabel:(NSString *)selectedLabel selectedObject:(id)selectedObject indentationLevel:(NSUInteger)indentationLevel
{
BOOL addingSelectedObject = (object == selectedObject && [label isEqualToString:selectedLabel] && [classLabel isEqualToString:selectedClassLabel]);
// Note the use of printStringLimited below. We limit our matching test to the first 10000 elements for performance reasons.
// if ([self hasEmptyFilterString] || containsString(label, filterString, NSCaseInsensitiveSearch) || containsString(printStringLimited(object, 10000), filterString, NSCaseInsensitiveSearch) || addingSelectedObject)
if ([self hasEmptyFilterString] || containsString(label, filterString, NSCaseInsensitiveSearch) || containsString(printString(object), filterString, NSCaseInsensitiveSearch) || addingSelectedObject)
{
[self addLabel:label toMatrix:matrix indentationLevel:indentationLevel];
[self addObject:object toMatrix:matrix label:label classLabel:classLabel indentationLevel:indentationLevel+1 leaf:leaf];
if (addingSelectedObject)
[matrix selectCellAtRow:[matrix numberOfRows]-1 column:0];
}
}
- (void)addObject:(id)object withLabel:(NSString *)label toMatrix:(NSMatrix *)matrix classLabel:(NSString *)classLabel selectedClassLabel:(NSString *)selectedClassLabel selectedLabel:(NSString *)selectedLabel selectedObject:(id)selectedObject
{
[self addObject:object withLabel:label toMatrix:matrix leaf:NO classLabel:(NSString *)classLabel selectedClassLabel:selectedClassLabel selectedLabel:selectedLabel selectedObject:selectedObject indentationLevel:0];
}
- (void)addObjects:(NSArray *)objects withLabel:(NSString *)label toMatrix:(NSMatrix *)matrix classLabel:(NSString *)classLabel selectedClassLabel:(NSString *)selectedClassLabel selectedLabel:(NSString *)selectedLabel selectedObject:(id)selectedObject
{
if (objects)
{
NSUInteger i;
NSUInteger count = [objects count];
if (count != 0)
{
if ([self hasEmptyFilterString] || containsString(label, filterString, NSCaseInsensitiveSearch))
{
[self addLabel:label toMatrix:matrix];
for (i = 0; i < count; i++)
{
id object = [objects objectAtIndex:i];
[self addObject:object toMatrix:matrix label:label classLabel:classLabel];
if (object == selectedObject && [label isEqualToString:selectedLabel] && [classLabel isEqualToString:selectedClassLabel])
[matrix selectCellAtRow:[matrix numberOfRows]-1 column:0];
}
}
else
{
i = 0;
while (i < count && !containsString(printString([objects objectAtIndex:i]), filterString, NSCaseInsensitiveSearch) && !([objects objectAtIndex:i] == selectedObject && [label isEqualToString:selectedLabel] && [classLabel isEqualToString:selectedClassLabel]))
i++;
if (i < count)
{
[self addLabel:label toMatrix:matrix];
for (; i < count; i++)
{
BOOL addingSelectedObject = ([objects objectAtIndex:i] == selectedObject && [label isEqualToString:selectedLabel] && [classLabel isEqualToString:selectedClassLabel]);
if (containsString(printString([objects objectAtIndex:i]), filterString, NSCaseInsensitiveSearch) || addingSelectedObject)
{
[self addObject:[objects objectAtIndex:i] toMatrix:matrix label:label classLabel:classLabel];
if (addingSelectedObject)
[matrix selectCellAtRow:[matrix numberOfRows]-1 column:0];
}
}
}
}
}
}
}
- (void)addPropertyLabel:(NSString *)label toMatrix:(NSMatrix *)matrix
{
NSBrowserCell *cell;
NSDictionary *txtDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor whiteColor], NSForegroundColorAttributeName, [NSColor redColor], NSBackgroundColorAttributeName, nil];
NSMutableAttributedString *attrStr = [[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@" %@ ", label] attributes:txtDict] autorelease];
[self addBlankRowToMatrix:matrix];
//[matrix addRow];
//cell = [matrix cellAtRow:[matrix numberOfRows]-1 column:0];
cell = addRowToMatrix(matrix);
[cell setLeaf:YES];
[cell setEnabled:NO];
[attrStr setAlignment:NSCenterTextAlignment range:NSMakeRange(0,[attrStr length])];
[cell setAttributedStringValue:attrStr];
}
- (IBAction)browseAction:(id)sender
{
[interpreter browse:[self selectedObject]];
}
- (void)browser:(NSBrowser *)sender createRowsForColumn:(NSInteger)column inMatrix:(NSMatrix *)matrix // We are our own delegate
{
[matrixes addObject:matrix];
if (column == 0)
{
switch (browsingMode)
{
case FSBrowsingWorkspace: [self fillMatrixForWorkspaceBrowsing:matrix]; break;
case FSBrowsingClasses: [self fillMatrixForClassesBrowsing:matrix]; break;
case FSBrowsingObject: [self fillMatrix:matrix withObject:rootObject]; break;
case FSBrowsingNothing: break;
}
}
else if ( [[browser selectedCell] objectBrowserCellType] == FSOBOBJECT || [[browser selectedCell] objectBrowserCellType] == FSOBCLASS)
{
[self fillMatrix:matrix withObject:[[browser selectedCell] representedObject]];
// if ([browser selectedRowInColumn:[browser selectedColumn]] != 0 && (column != 1 || browsingMode == FSBrowsingObject)) [self performSelector:@selector(selfAction:) withObject:nil afterDelay:0];
}
/*else if ([[browser selectedCell] objectBrowserCellType] == PROPERTY)
{
id selectedObject = [self selectedObject];
[self sendMessageTo:selectedObject selectorString:@"valueForKey:" arguments:[NSArray arrayWithObject:[[browser selectedCell] stringValue]] putResultInMatrix:matrix];
}*/
else
{
NSString *selectedString = [[browser selectedCell] stringValue];
SEL selector = [FSCompiler selectorFromString:selectedString];
NSArray *selectorComponents = [NSStringFromSelector(selector) componentsSeparatedByString:@":"];
NSInteger nbarg = [selectorComponents count]-1;
id selectedObject = [self selectedObject];
FSMsgContext *msgContext = [[[FSMsgContext alloc] init] autorelease];
NSInteger unsupportedArgumentIndex;
if ([selectedObject isKindOfClass:[FSNewlyAllocatedObjectHolder class]]) selectedObject = [selectedObject object];
[msgContext prepareForMessageWithReceiver:selectedObject selector:[FSCompiler selectorFromString:selectedString]];
unsupportedArgumentIndex = [msgContext unsuportedArgumentIndex];
if (unsupportedArgumentIndex != -1)
{
NSString *errorString = [NSString stringWithFormat:@"Can't invoke method: the type expected for argument %ld is not supported by F-Script.", (long)unsupportedArgumentIndex+1];
NSRunAlertPanel(@"Sorry", errorString, @"OK", nil, nil,nil);
return;
}
else if ([msgContext unsuportedReturnType])
{
NSString *errorString = [NSString stringWithFormat:@"Can't invoke method: return type not supported by F-Script."];
NSRunAlertPanel(@"Sorry", errorString, @"OK", nil, nil,nil);
return;
}
else if (nbarg == 0)
{
// NSBrowserCell *cell;
[self sendMessageTo:selectedObject selectorString:selectedString arguments:[NSArray array] putResultInMatrix:matrix];
/*if (cell = [matrix cellAtRow:0 column:0])
{
[self performSelector:@selector(setTitleOfLastColumn:) withObject:printString([[cell representedObject] classOrMetaclass]) afterDelay:0];
// We do this because at the time tis method is called, the new column is not yet created.
// Hence the need to delay the setTitle.
} */
}
else
{
NSInteger i;
NSInteger baseWidth = 530;
NSInteger baseHeight = nbarg*(userFixedPitchFontSize()+17)+75;
NSButton *sendButton;
NSButton *cancelButton;
NSForm *f;
NSWindow *argumentsWindow;
NSMethodSignature *signature = [selectedObject methodSignatureForSelector:selector];
argumentsWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(100,100,baseWidth,baseHeight) styleMask:NSResizableWindowMask backing:NSBackingStoreBuffered defer:NO];
[argumentsWindow setMinSize:NSMakeSize(240,baseHeight+22)];
[argumentsWindow setMaxSize:NSMakeSize(1400,baseHeight+22)];
f = [[[NSForm alloc] initWithFrame:NSMakeRect(20,60,baseWidth-40,baseHeight-80)] autorelease];
[f setAutoresizingMask:NSViewWidthSizable];
[f setInterlineSpacing:8];
[[argumentsWindow contentView] addSubview:f]; // The form must be the first subview
// (this is used by method sendMessageAction:)
[argumentsWindow setInitialFirstResponder:f];
sendButton = [[[NSButton alloc] initWithFrame:NSMakeRect(baseWidth/2,13,125,30)] autorelease];
[sendButton setBezelStyle:1];
[sendButton setTitle:@"Send Message"];
[sendButton setAction:@selector(sendMessageAction:)];
[sendButton setTarget:self];
[sendButton setKeyEquivalent:@"\r"];
[[argumentsWindow contentView] addSubview:sendButton];
cancelButton = [[[NSButton alloc] initWithFrame:NSMakeRect(baseWidth/2-95,13,95,30)] autorelease];
[cancelButton setBezelStyle:1];
[cancelButton setTitle:@"Cancel"];
[cancelButton setAction:@selector(cancelArgumentsSheetAction:)];
[cancelButton setTarget:self];
[cancelButton setKeyEquivalent:@"\e"];
[[argumentsWindow contentView] addSubview:cancelButton];
if (nbarg == 1 && [[selectorComponents objectAtIndex:0] hasPrefix:@"operator_"])
{
const char *type = [signature getArgumentTypeAtIndex:2];
NSString *typeDescription = humanReadableFScriptTypeDescriptionFromEncodedObjCType(type);
NSString *template = FScriptObjectTemplateForEncodedObjCType(type);
if ([typeDescription length] > 0) typeDescription = [[@"(" stringByAppendingString:typeDescription] stringByAppendingString:@")"];
[f addEntry:[[selectedString stringByAppendingString:@" "] stringByAppendingString:typeDescription]];
[[f cellAtIndex:0] setStringValue:template];
}
else
for (i = 0; i < nbarg; i++)
{
const char *type = [signature getArgumentTypeAtIndex:i+2];
NSString *typeDescription = humanReadableFScriptTypeDescriptionFromEncodedObjCType(type);
NSString *template = FScriptObjectTemplateForEncodedObjCType(type);
if ([typeDescription length] > 0) typeDescription = [[@"(" stringByAppendingString:typeDescription] stringByAppendingString:@")"];
[f addEntry:[[[selectorComponents objectAtIndex:i] stringByAppendingString:@":"] stringByAppendingString:typeDescription]];
[[f cellAtIndex:i] setStringValue:template];
}
[f setTextFont:[NSFont userFixedPitchFontOfSize:userFixedPitchFontSize()]];
[f setTitleFont:[NSFont systemFontOfSize:systemFontSize()]];
[f setAutosizesCells:YES];
[f setTarget:sendButton];
[f setAction:@selector(performClick:)];
[f selectTextAtIndex:0];
[NSApp beginSheet:argumentsWindow modalForWindow:[self window] modalDelegate:self didEndSelector:NULL contextInfo:NULL];
}
}
[browser tile];
}
- (void) browseNothing
{
browsingMode = FSBrowsingNothing;
[rootObject release];
rootObject = nil;
[browser loadColumnZero];
}
- (void) browseWorkspace
{
browsingMode = FSBrowsingWorkspace;
[rootObject release];
rootObject = nil;
[browser loadColumnZero];
}
- (void) cancelArgumentsSheetAction:(id)sender
{
[NSApp endSheet:[sender window]];
[[sender window] close];
[[browser matrixInColumn:[browser lastColumn]-1] deselectAllCells];
}
- (void) cancelNameSheetAction:(id)sender
{
[NSApp endSheet:[sender window]];
[[sender window] close];
}
- (void) classesAction:(id)sender
{
browsingMode = FSBrowsingClasses;
[rootObject release];
rootObject = nil;
[browser loadColumnZero];
}
- (void) dealloc