Minor refactorization.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20461 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-12-17 10:49:01 +00:00
parent 94bed640ce
commit 6be559f890
4 changed files with 29 additions and 15 deletions

View file

@ -1,3 +1,11 @@
2004-12-17 05:48 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: Changed implementation here to call the one
on the object editor.
* GormObjectEditor.m: Added implementation for
removeAllInstancesOfClass:
* GormPrivate.h: Added declaration for removeAllInstancesOfClass:
2004-12-16 05:32 Gregory John Casamento <greg_casamento@yahoo.com>
* GormClassEditor.m: added call to removeAllInstancesOfClass: in

View file

@ -1590,18 +1590,7 @@ static NSImage *fileImage = nil;
- (void) removeAllInstancesOfClass: (NSString *)className
{
NSArray *objects = [objectsView objects];
NSEnumerator *en = [objects objectEnumerator];
id object = nil;
while((object = [en nextObject]) != nil)
{
NSString *clsForObj = [classManager classNameForObject: object];
if([className isEqual: clsForObj])
{
[objectsView removeObject: object];
}
}
[objectsView removeAllInstancesOfClass: className];
}
- (void) selectClass: (NSString *)className

View file

@ -196,6 +196,22 @@ static NSMapTable *docMap = 0;
}
}
- (void) removeAllInstancesOfClass: (NSString *)className
{
GormClassManager *classManager = [(GormDocument *)document classManager];
NSEnumerator *en = [objects objectEnumerator];
id object = nil;
while((object = [en nextObject]) != nil)
{
NSString *clsForObj = [classManager classNameForObject: object];
if([className isEqual: clsForObj])
{
[self removeObject: object];
}
}
}
/*
* Dragging source protocol implementation
*/

View file

@ -237,7 +237,7 @@ extern NSString *GormResizeCellNotification;
- (id) changeSelection: (id)sender;
@end
@interface GormObjectEditor : GormGenericEditor
@interface GormObjectEditor : GormGenericEditor
{
}
+ (void) setEditor: (id)editor forDocument: (id<IBDocuments>)aDocument;
@ -246,9 +246,10 @@ extern NSString *GormResizeCellNotification;
- (BOOL) acceptsTypeFromArray: (NSArray*)types;
- (void) makeSelectionVisible: (BOOL)flag;
- (void) resetObject: (id)anObject;
- (void) removeAllInstancesOfClass: (NSString *)className;
@end
@interface GormSoundEditor : GormGenericEditor
@interface GormSoundEditor : GormGenericEditor
{
}
+ (GormSoundEditor*) editorForDocument: (id<IBDocuments>)aDocument;
@ -256,7 +257,7 @@ extern NSString *GormResizeCellNotification;
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag;
@end
@interface GormImageEditor : GormGenericEditor
@interface GormImageEditor : GormGenericEditor
{
}
- (void) draggedImage: (NSImage*)i endedAt: (NSPoint)p deposited: (BOOL)f;