Refactor _loadDictionary... method add awakeFromNib implementation, refactor _objectValueForTableColumn:row:

This commit is contained in:
Gregory John Casamento 2023-04-16 02:42:56 -04:00
parent 998d0c8e01
commit 16f285ed7f
4 changed files with 539 additions and 534 deletions

View file

@ -37,6 +37,7 @@
@class NSMutableArray;
@class NSString;
@class NSURL;
@class GSKeyValueBinding;
APPKIT_EXPORT_CLASS
@interface NSOutlineView : NSTableView
@ -51,6 +52,11 @@ APPKIT_EXPORT_CLASS
BOOL _autosaveExpandedItems;
CGFloat _indentationPerLevel;
NSTableColumn *_outlineTableColumn;
GSKeyValueBinding *_theBinding;
NSString *_countKeyPath;
NSString *_childrenKeyPath;
NSString *_leafKeyPath;
}
// Instance methods

View file

@ -321,6 +321,11 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
[super dealloc];
}
- (id) observedObject
{
return [info objectForKey: NSObservedObjectKey];
}
- (id) destinationValue
{
id newValue;

File diff suppressed because it is too large Load diff

View file

@ -175,6 +175,7 @@
- (void) rearrangeObjects
{
NSLog(@"---- rearrangeObjects");
[self willChangeValueForKey: @"arrangedObjects"];
DESTROY(_arranged_objects);
_arranged_objects = [[GSObservableArray alloc]
@ -302,8 +303,6 @@
- (void) setContent: (id)content
{
// FIXME
NSLog(@"in setContent... %@", content);
[super setContent: content];
[self rearrangeObjects];
}
@ -414,12 +413,12 @@
}
if ([coder containsValueForKey: @"NSTreeContentCountKey"])
{
[self setChildrenKeyPath:
[self setCountKeyPath:
[coder decodeObjectForKey: @"NSTreeContentCountKey"]];
}
if ([coder containsValueForKey: @"NSTreeContentLeafKey"])
{
[self setChildrenKeyPath:
[self setLeafKeyPath:
[coder decodeObjectForKey: @"NSTreeContentLeafKey"]];
}
@ -475,7 +474,7 @@
{
[coder encodeObject: _childrenKeyPath
forKey: @"NSTreeContentChildrenKey"];
[coder encodeObject: _countKeyPath
[coder encodeObject: _countKeyPath
forKey: @"NSTreeContentCountKey"];
[coder encodeObject: _leafKeyPath
forKey: @"NSTreeContentLeafKey"];