implemented CPCoding support for CPSortDescriptor and made CPTableColumn decode it's _sortDescriptorPrototype

This commit is contained in:
Klaas Pieter Annema committed 2010-05-20 11:39:47 +02:00
1 parent 97e4b69eaa
commit 6a33acbb7c
5 files changed
+72 -1

No files matched your search

+1
View File
@@ -67,6 +67,7 @@
@import "NSViewController.j"
@import "NSWindowTemplate.j"
@import "WebView.j"
@import "NSSortDescriptor.j"
function CP_NSMapClassName(aClassName)
+35
View File
@@ -0,0 +1,35 @@
@import <Foundation/CPSortDescriptor.j>
@implementation CPSortDescriptor (NSCoding)
{
}
- (id)NS_initWithCoder:(CPCoder)aCoder
{
if (self = [super init])
{
_key = [aCoder decodeObjectForKey:@"NSKey"];
_selector = CPSelectorFromString([aCoder decodeObjectForKey:@"NSSelector"]);
_ascending = [aCoder decodeBoolForKey:@"NSAscending"];
}
return self;
}
@end
@implementation NSSortDescriptor : CPSortDescriptor
{
}
- (id)initWithCoder:(CPCoder)aCoder
{
return [self NS_initWithCoder:aCoder];
}
- (Class)classForKeyedArchiver
{
return [CPSortDescriptor class];
}
@end
+2
View File
@@ -53,6 +53,8 @@
_resizingMask = [aCoder decodeBoolForKey:@"NSIsResizeable"] ? CPTableColumnUserResizingMask : CPTableColumnAutoresizingMask;
_isHidden = [aCoder decodeBoolForKey:@"NSHidden"];
_sortDescriptorPrototype = [aCoder decodeObjectForKey:@"NSSortDescriptorPrototype"];
}
return self;