/*
 *	Filename: RegExPalette.m
 *	Created : Wed Jan 22 09:26:18 1997
 *	Author  : Vince DeMarco
 *	LastEditDate Was "Wed Jan 22 14:04:20 1997"
 */

#import "RegExPalette.h"
#import <regex/RegExFormatter.h>

@implementation RegExPalette

- (void)finishInstantiate
{
    RegExFormatter *genericFormatter;
    RegExFormatter *phoneFormatter;
    RegExFormatter *ssnFormatter;
    NSString       *phoneDictPath;
    NSString       *ssnDictPath;

    phoneDictPath    = [[NSBundle bundleForClass:[self class]] pathForResource:@"phonePatterns"
							                ofType:@"dictionary"];

    ssnDictPath      = [[NSBundle bundleForClass:[self class]] pathForResource:@"ssnPatterns"
							                ofType:@"dictionary"];

    genericFormatter = [[RegExFormatter allocWithZone:[self zone]] init];
    phoneFormatter   = [[RegExFormatter allocWithZone:[self zone]] initWithContentsOfFile:phoneDictPath];
    ssnFormatter     = [[RegExFormatter allocWithZone:[self zone]] initWithContentsOfFile:ssnDictPath];

    [self associateObject:genericFormatter ofType:IBFormatterPboardType withView:genericFormatterView];
    [self associateObject:phoneFormatter   ofType:IBFormatterPboardType withView:phoneFormatterView];
    [self associateObject:ssnFormatter     ofType:IBFormatterPboardType withView:ssnFormatterView];
}

@end
