mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 14:10:44 +00:00
Added missed file
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@9907 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9a45909aab
commit
176f790bc3
1 changed files with 66 additions and 0 deletions
66
GormClassEditor.m
Normal file
66
GormClassEditor.m
Normal file
|
@ -0,0 +1,66 @@
|
|||
#import "Gorm.h"
|
||||
#import "GormPrivate.h"
|
||||
|
||||
@implementation GormClassEditor
|
||||
|
||||
- (GormClassEditor*) initWithDocument: (GormDocument*)doc
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
document = doc; // loose connection
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(selectedClassName);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
+ (GormClassEditor*) classEditorForDocument: (GormDocument*)doc
|
||||
{
|
||||
return AUTORELEASE([[self alloc] initWithDocument: doc]);
|
||||
}
|
||||
|
||||
- (void) setSelectedClassName: (NSString*)cn
|
||||
{
|
||||
ASSIGN(selectedClassName, cn);
|
||||
}
|
||||
|
||||
//--- IBSelectionOwners protocol ---
|
||||
- (unsigned) selectionCount
|
||||
{
|
||||
return (selectedClassName == nil)?0: 1;
|
||||
}
|
||||
|
||||
- (NSArray*) selection
|
||||
{
|
||||
// when asked for a selection, it returns a class proxy
|
||||
if (selectedClassName != nil)
|
||||
{
|
||||
NSArray *array;
|
||||
GormClassProxy *classProxy;
|
||||
|
||||
classProxy = [[GormClassProxy alloc] initWithClassName:
|
||||
selectedClassName];
|
||||
array = [NSArray arrayWithObject: classProxy];
|
||||
RELEASE(classProxy);
|
||||
return array;
|
||||
}
|
||||
else
|
||||
{
|
||||
return [NSArray array];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) drawSelection
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
Loading…
Reference in a new issue