ftp.nice.ch/Attic/openStep/developer/resources/IconKit.4.2.1.sd.tgz#/IconKit.4.2.1/FileViewer/FileList.m

This is FileList.m in view mode; [Download] [Up]

#pragma .h #import <IconKit/iconkit.h>

#import <Foundation/NSString.h>

#import <AppKit/AppKit.h>

#import "FileList.h"
#import "File.h"

@implementation FileList:IKList
{

}


- (void)copyToPasteboard: (NSPasteboard *) pboard
{
    NSMutableArray *p = [NSMutableArray array];
    int		   i, count;

    for(i = 0, count = [self count]; i < count; i++) {
        [p addObject:[[self objectAtIndex:i] path]];
    }
    [super copyToPasteboard:pboard];
    [pboard addTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil];
    [pboard setPropertyList:p forType:NSFilenamesPboardType];
}

+ readFromPasteboard: (NSPasteboard *) pboard
{
    id fileList = nil;
    if ((fileList = [super readFromPasteboard: pboard]) == nil && [pboard availableTypeFromArray:[NSArray arrayWithObject:NSFilenamesPboardType]] != NULL) {
        id a = [pboard propertyListForType:NSFilenamesPboardType];
        if([a isKindOfClass:[NSArray class]]) {
            int i, count = [a count];
            fileList = [[self alloc] initCount:[a count]];
            for(i = 0; i < count; i++) {
                [fileList addObject:[File fileForPath:[a objectAtIndex:i]]];
            }
       }
    }
    return fileList;
}


@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.