mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 21:00:44 +00:00
* EOAccess/EOEntity.m (-addSubEntity:): Remove the child as a
sub-entity of its previous parent. * DBModeler/Inspectors/AdvancedEntityInspector.[h,m,gorm]: add ability to set parent entity. * GDL2Palette/KeyWrapper.h: Add QueryType. * GDL2Palette/ConnectionInspector.m: add/remove comments. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@23696 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7ac22ff2fe
commit
931152a444
8 changed files with 87 additions and 10 deletions
|
@ -23,6 +23,13 @@
|
|||
* DBModeler/DefaultColumnProvider.h/m: declare default columns as
|
||||
extern.
|
||||
|
||||
* EOAccess/EOEntity.m (-addSubEntity:): Remove the child as a
|
||||
sub-entity of its previous parent.
|
||||
* DBModeler/Inspectors/AdvancedEntityInspector.[h,m,gorm]:
|
||||
add ability to set parent entity.
|
||||
* GDL2Palette/KeyWrapper.h: Add QueryType.
|
||||
* GDL2Palette/ConnectionInspector.m: add/remove comments.
|
||||
|
||||
2006-09-28 Matt Rice <ratmice@yahoo.com>
|
||||
|
||||
* EOAccess/EOSQLExpression.m
|
||||
|
|
|
@ -4,12 +4,16 @@
|
|||
Actions = (
|
||||
"setAbstractAction:",
|
||||
"setReadOnlyAction:",
|
||||
"setCachesObjectsAction:"
|
||||
"setCachesObjectsAction:",
|
||||
"entityAction:",
|
||||
"parentAction:"
|
||||
);
|
||||
Outlets = (
|
||||
abstract,
|
||||
readOnly,
|
||||
cachesObjects
|
||||
cachesObjects,
|
||||
entities,
|
||||
parent
|
||||
);
|
||||
Super = EOMInspector;
|
||||
};
|
||||
|
@ -24,8 +28,10 @@
|
|||
};
|
||||
FirstResponder = {
|
||||
Actions = (
|
||||
"setCachesObjectsAction:",
|
||||
"entityAction:",
|
||||
"parentAction:",
|
||||
"setAbstractAction:",
|
||||
"setCachesObjectsAction:",
|
||||
"setReadOnlyAction:"
|
||||
);
|
||||
Super = NSObject;
|
||||
|
|
Binary file not shown.
|
@ -22,17 +22,23 @@
|
|||
*/
|
||||
#include <AppKit/NSNibDeclarations.h>
|
||||
#include <EOModeler/EOMInspector.h>
|
||||
|
||||
@class NSButton;
|
||||
@class NSTableView;
|
||||
|
||||
@interface AdvancedEntityInspector : EOMInspector
|
||||
{
|
||||
IBOutlet NSButton *abstract;
|
||||
IBOutlet NSButton *readOnly;
|
||||
IBOutlet NSButton *cachesObjects;
|
||||
IBOutlet NSButton *parent;
|
||||
IBOutlet NSTableView *entities;
|
||||
}
|
||||
|
||||
- (IBAction) setAbstractAction:(id)sender;
|
||||
- (IBAction) setReadOnlyAction:(id)sender;
|
||||
- (IBAction) setCachesObjectsAction:(id)sender;
|
||||
- (IBAction) parentAction:(id)sender;
|
||||
- (IBAction) entityAction:(id)sender;
|
||||
@end
|
||||
|
||||
|
|
|
@ -24,10 +24,20 @@
|
|||
#include "AdvancedEntityInspector.h"
|
||||
#include <EOModeler/EOMInspector.h>
|
||||
#include <EOAccess/EOEntity.h>
|
||||
#include <EOAccess/EOModel.h>
|
||||
#include <AppKit/NSButton.h>
|
||||
#include <AppKit/NSTableView.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
|
||||
@implementation AdvancedEntityInspector
|
||||
- (NSString *)displayName
|
||||
{
|
||||
return @"Adv Entity";
|
||||
}
|
||||
- (BOOL) canInspectObject:(id)anObject
|
||||
{
|
||||
return [anObject isKindOfClass:[EOEntity class]];
|
||||
}
|
||||
|
||||
- (void) setReadOnlyAction:(id)sender
|
||||
{
|
||||
|
@ -44,15 +54,64 @@
|
|||
[(EOEntity *)[self selectedObject] setCachesObjects:[cachesObjects state] == NSOnState ? YES : NO];
|
||||
}
|
||||
|
||||
- (IBAction) parentAction:(id)sender;
|
||||
{
|
||||
EOEntity *selObj;
|
||||
EOEntity *selectedParent;
|
||||
int selectedRow;
|
||||
|
||||
selectedRow = [entities selectedRow];
|
||||
if (selectedRow == -1) return;
|
||||
|
||||
selObj = [self selectedObject];
|
||||
selectedParent = [[[selObj model] entities]
|
||||
objectAtIndex:[entities selectedRow]];
|
||||
|
||||
if ([selObj parentEntity] == selectedParent)
|
||||
{
|
||||
[selectedParent removeSubEntity:selObj];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[selObj parentEntity] removeSubEntity:selObj];
|
||||
[selectedParent addSubEntity:selObj];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) refresh
|
||||
{
|
||||
[abstract setState:[(EOEntity *)[self selectedObject] isAbstractEntity] ? NSOnState : NSOffState];
|
||||
[readOnly setState:[(EOEntity *)[self selectedObject] isReadOnly] ? NSOnState : NSOffState];
|
||||
[cachesObjects setState:[(EOEntity *)[self selectedObject] cachesObjects] ? NSOnState : NSOffState];
|
||||
[entities reloadData];
|
||||
[entities deselectAll:self];
|
||||
[parent setEnabled:NO];
|
||||
[parent setState:NSOnState];
|
||||
}
|
||||
|
||||
- (BOOL) canInspectObject:(id)anObject
|
||||
- (void) entityAction:(id)sender
|
||||
{
|
||||
return [anObject isKindOfClass:[EOEntity class]];
|
||||
EOEntity *selObj;
|
||||
EOEntity *selectedParent;
|
||||
int selectedRow = [sender selectedRow];
|
||||
|
||||
selObj = [self selectedObject];
|
||||
if (selectedRow == -1) return;
|
||||
|
||||
selectedParent = [[[selObj model] entities]
|
||||
objectAtIndex:selectedRow];
|
||||
[parent setEnabled:YES];
|
||||
[parent setState: ([selObj parentEntity] == selectedParent) ? NSOnState : NSOffState];
|
||||
}
|
||||
|
||||
- (int) numberOfRowsInTableView:(NSTableView *)tv
|
||||
{
|
||||
return [[[[self selectedObject] model] entities] count];
|
||||
}
|
||||
|
||||
- (id) tableView:(NSTableView *)tv objectValueForTableColumn:(NSTableColumn *)tc row:(int)row
|
||||
{
|
||||
return [[[[[self selectedObject] model] entities] objectAtIndex:row] name];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -2336,6 +2336,7 @@ createInstanceWithEditingContext:globalID:zone:
|
|||
{
|
||||
[self willChange];
|
||||
[_subEntities addObject: child];
|
||||
[[child parentEntity] removeSubEntity:self];
|
||||
[child setParentEntity: self];
|
||||
}
|
||||
|
||||
|
|
|
@ -56,10 +56,6 @@
|
|||
- (NSArray *) _associationClassesUsableWithObject:(id)anObject;
|
||||
@end
|
||||
|
||||
/* TODO get notifications for IB{Will,Did}RemoveConnectorNotification
|
||||
* and remove the object from the _objectToAssociation map table if
|
||||
* there are no more connectors for it */
|
||||
|
||||
@interface NSApplication(missingStuff)
|
||||
- (GormClassManager *)classManager;
|
||||
@end
|
||||
|
@ -182,6 +178,7 @@
|
|||
if (repObj == nil)
|
||||
{
|
||||
/* gorm specific... but couldn't find a public standard api replacement */
|
||||
/* see bug #17822 */
|
||||
_keys = RETAIN([[NSApp classManager] allOutletsForObject:object]);
|
||||
_signatures = nil;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,8 @@ typedef enum KeyType
|
|||
ToOneRelationshipType = 2,
|
||||
ToManyRelationshipType = 4,
|
||||
OtherType = 8,
|
||||
LocalType = 16
|
||||
LocalType = 16,
|
||||
QueryType = 32
|
||||
}KeyType;
|
||||
|
||||
@interface KeyWrapper: NSObject
|
||||
|
|
Loading…
Reference in a new issue