Ticket #167: AliasDataToPathTransformer.m

File AliasDataToPathTransformer.m, 459 bytes (added by cluthi81, 15 years ago)

Transformer for bindings

Line 
1
2#import "AliasDataToPathTransformer.h"
3#import "BDAlias.h"
4#import "StringAdditions.h"
5
6@implementation AliasDataToPathTransformer
7
8+ (Class) transformedValueClass
9{
10    return [NSString class];
11}
12
13+ (BOOL) allowsReverseTransformation
14{
15    return NO;
16}
17
18- (id) transformedValue: (id) value
19{
20    BDAlias * alias = [BDAlias aliasWithData: value];
21    return value == nil ?  nil : [[alias fullPathWithDefault: @"Folder not found"] lastPathComponent];
22}
23
24@end