* Headers/AppKit/NSTreeController.h,

* Headers/AppKit/NSTreeNode.h: Add method declarations to these
        * files.
        * Headers/AppKit/AppKit.h,
        * Source/GNUmakefile: Include new files.
        * Source/NSObjectController.m (+initialize, -selection): Get
        * basic
        binding example working.
        * Source/NSTreeController.m: Minimal implementation.
        * Source/NSTreeNode.m: Full implementation of this class.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36991 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2013-08-19 19:10:22 +00:00
parent ef49975949
commit a93d126191
8 changed files with 717 additions and 41 deletions

View file

@ -50,9 +50,9 @@
@implementation _NSManagedProxy
- (id) initWithCoder: (NSCoder *)coder
{
if((self = [super init]) != nil)
if ((self = [super init]) != nil)
{
if([coder allowsKeyedCoding])
if ([coder allowsKeyedCoding])
{
ASSIGN(_entity_name_key,[coder decodeObjectForKey: @"NSEntityName"]);
}
@ -66,7 +66,7 @@
- (void) encodeWithCoder: (NSCoder *)coder
{
if([coder allowsKeyedCoding])
if ([coder allowsKeyedCoding])
{
[coder encodeObject: _entity_name_key forKey: @"NSEntityName"];
}
@ -104,8 +104,10 @@
triggerChangeNotificationsForDependentKey: @"canAdd"];
[self setKeys: [NSArray arrayWithObject: @"editable"]
triggerChangeNotificationsForDependentKey: @"canRemove"];
[self setKeys: [NSArray arrayWithObject: @"content"]
[self setKeys: [NSArray arrayWithObjects: @"content", NSContentObjectBinding, nil]
triggerChangeNotificationsForDependentKey: @"selectedObjects"];
[self setKeys: [NSArray arrayWithObjects: @"content", NSContentObjectBinding, nil]
triggerChangeNotificationsForDependentKey: @"selection"];
}
}
@ -140,7 +142,7 @@
- (void) encodeWithCoder: (NSCoder *)coder
{
[super encodeWithCoder: coder];
if([coder allowsKeyedCoding])
if ([coder allowsKeyedCoding])
{
[coder encodeBool: _is_editable forKey: @"NSEditable"];
[coder encodeBool: _automatically_prepares_content forKey: @"NSAutomaticallyPreparesContent"];
@ -158,7 +160,7 @@
- (id) initWithCoder: (NSCoder *)coder
{
if((self = [super initWithCoder: coder]) != nil)
if ((self = [super initWithCoder: coder]) != nil)
{
if ([self automaticallyPreparesContent])
{
@ -172,7 +174,7 @@
}
}
if([coder allowsKeyedCoding])
if ([coder allowsKeyedCoding])
{
_is_editable = [coder decodeBoolForKey: @"NSEditable"];
_automatically_prepares_content = [coder decodeBoolForKey: @"NSAutomaticallyPreparesContent"];
@ -353,13 +355,13 @@
- (id) selection
{
// TODO
return nil;
return _content;
}
- (BOOL) validateMenuItem: (id <NSMenuItem>)item
{
SEL action = [item action];
SEL action = [item action];
if (sel_isEqual(action, @selector(add:)))
{