Added URLUtils. Rewrote Target.
2 // UniqueWindowController.m
5 // Created by Jens Alfke on 3/14/08.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
9 #import "UniqueWindowController.h"
10 #import "GraphicsUtils.h"
13 @implementation UniqueWindowController
16 + (BOOL) isModel: (id)model1 equalToModel: (id)model2
18 return model1==model2;
22 + (UniqueWindowController*) instanceWith: (id)model
24 for( NSWindow *window in OpenWindowsWithDelegateClass(self) ) {
25 UniqueWindowController *c = window.delegate;
26 if( [self isModel: c.model equalToModel: model] )
33 + (UniqueWindowController*) openWith: (id)model
35 UniqueWindowController *w = [self instanceWith: model];
37 w = [[self alloc] initWith: model];
40 if( model != w.model )
41 [w reopenWith: model];
43 [w.window makeKeyAndOrderFront: self];
48 - (void) reopenWith: (id)model
53 - (void) windowWillClose: (NSNotification*)n