* GormCore/GormClassManager.h: Added declaration findByClassName:

* GormCore/GormClassManager.m: Added findClassByName: method to 
	find classes with partial text matches.
	* GormCore/GormDocument.m: Modified controlTextDidChange: to call
	findClassByName:.
	* GormCore/GormGModelWrapperLoader.m: Change className to cm
	in initWithModelUnarchiver: to avoid warning.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@23684 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-09-30 16:08:29 +00:00
parent ee19d1de23
commit b310241acd
5 changed files with 58 additions and 6 deletions

View file

@ -1,3 +1,13 @@
2006-09-30 12:00-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormClassManager.h: Added declaration findByClassName:
* GormCore/GormClassManager.m: Added findClassByName: method to
find classes with partial text matches.
* GormCore/GormDocument.m: Modified controlTextDidChange: to call
findClassByName:.
* GormCore/GormGModelWrapperLoader.m: Change className to cm
in initWithModelUnarchiver: to avoid warning.
2006-09-29 22:56-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* English.lproj/GormDocument.gorm: Added "Remove" to Operations

View file

@ -115,6 +115,7 @@
- (NSString *) nonCustomSuperClassOf: (NSString *)className;
- (BOOL) isAction: (NSString *)actionName onCategoryForClassNamed: (NSString *)className;
- (NSString *) classNameForObject: (id)object;
- (NSString *) findClassByName: (NSString *)name;
/* Parsing and creating classes */
- (BOOL) makeSourceAndHeaderFilesForClass: (NSString *)className

View file

@ -2166,6 +2166,39 @@
return YES;
}
- (NSString *) findClassByName: (NSString *)name
{
NSArray *classNames = [self allClassNames];
NSEnumerator *en = [classNames objectEnumerator];
NSString *className = nil;
int namelen = [name length];
while((className = [en nextObject]) != nil)
{
int classlen = [className length];
if(namelen < classlen)
{
NSComparisonResult result =
[className compare: name
options: NSCaseInsensitiveSearch
range: ((NSRange){0, namelen})];
if(result == NSOrderedSame)
{
break;
}
}
else if(namelen == classlen)
{
if([className caseInsensitiveCompare: name] == NSOrderedSame)
{
break;
}
}
}
return className;
}
- (NSString *) description
{
return [NSString stringWithFormat: @"<%s: %lx> = %@",

View file

@ -1819,8 +1819,15 @@ static NSImage *fileImage = nil;
GSNibItem *item = nil;
if([object isEqualToString: @"FirstResponder"])
return nil;
{
return nil;
}
if([classManager canInstantiateClassNamed: object] == NO)
{
return nil;
}
if([classManager isSuperclass: @"NSView" linkedToClass: object] ||
[object isEqual: @"NSView"])
{
@ -3578,7 +3585,8 @@ static NSImage *fileImage = nil;
- (void)controlTextDidChange:(NSNotification *)aNotification
{
id object = [aNotification object];
[classesView selectClass: [object stringValue]];
NSString *className = [classManager findClassByName: [object stringValue]];
[classesView selectClass: className];
}
@end

View file

@ -193,15 +193,15 @@ static BOOL gormFileOwnerDecoded;
- (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver
{
NSString *className;
NSString *cn;
id realObject;
id extension;
className = [unarchiver decodeStringWithName: @"className"];
cn = [unarchiver decodeStringWithName: @"className"];
extension = [unarchiver decodeObjectWithName: @"extension"];
realObject = [unarchiver decodeObjectWithName: @"realObject"];
[self setFrame: [unarchiver decodeRectWithName: @"frame"]];
[self setClassName: className];
[self setClassName: cn];
if (!gormFileOwnerDecoded)
{