2005-05-13 00:25:27 +00:00
|
|
|
/**
|
|
|
|
DefaultColumnProvider.m
|
|
|
|
|
2007-01-05 16:17:04 +00:00
|
|
|
Author: Matt Rice <ratmice@gmail.com>
|
2006-09-21 07:24:22 +00:00
|
|
|
Date: Apr 2005, 2006
|
2005-05-13 00:25:27 +00:00
|
|
|
|
|
|
|
This file is part of DBModeler.
|
|
|
|
|
|
|
|
<license>
|
|
|
|
DBModeler is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-07-12 06:39:22 +00:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2005-05-13 00:25:27 +00:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
DBModeler is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with DBModeler; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
</license>
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
|
|
#include "DefaultColumnProvider.h"
|
|
|
|
#include "ModelerEntityEditor.h"
|
|
|
|
|
|
|
|
#include <EOModeler/EOModelerApp.h>
|
|
|
|
#include <EOInterface/EOColumnAssociation.h>
|
|
|
|
#include <EOAccess/EOAttribute.h>
|
|
|
|
#include <EOAccess/EOEntity.h>
|
2008-05-09 20:21:17 +00:00
|
|
|
#include <EOAccess/EORelationship.h>
|
2005-05-13 00:25:27 +00:00
|
|
|
|
2008-05-09 20:21:17 +00:00
|
|
|
#ifdef NeXT_GUI_LIBRARY
|
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
#else
|
2005-05-13 00:25:27 +00:00
|
|
|
#include <AppKit/NSTableColumn.h>
|
2006-09-05 22:18:35 +00:00
|
|
|
#include <AppKit/NSTableHeaderCell.h>
|
2005-05-13 00:25:27 +00:00
|
|
|
#include <AppKit/NSCell.h>
|
|
|
|
#include <AppKit/NSTextFieldCell.h>
|
|
|
|
#include <AppKit/NSButtonCell.h>
|
|
|
|
#include <AppKit/NSTableView.h>
|
|
|
|
#include <AppKit/NSImage.h>
|
2008-05-09 20:21:17 +00:00
|
|
|
#endif
|
2005-05-13 00:25:27 +00:00
|
|
|
|
2008-05-09 20:21:17 +00:00
|
|
|
#ifdef NeXT_Foundation_LIBRARY
|
|
|
|
#include <Foundation/Foundation.h>
|
|
|
|
#else
|
2005-05-13 00:25:27 +00:00
|
|
|
#include <Foundation/NSDictionary.h>
|
2008-05-09 20:21:17 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <GNUstepBase/GNUstep.h>
|
2005-05-13 00:25:27 +00:00
|
|
|
|
|
|
|
#define DICTSIZE(dict) (sizeof(dict) / sizeof(dict[0]))
|
2006-09-05 22:18:35 +00:00
|
|
|
|
2005-05-13 00:25:27 +00:00
|
|
|
static DefaultColumnProvider *_sharedDefaultColumnProvider;
|
|
|
|
static NSMutableDictionary *_aspectsAndKeys;
|
2006-09-16 13:02:02 +00:00
|
|
|
|
2006-10-01 16:32:23 +00:00
|
|
|
NSMutableArray *DefaultEntityColumns;
|
|
|
|
NSMutableArray *DefaultAttributeColumns;
|
|
|
|
NSMutableArray *DefaultRelationshipColumns;
|
|
|
|
|
2006-09-05 22:18:35 +00:00
|
|
|
struct column_info {
|
|
|
|
NSString *key;
|
|
|
|
NSString *name;
|
|
|
|
BOOL isDefault;
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct column_info attribute_columns[] = {
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
{@"isPrimaryKey", @"Primary key", YES},
|
|
|
|
{@"isClassProperty", @"Class property", YES},
|
|
|
|
{@"allowNull", @"Allows null", YES},
|
|
|
|
{@"isUsedForLocking", @"Locking", YES},
|
|
|
|
{@"name", @"Name", YES},
|
|
|
|
{@"columnName", @"Column name", YES},
|
|
|
|
{@"valueClassName", @"Value class name", YES},
|
|
|
|
{@"externalType", @"External Type", YES},
|
|
|
|
{@"definition", @"Definition", NO},
|
|
|
|
{@"precision", @"Precision", NO},
|
|
|
|
{@"readFormat", @"Read format", NO},
|
|
|
|
{@"scale", @"Scale", NO},
|
|
|
|
{@"valueType", @"Value type", NO},
|
|
|
|
{@"width", @"Width", YES},
|
|
|
|
{@"writeFormat", @"Write format", NO}
|
2005-05-13 00:25:27 +00:00
|
|
|
};
|
|
|
|
|
2006-09-05 22:18:35 +00:00
|
|
|
static struct column_info relationship_columns[]= {
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
{@"isClassProperty", @"Class property", YES},
|
|
|
|
{@"definition", @"Definition", NO},
|
|
|
|
{@"name", @"Name", YES},
|
|
|
|
{@"destinationEntity.name", @"Destination Entity", YES}
|
|
|
|
|
2005-05-13 00:25:27 +00:00
|
|
|
};
|
|
|
|
|
2006-09-05 22:18:35 +00:00
|
|
|
static struct column_info entity_columns[] = {
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
{@"name", @"Name", YES},
|
|
|
|
{@"className", @"Class name", YES},
|
|
|
|
{@"externalName", @"External name", YES},
|
|
|
|
{@"externalQuery", @"External query", NO},
|
|
|
|
{@"parentEntity.name", @"Parent", NO}
|
2005-05-13 00:25:27 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
@implementation DefaultColumnProvider
|
|
|
|
/* function to create a NSDictionary out of the c arrays..
|
|
|
|
* which looks like
|
|
|
|
{
|
|
|
|
Class = {
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
columnName1 = "aspectKey1";
|
|
|
|
columnName2 = "aspectKey2";
|
|
|
|
};
|
|
|
|
|
2005-05-13 00:25:27 +00:00
|
|
|
Class2 = {
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
otherColumnName = "otherAspectKey";
|
|
|
|
};
|
2005-05-13 00:25:27 +00:00
|
|
|
}
|
2006-09-16 13:02:02 +00:00
|
|
|
*/
|
2006-09-05 22:18:35 +00:00
|
|
|
void registerColumnsForClass(struct column_info columns[], int count, Class aClass,NSMutableArray *defaultColumnsArray)
|
2005-05-13 00:25:27 +00:00
|
|
|
{
|
|
|
|
id *objects;
|
|
|
|
id *keys;
|
* DBModeler/AdaptorsPanel.m (-init): Add parenthesis around
assignment. Replace label with window title.
(-runAdaptorsPanel:): Remove unused variable.
* DBModeler/DefaultColumnProvider.m: Add missing braces, remove
unused ivars.
(-cellForColumnNamed:): Autorelease cells.
* DBModeler/EOAdditions.m: New EOAttribute KVC methods -allowNull and
-setAllowNull:.
* DBModeler/GNUmakefile: Add new to project.
* DBModeler/KVDataSource.m (-createObject:): Return nil after
throwing exception.
* DBModeler/MainModelEditor.m
(-dragImageForRows:event:dragImageOffset:):: Enable drag and
drop for relationships.
(-initWithDocument:): Add parenthesis around assignment. Don't
release the document window on close.
(-ecStuff:): temporarily reload everything in the outline view when
something changes.
(-viewSelectedObject:): Remove NSLog. Rewrite editor activation.
Fix leaks.
* DBModeler/Modeler.m (-applicationWillFinishLaunching:): Add new menu
items. Don't order our menu in.
(-new:,-open:): Move document initializition to _newDocumentWithModel:.
(-_newDocumentWithModel:,-newFromDatabase:): New methods.
(-validateMenuItem:,-generateSQL:): Ditto.
* DBModeler/ModelerAttributeEditor.m (-initWithParentEditor:):
Remove unused variables.
(-displayGroupDidChangeSelection:): return early if there is no
longer a selection.
* DBModeler/ModelerEntityEditor.m:
(-canSupportCurrentSelection): Remove NSLog.
(-displayGroupDidChangeSelection:): Ditto.
(-dealloc:): New method.
(-initWithParentEditor:): Remove unused variables. Add parens around
assignment. Release local variables.
* DBModeler/ModelerTableEmbedibleEditor:
(-addDefaultTableColumnsForTableView:displayGroup:): Release table
columns.
(-addTableColumnForItem:tableView:): Ditto.
* DBModeler/Inspectors/RelationshipInspector.m:
(-selectedEntity, -selectedDestinationAttribute): New methods.
(-selectedSourceAttribute, -indexOfSourceAttribute:): Ditto.
(-indexOfDestinationAttribute:,joinWithSource:destination:): Ditto.
(-selectedJoin:,updateConnectButton,): Ditto.
(-refresh): Rewrite using new methods.
(-numberOfRowsInTableView:): Add fallback return value.
(-tableView:objectValueForTableColumn:row:): Ditto.
(-tableView:selectionDidChange:): If a source or destination
attribute is now selected, select its counterpart.
(-tableView:shouldSelectRow:): New method to disallow entity
selection if there is a destination entity.
(-tableView:willDisplayCell:forTableColumn:row:): New method,
set the cell text color to disabled text color, if we would disallow
selection.
(-connectionChanged:): Implement disconnection.
* DBModeler/SQLGenerator.h/m: New files initial implementation.
* DBModeler/Resources/SQLGenerator.gorm: Ditto.
* DBModeler/ConsistencyChecker.h/m: Ditto.
* DBModeler/ConsistencyResults.h/m: Ditto.
* DBModeler/ConsistencyResults.gorm: Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21438 72102866-910b-0410-8b05-ffd578937521
2005-07-09 02:07:42 +00:00
|
|
|
int i;
|
2005-05-13 00:25:27 +00:00
|
|
|
size_t size;
|
|
|
|
NSDictionary *tmp;
|
|
|
|
size = (count * sizeof(id));
|
|
|
|
|
|
|
|
objects = (id *)NSZoneMalloc([_sharedDefaultColumnProvider zone], size);
|
|
|
|
keys = (id *)NSZoneMalloc([_sharedDefaultColumnProvider zone], size);
|
|
|
|
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
{
|
2006-09-05 22:18:35 +00:00
|
|
|
objects[i] = columns[i].key;
|
|
|
|
keys[i] = columns[i].name;
|
|
|
|
if (columns[i].isDefault == YES)
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
{
|
|
|
|
[defaultColumnsArray addObject:keys[i]];
|
|
|
|
}
|
2005-05-13 00:25:27 +00:00
|
|
|
}
|
|
|
|
tmp = [NSDictionary dictionaryWithObjects:objects
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
forKeys:keys
|
|
|
|
count:count];
|
2005-05-13 00:25:27 +00:00
|
|
|
[EOMApp registerColumnNames: [tmp allKeys]
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
forClass: aClass
|
|
|
|
provider:_sharedDefaultColumnProvider];
|
2005-05-13 00:25:27 +00:00
|
|
|
NSZoneFree([_sharedDefaultColumnProvider zone], objects);
|
|
|
|
NSZoneFree([_sharedDefaultColumnProvider zone], keys);
|
|
|
|
|
|
|
|
[_aspectsAndKeys setObject: tmp
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
forKey: aClass];
|
2005-05-13 00:25:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (void)initialize
|
|
|
|
{
|
|
|
|
|
|
|
|
DefaultEntityColumns = [[NSMutableArray alloc] init];
|
|
|
|
DefaultAttributeColumns = [[NSMutableArray alloc] init];
|
|
|
|
DefaultRelationshipColumns = [[NSMutableArray alloc] init];
|
|
|
|
|
|
|
|
_sharedDefaultColumnProvider = [[self alloc] init];
|
|
|
|
_aspectsAndKeys = [[NSMutableDictionary alloc] init];
|
|
|
|
registerColumnsForClass(attribute_columns,
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
DICTSIZE(attribute_columns),
|
|
|
|
[EOAttribute class],
|
|
|
|
DefaultAttributeColumns);
|
2005-05-13 00:25:27 +00:00
|
|
|
registerColumnsForClass(entity_columns,
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
DICTSIZE(entity_columns),
|
|
|
|
[EOEntity class],
|
|
|
|
DefaultEntityColumns);
|
2005-05-13 00:25:27 +00:00
|
|
|
registerColumnsForClass(relationship_columns,
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
DICTSIZE(relationship_columns),
|
|
|
|
[EORelationship class],
|
|
|
|
DefaultRelationshipColumns);
|
2005-05-13 00:25:27 +00:00
|
|
|
}
|
|
|
|
|
2006-09-05 22:18:35 +00:00
|
|
|
- (void) setupTitleForColumn:(NSTableColumn *)tc named:(NSString *)name
|
|
|
|
{
|
* EOAccess/EOSQLExpression.h (deleteStatementWithQualifier:entity:)
* EOAccess/EOSQLExpressionPriv.h (_aliasForRelationshipPath:)
(_flattenRelPath:entity:, _aliasForRelatedAttribute:relationshipPath:)
* EOAccess/EOSQLExpression.m (insertStatementForRow:entity:)
(updateStatementForRow:qualifier:entity:)
(deleteStatementWithQualifier:entity:)
(selectStatementForAttributes:lock:fetchSpecification:entity:)
(_aliasForRelationshipPath:)
* EOAccess/EORelationship.h (intermediateEntity)
(_foreignKeyForSourceRow:)
* EOAccess/EORelationship.m (_foreignKeyForSourceRow:, _leftSideKeyMap)
* EOAccess/EODatabaseContext.h (databaseOperationForObject:)
(databaseOperationForGlobalID:, recordDatabaseOperation:)
(_openChannelWithLoginPanel:)
* EOAccess/EODatabaseContextPriv.h (primaryKeyForObject:)
(_currentCommittedSnapshotForObject:)
* EOAccess/EOEntityPriv.h (_keyMapForRelationshipPath:)
(_keyMapForIdenticalKeyRelationshipPath:, _mapAttribute:)
(_relationshipPathIsToMany: valueForSQLExpression:)
(_parsePropertyName:, classPropertyAttributeNames)
(classPropertyToManyRelationshipNames)
(classPropertyToOneRelationshipNames, dbSnapshotKeys)
* EOAccess/EOUtilities.m (rawRowsForEntityNamed:qualifierFormat:)
(rawRowsMatchingValue:forKey:entityNamed:)
(rawRowsMatchingValues:entityNamed:, rawRowsWithSQL:modelNamed:)
(rawRowsWithStoredProcedureNamed:arguments:)
(executeStoredProcedureNamed:arguments:, databaseContextForModelNamed:)
(primaryKeyForObject:)
(destinationKeyForSourceObject:relationshipNamed:)
* EOAccess/EOEntity.m
(_mapAttribute:toDestinationAttributeInLastComponentOfRelationshipPath:)
* EOAccess/EOAdaptor.h (adaptorWithModel:,adaptorWithName:)
* EOAccess/EOModel.h (_classDescriptionNeeded:,_entityForClass:)
(_addEntityWithPropertyList:)
* EOAdaptors/Postgres95/Postgres95Channel.h
(_evaluateExpression:withAttributes:)
* EOControl/EOMutableKnownKeyDictionary.h/m (arrayMappingForKeys:)
(subsetMappingForSourceDictionaryInitializer:sourceKeys:destinationKeys:)
(subsetMappingForSourceDictionaryInitializer:)
(setObject:forKey:, removeObjectForKey:, indexForKey:, objectForKey:)
* EOControl/EOEditingContext.m (handleErrors:,setSharedEditingContext:)
(faultForRawRow:entityNamed:)
* GDL2Palette/KeyWrapper.h (setKey:, _key):
* EOModeler/EOModelerEditor.h (selectionWithinViewedObject)
* EOModeler/EOModelerEditor.m (initWithDocument:)
(initWithParentEditor:)
Correct method signatures. Add necessary forward @class declations.
* EOInterface/EOMasterDetailAssociation.m (establishConnection):
* DBModeler/ModelerTableEmbedibleEditor.m
(addDefaultTableColumnsForTableView:displayGroup:)
* DBModeler/DefaultColumnProvider.m (setupTitleForColumn:named:)
Cast types to avoid compiler warnings.
* EOControl/EOCheapArray.m (dealloc): Supress compiler warning.
* EOAdaptors/Postgres95/LoginPanel/Postgres95LoginPanel.m (dealloc)
* EOModeler/EOModelerEditor.m (dealloc):
* DBModeler/ModelerAttributeEditor.m (dealloc): Add missing call
to super.
* DBModeler/Preferences.m (sharedPreferences): Fix implementation for
new compiler semantics.
* EOControl/EOMultiReaderLock.m (init): Correct NSConditionLock
initialization.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@23472 72102866-910b-0410-8b05-ffd578937521
2006-09-12 19:36:24 +00:00
|
|
|
NSTableHeaderCell *headerCell = (id)[tc headerCell];
|
2006-09-05 22:18:35 +00:00
|
|
|
if ([name isEqual:@"Primary key"])
|
|
|
|
{
|
|
|
|
NSImage *img = [NSImage imageNamed:@"Key_Header"];
|
|
|
|
[headerCell setImage:img];
|
|
|
|
}
|
|
|
|
else if ([name isEqual:@"Class property"])
|
|
|
|
[headerCell setImage:[NSImage imageNamed:@"ClassProperty_Header"]];
|
|
|
|
else if ([name isEqual:@"Locking"])
|
|
|
|
[headerCell setImage:[NSImage imageNamed:@"Locking_Header"]];
|
2006-09-16 13:27:05 +00:00
|
|
|
else if ([name isEqual:@"Allows null"])
|
|
|
|
[headerCell setImage:[NSImage imageNamed:@"AllowsNull_Header"]];
|
2006-09-05 22:18:35 +00:00
|
|
|
else if ([name isEqual:@"Name"])
|
|
|
|
{
|
|
|
|
[tc setWidth:100.0];
|
|
|
|
[headerCell setStringValue:name];
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[headerCell setStringValue:name];
|
|
|
|
}
|
|
|
|
[tc sizeToFit];
|
|
|
|
}
|
|
|
|
|
2005-05-13 00:25:27 +00:00
|
|
|
- (NSCell *)cellForColumnNamed:(NSString *)name
|
|
|
|
{
|
* DBModeler/AdaptorsPanel.m (-init): Add parenthesis around
assignment. Replace label with window title.
(-runAdaptorsPanel:): Remove unused variable.
* DBModeler/DefaultColumnProvider.m: Add missing braces, remove
unused ivars.
(-cellForColumnNamed:): Autorelease cells.
* DBModeler/EOAdditions.m: New EOAttribute KVC methods -allowNull and
-setAllowNull:.
* DBModeler/GNUmakefile: Add new to project.
* DBModeler/KVDataSource.m (-createObject:): Return nil after
throwing exception.
* DBModeler/MainModelEditor.m
(-dragImageForRows:event:dragImageOffset:):: Enable drag and
drop for relationships.
(-initWithDocument:): Add parenthesis around assignment. Don't
release the document window on close.
(-ecStuff:): temporarily reload everything in the outline view when
something changes.
(-viewSelectedObject:): Remove NSLog. Rewrite editor activation.
Fix leaks.
* DBModeler/Modeler.m (-applicationWillFinishLaunching:): Add new menu
items. Don't order our menu in.
(-new:,-open:): Move document initializition to _newDocumentWithModel:.
(-_newDocumentWithModel:,-newFromDatabase:): New methods.
(-validateMenuItem:,-generateSQL:): Ditto.
* DBModeler/ModelerAttributeEditor.m (-initWithParentEditor:):
Remove unused variables.
(-displayGroupDidChangeSelection:): return early if there is no
longer a selection.
* DBModeler/ModelerEntityEditor.m:
(-canSupportCurrentSelection): Remove NSLog.
(-displayGroupDidChangeSelection:): Ditto.
(-dealloc:): New method.
(-initWithParentEditor:): Remove unused variables. Add parens around
assignment. Release local variables.
* DBModeler/ModelerTableEmbedibleEditor:
(-addDefaultTableColumnsForTableView:displayGroup:): Release table
columns.
(-addTableColumnForItem:tableView:): Ditto.
* DBModeler/Inspectors/RelationshipInspector.m:
(-selectedEntity, -selectedDestinationAttribute): New methods.
(-selectedSourceAttribute, -indexOfSourceAttribute:): Ditto.
(-indexOfDestinationAttribute:,joinWithSource:destination:): Ditto.
(-selectedJoin:,updateConnectButton,): Ditto.
(-refresh): Rewrite using new methods.
(-numberOfRowsInTableView:): Add fallback return value.
(-tableView:objectValueForTableColumn:row:): Ditto.
(-tableView:selectionDidChange:): If a source or destination
attribute is now selected, select its counterpart.
(-tableView:shouldSelectRow:): New method to disallow entity
selection if there is a destination entity.
(-tableView:willDisplayCell:forTableColumn:row:): New method,
set the cell text color to disabled text color, if we would disallow
selection.
(-connectionChanged:): Implement disconnection.
* DBModeler/SQLGenerator.h/m: New files initial implementation.
* DBModeler/Resources/SQLGenerator.gorm: Ditto.
* DBModeler/ConsistencyChecker.h/m: Ditto.
* DBModeler/ConsistencyResults.h/m: Ditto.
* DBModeler/ConsistencyResults.gorm: Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21438 72102866-910b-0410-8b05-ffd578937521
2005-07-09 02:07:42 +00:00
|
|
|
|
2005-05-13 00:25:27 +00:00
|
|
|
/* TODO need a switch button for "Locking" and "Allows null" */
|
|
|
|
if ([name isEqual:@"Primary key"])
|
|
|
|
{
|
|
|
|
NSButtonCell *cell = [[NSButtonCell alloc] initImageCell:nil];
|
|
|
|
|
|
|
|
[cell setButtonType:NSSwitchButton];
|
|
|
|
[cell setImagePosition:NSImageOnly];
|
|
|
|
[cell setBordered:NO];
|
|
|
|
[cell setBezeled:NO];
|
|
|
|
[cell setAlternateImage:[NSImage imageNamed:@"Key_On"]];
|
|
|
|
[cell setControlSize: NSSmallControlSize];
|
2006-12-29 00:09:01 +00:00
|
|
|
[cell setEditable:NO];
|
* DBModeler/AdaptorsPanel.m (-init): Add parenthesis around
assignment. Replace label with window title.
(-runAdaptorsPanel:): Remove unused variable.
* DBModeler/DefaultColumnProvider.m: Add missing braces, remove
unused ivars.
(-cellForColumnNamed:): Autorelease cells.
* DBModeler/EOAdditions.m: New EOAttribute KVC methods -allowNull and
-setAllowNull:.
* DBModeler/GNUmakefile: Add new to project.
* DBModeler/KVDataSource.m (-createObject:): Return nil after
throwing exception.
* DBModeler/MainModelEditor.m
(-dragImageForRows:event:dragImageOffset:):: Enable drag and
drop for relationships.
(-initWithDocument:): Add parenthesis around assignment. Don't
release the document window on close.
(-ecStuff:): temporarily reload everything in the outline view when
something changes.
(-viewSelectedObject:): Remove NSLog. Rewrite editor activation.
Fix leaks.
* DBModeler/Modeler.m (-applicationWillFinishLaunching:): Add new menu
items. Don't order our menu in.
(-new:,-open:): Move document initializition to _newDocumentWithModel:.
(-_newDocumentWithModel:,-newFromDatabase:): New methods.
(-validateMenuItem:,-generateSQL:): Ditto.
* DBModeler/ModelerAttributeEditor.m (-initWithParentEditor:):
Remove unused variables.
(-displayGroupDidChangeSelection:): return early if there is no
longer a selection.
* DBModeler/ModelerEntityEditor.m:
(-canSupportCurrentSelection): Remove NSLog.
(-displayGroupDidChangeSelection:): Ditto.
(-dealloc:): New method.
(-initWithParentEditor:): Remove unused variables. Add parens around
assignment. Release local variables.
* DBModeler/ModelerTableEmbedibleEditor:
(-addDefaultTableColumnsForTableView:displayGroup:): Release table
columns.
(-addTableColumnForItem:tableView:): Ditto.
* DBModeler/Inspectors/RelationshipInspector.m:
(-selectedEntity, -selectedDestinationAttribute): New methods.
(-selectedSourceAttribute, -indexOfSourceAttribute:): Ditto.
(-indexOfDestinationAttribute:,joinWithSource:destination:): Ditto.
(-selectedJoin:,updateConnectButton,): Ditto.
(-refresh): Rewrite using new methods.
(-numberOfRowsInTableView:): Add fallback return value.
(-tableView:objectValueForTableColumn:row:): Ditto.
(-tableView:selectionDidChange:): If a source or destination
attribute is now selected, select its counterpart.
(-tableView:shouldSelectRow:): New method to disallow entity
selection if there is a destination entity.
(-tableView:willDisplayCell:forTableColumn:row:): New method,
set the cell text color to disabled text color, if we would disallow
selection.
(-connectionChanged:): Implement disconnection.
* DBModeler/SQLGenerator.h/m: New files initial implementation.
* DBModeler/Resources/SQLGenerator.gorm: Ditto.
* DBModeler/ConsistencyChecker.h/m: Ditto.
* DBModeler/ConsistencyResults.h/m: Ditto.
* DBModeler/ConsistencyResults.gorm: Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21438 72102866-910b-0410-8b05-ffd578937521
2005-07-09 02:07:42 +00:00
|
|
|
return AUTORELEASE(cell);
|
2005-05-13 00:25:27 +00:00
|
|
|
}
|
|
|
|
else if ([name isEqual:@"Class property"])
|
|
|
|
{
|
|
|
|
NSButtonCell *cell = [[NSButtonCell alloc] initImageCell:nil];
|
|
|
|
|
|
|
|
[cell setButtonType:NSSwitchButton];
|
|
|
|
[cell setImagePosition:NSImageOnly];
|
|
|
|
[cell setBordered:NO];
|
|
|
|
[cell setBezeled:NO];
|
|
|
|
[cell setAlternateImage:[NSImage imageNamed:@"ClassProperty_On"]];
|
|
|
|
[cell setControlSize: NSSmallControlSize];
|
2006-12-29 00:09:01 +00:00
|
|
|
[cell setEditable:NO];
|
* DBModeler/AdaptorsPanel.m (-init): Add parenthesis around
assignment. Replace label with window title.
(-runAdaptorsPanel:): Remove unused variable.
* DBModeler/DefaultColumnProvider.m: Add missing braces, remove
unused ivars.
(-cellForColumnNamed:): Autorelease cells.
* DBModeler/EOAdditions.m: New EOAttribute KVC methods -allowNull and
-setAllowNull:.
* DBModeler/GNUmakefile: Add new to project.
* DBModeler/KVDataSource.m (-createObject:): Return nil after
throwing exception.
* DBModeler/MainModelEditor.m
(-dragImageForRows:event:dragImageOffset:):: Enable drag and
drop for relationships.
(-initWithDocument:): Add parenthesis around assignment. Don't
release the document window on close.
(-ecStuff:): temporarily reload everything in the outline view when
something changes.
(-viewSelectedObject:): Remove NSLog. Rewrite editor activation.
Fix leaks.
* DBModeler/Modeler.m (-applicationWillFinishLaunching:): Add new menu
items. Don't order our menu in.
(-new:,-open:): Move document initializition to _newDocumentWithModel:.
(-_newDocumentWithModel:,-newFromDatabase:): New methods.
(-validateMenuItem:,-generateSQL:): Ditto.
* DBModeler/ModelerAttributeEditor.m (-initWithParentEditor:):
Remove unused variables.
(-displayGroupDidChangeSelection:): return early if there is no
longer a selection.
* DBModeler/ModelerEntityEditor.m:
(-canSupportCurrentSelection): Remove NSLog.
(-displayGroupDidChangeSelection:): Ditto.
(-dealloc:): New method.
(-initWithParentEditor:): Remove unused variables. Add parens around
assignment. Release local variables.
* DBModeler/ModelerTableEmbedibleEditor:
(-addDefaultTableColumnsForTableView:displayGroup:): Release table
columns.
(-addTableColumnForItem:tableView:): Ditto.
* DBModeler/Inspectors/RelationshipInspector.m:
(-selectedEntity, -selectedDestinationAttribute): New methods.
(-selectedSourceAttribute, -indexOfSourceAttribute:): Ditto.
(-indexOfDestinationAttribute:,joinWithSource:destination:): Ditto.
(-selectedJoin:,updateConnectButton,): Ditto.
(-refresh): Rewrite using new methods.
(-numberOfRowsInTableView:): Add fallback return value.
(-tableView:objectValueForTableColumn:row:): Ditto.
(-tableView:selectionDidChange:): If a source or destination
attribute is now selected, select its counterpart.
(-tableView:shouldSelectRow:): New method to disallow entity
selection if there is a destination entity.
(-tableView:willDisplayCell:forTableColumn:row:): New method,
set the cell text color to disabled text color, if we would disallow
selection.
(-connectionChanged:): Implement disconnection.
* DBModeler/SQLGenerator.h/m: New files initial implementation.
* DBModeler/Resources/SQLGenerator.gorm: Ditto.
* DBModeler/ConsistencyChecker.h/m: Ditto.
* DBModeler/ConsistencyResults.h/m: Ditto.
* DBModeler/ConsistencyResults.gorm: Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21438 72102866-910b-0410-8b05-ffd578937521
2005-07-09 02:07:42 +00:00
|
|
|
return AUTORELEASE(cell);
|
2005-05-13 00:25:27 +00:00
|
|
|
}
|
|
|
|
else if ([name isEqual:@"Locking"])
|
|
|
|
{
|
|
|
|
NSButtonCell *cell = [[NSButtonCell alloc] initImageCell:nil];
|
|
|
|
|
|
|
|
[cell setButtonType:NSSwitchButton];
|
|
|
|
[cell setImagePosition:NSImageOnly];
|
|
|
|
[cell setBordered:NO];
|
|
|
|
[cell setBezeled:NO];
|
2006-09-05 22:18:35 +00:00
|
|
|
[cell setAlternateImage:[NSImage imageNamed:@"Locking_On"]];
|
2005-05-13 00:25:27 +00:00
|
|
|
[cell setControlSize: NSSmallControlSize];
|
2006-12-29 00:09:01 +00:00
|
|
|
[cell setEditable:NO];
|
* DBModeler/AdaptorsPanel.m (-init): Add parenthesis around
assignment. Replace label with window title.
(-runAdaptorsPanel:): Remove unused variable.
* DBModeler/DefaultColumnProvider.m: Add missing braces, remove
unused ivars.
(-cellForColumnNamed:): Autorelease cells.
* DBModeler/EOAdditions.m: New EOAttribute KVC methods -allowNull and
-setAllowNull:.
* DBModeler/GNUmakefile: Add new to project.
* DBModeler/KVDataSource.m (-createObject:): Return nil after
throwing exception.
* DBModeler/MainModelEditor.m
(-dragImageForRows:event:dragImageOffset:):: Enable drag and
drop for relationships.
(-initWithDocument:): Add parenthesis around assignment. Don't
release the document window on close.
(-ecStuff:): temporarily reload everything in the outline view when
something changes.
(-viewSelectedObject:): Remove NSLog. Rewrite editor activation.
Fix leaks.
* DBModeler/Modeler.m (-applicationWillFinishLaunching:): Add new menu
items. Don't order our menu in.
(-new:,-open:): Move document initializition to _newDocumentWithModel:.
(-_newDocumentWithModel:,-newFromDatabase:): New methods.
(-validateMenuItem:,-generateSQL:): Ditto.
* DBModeler/ModelerAttributeEditor.m (-initWithParentEditor:):
Remove unused variables.
(-displayGroupDidChangeSelection:): return early if there is no
longer a selection.
* DBModeler/ModelerEntityEditor.m:
(-canSupportCurrentSelection): Remove NSLog.
(-displayGroupDidChangeSelection:): Ditto.
(-dealloc:): New method.
(-initWithParentEditor:): Remove unused variables. Add parens around
assignment. Release local variables.
* DBModeler/ModelerTableEmbedibleEditor:
(-addDefaultTableColumnsForTableView:displayGroup:): Release table
columns.
(-addTableColumnForItem:tableView:): Ditto.
* DBModeler/Inspectors/RelationshipInspector.m:
(-selectedEntity, -selectedDestinationAttribute): New methods.
(-selectedSourceAttribute, -indexOfSourceAttribute:): Ditto.
(-indexOfDestinationAttribute:,joinWithSource:destination:): Ditto.
(-selectedJoin:,updateConnectButton,): Ditto.
(-refresh): Rewrite using new methods.
(-numberOfRowsInTableView:): Add fallback return value.
(-tableView:objectValueForTableColumn:row:): Ditto.
(-tableView:selectionDidChange:): If a source or destination
attribute is now selected, select its counterpart.
(-tableView:shouldSelectRow:): New method to disallow entity
selection if there is a destination entity.
(-tableView:willDisplayCell:forTableColumn:row:): New method,
set the cell text color to disabled text color, if we would disallow
selection.
(-connectionChanged:): Implement disconnection.
* DBModeler/SQLGenerator.h/m: New files initial implementation.
* DBModeler/Resources/SQLGenerator.gorm: Ditto.
* DBModeler/ConsistencyChecker.h/m: Ditto.
* DBModeler/ConsistencyResults.h/m: Ditto.
* DBModeler/ConsistencyResults.gorm: Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21438 72102866-910b-0410-8b05-ffd578937521
2005-07-09 02:07:42 +00:00
|
|
|
return AUTORELEASE(cell);
|
|
|
|
}
|
|
|
|
else if ([name isEqual:@"Allows null"])
|
|
|
|
{
|
|
|
|
NSButtonCell *cell = [[NSButtonCell alloc] initImageCell:nil];
|
|
|
|
|
|
|
|
[cell setButtonType:NSSwitchButton];
|
|
|
|
[cell setImagePosition:NSImageOnly];
|
|
|
|
[cell setBordered:NO];
|
|
|
|
[cell setBezeled:NO];
|
2006-09-16 13:02:02 +00:00
|
|
|
[cell setAlternateImage:[NSImage imageNamed:@"AllowsNull_On"]];
|
* DBModeler/AdaptorsPanel.m (-init): Add parenthesis around
assignment. Replace label with window title.
(-runAdaptorsPanel:): Remove unused variable.
* DBModeler/DefaultColumnProvider.m: Add missing braces, remove
unused ivars.
(-cellForColumnNamed:): Autorelease cells.
* DBModeler/EOAdditions.m: New EOAttribute KVC methods -allowNull and
-setAllowNull:.
* DBModeler/GNUmakefile: Add new to project.
* DBModeler/KVDataSource.m (-createObject:): Return nil after
throwing exception.
* DBModeler/MainModelEditor.m
(-dragImageForRows:event:dragImageOffset:):: Enable drag and
drop for relationships.
(-initWithDocument:): Add parenthesis around assignment. Don't
release the document window on close.
(-ecStuff:): temporarily reload everything in the outline view when
something changes.
(-viewSelectedObject:): Remove NSLog. Rewrite editor activation.
Fix leaks.
* DBModeler/Modeler.m (-applicationWillFinishLaunching:): Add new menu
items. Don't order our menu in.
(-new:,-open:): Move document initializition to _newDocumentWithModel:.
(-_newDocumentWithModel:,-newFromDatabase:): New methods.
(-validateMenuItem:,-generateSQL:): Ditto.
* DBModeler/ModelerAttributeEditor.m (-initWithParentEditor:):
Remove unused variables.
(-displayGroupDidChangeSelection:): return early if there is no
longer a selection.
* DBModeler/ModelerEntityEditor.m:
(-canSupportCurrentSelection): Remove NSLog.
(-displayGroupDidChangeSelection:): Ditto.
(-dealloc:): New method.
(-initWithParentEditor:): Remove unused variables. Add parens around
assignment. Release local variables.
* DBModeler/ModelerTableEmbedibleEditor:
(-addDefaultTableColumnsForTableView:displayGroup:): Release table
columns.
(-addTableColumnForItem:tableView:): Ditto.
* DBModeler/Inspectors/RelationshipInspector.m:
(-selectedEntity, -selectedDestinationAttribute): New methods.
(-selectedSourceAttribute, -indexOfSourceAttribute:): Ditto.
(-indexOfDestinationAttribute:,joinWithSource:destination:): Ditto.
(-selectedJoin:,updateConnectButton,): Ditto.
(-refresh): Rewrite using new methods.
(-numberOfRowsInTableView:): Add fallback return value.
(-tableView:objectValueForTableColumn:row:): Ditto.
(-tableView:selectionDidChange:): If a source or destination
attribute is now selected, select its counterpart.
(-tableView:shouldSelectRow:): New method to disallow entity
selection if there is a destination entity.
(-tableView:willDisplayCell:forTableColumn:row:): New method,
set the cell text color to disabled text color, if we would disallow
selection.
(-connectionChanged:): Implement disconnection.
* DBModeler/SQLGenerator.h/m: New files initial implementation.
* DBModeler/Resources/SQLGenerator.gorm: Ditto.
* DBModeler/ConsistencyChecker.h/m: Ditto.
* DBModeler/ConsistencyResults.h/m: Ditto.
* DBModeler/ConsistencyResults.gorm: Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21438 72102866-910b-0410-8b05-ffd578937521
2005-07-09 02:07:42 +00:00
|
|
|
[cell setControlSize: NSSmallControlSize];
|
2006-12-29 00:09:01 +00:00
|
|
|
[cell setEditable:NO];
|
* DBModeler/AdaptorsPanel.m (-init): Add parenthesis around
assignment. Replace label with window title.
(-runAdaptorsPanel:): Remove unused variable.
* DBModeler/DefaultColumnProvider.m: Add missing braces, remove
unused ivars.
(-cellForColumnNamed:): Autorelease cells.
* DBModeler/EOAdditions.m: New EOAttribute KVC methods -allowNull and
-setAllowNull:.
* DBModeler/GNUmakefile: Add new to project.
* DBModeler/KVDataSource.m (-createObject:): Return nil after
throwing exception.
* DBModeler/MainModelEditor.m
(-dragImageForRows:event:dragImageOffset:):: Enable drag and
drop for relationships.
(-initWithDocument:): Add parenthesis around assignment. Don't
release the document window on close.
(-ecStuff:): temporarily reload everything in the outline view when
something changes.
(-viewSelectedObject:): Remove NSLog. Rewrite editor activation.
Fix leaks.
* DBModeler/Modeler.m (-applicationWillFinishLaunching:): Add new menu
items. Don't order our menu in.
(-new:,-open:): Move document initializition to _newDocumentWithModel:.
(-_newDocumentWithModel:,-newFromDatabase:): New methods.
(-validateMenuItem:,-generateSQL:): Ditto.
* DBModeler/ModelerAttributeEditor.m (-initWithParentEditor:):
Remove unused variables.
(-displayGroupDidChangeSelection:): return early if there is no
longer a selection.
* DBModeler/ModelerEntityEditor.m:
(-canSupportCurrentSelection): Remove NSLog.
(-displayGroupDidChangeSelection:): Ditto.
(-dealloc:): New method.
(-initWithParentEditor:): Remove unused variables. Add parens around
assignment. Release local variables.
* DBModeler/ModelerTableEmbedibleEditor:
(-addDefaultTableColumnsForTableView:displayGroup:): Release table
columns.
(-addTableColumnForItem:tableView:): Ditto.
* DBModeler/Inspectors/RelationshipInspector.m:
(-selectedEntity, -selectedDestinationAttribute): New methods.
(-selectedSourceAttribute, -indexOfSourceAttribute:): Ditto.
(-indexOfDestinationAttribute:,joinWithSource:destination:): Ditto.
(-selectedJoin:,updateConnectButton,): Ditto.
(-refresh): Rewrite using new methods.
(-numberOfRowsInTableView:): Add fallback return value.
(-tableView:objectValueForTableColumn:row:): Ditto.
(-tableView:selectionDidChange:): If a source or destination
attribute is now selected, select its counterpart.
(-tableView:shouldSelectRow:): New method to disallow entity
selection if there is a destination entity.
(-tableView:willDisplayCell:forTableColumn:row:): New method,
set the cell text color to disabled text color, if we would disallow
selection.
(-connectionChanged:): Implement disconnection.
* DBModeler/SQLGenerator.h/m: New files initial implementation.
* DBModeler/Resources/SQLGenerator.gorm: Ditto.
* DBModeler/ConsistencyChecker.h/m: Ditto.
* DBModeler/ConsistencyResults.h/m: Ditto.
* DBModeler/ConsistencyResults.gorm: Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21438 72102866-910b-0410-8b05-ffd578937521
2005-07-09 02:07:42 +00:00
|
|
|
return AUTORELEASE(cell);
|
2005-05-13 00:25:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-29 00:09:01 +00:00
|
|
|
NSTextFieldCell *cell = [[NSTextFieldCell alloc] init];
|
2005-05-13 00:25:27 +00:00
|
|
|
[cell setEditable:YES];
|
* DBModeler/AdaptorsPanel.m (-init): Add parenthesis around
assignment. Replace label with window title.
(-runAdaptorsPanel:): Remove unused variable.
* DBModeler/DefaultColumnProvider.m: Add missing braces, remove
unused ivars.
(-cellForColumnNamed:): Autorelease cells.
* DBModeler/EOAdditions.m: New EOAttribute KVC methods -allowNull and
-setAllowNull:.
* DBModeler/GNUmakefile: Add new to project.
* DBModeler/KVDataSource.m (-createObject:): Return nil after
throwing exception.
* DBModeler/MainModelEditor.m
(-dragImageForRows:event:dragImageOffset:):: Enable drag and
drop for relationships.
(-initWithDocument:): Add parenthesis around assignment. Don't
release the document window on close.
(-ecStuff:): temporarily reload everything in the outline view when
something changes.
(-viewSelectedObject:): Remove NSLog. Rewrite editor activation.
Fix leaks.
* DBModeler/Modeler.m (-applicationWillFinishLaunching:): Add new menu
items. Don't order our menu in.
(-new:,-open:): Move document initializition to _newDocumentWithModel:.
(-_newDocumentWithModel:,-newFromDatabase:): New methods.
(-validateMenuItem:,-generateSQL:): Ditto.
* DBModeler/ModelerAttributeEditor.m (-initWithParentEditor:):
Remove unused variables.
(-displayGroupDidChangeSelection:): return early if there is no
longer a selection.
* DBModeler/ModelerEntityEditor.m:
(-canSupportCurrentSelection): Remove NSLog.
(-displayGroupDidChangeSelection:): Ditto.
(-dealloc:): New method.
(-initWithParentEditor:): Remove unused variables. Add parens around
assignment. Release local variables.
* DBModeler/ModelerTableEmbedibleEditor:
(-addDefaultTableColumnsForTableView:displayGroup:): Release table
columns.
(-addTableColumnForItem:tableView:): Ditto.
* DBModeler/Inspectors/RelationshipInspector.m:
(-selectedEntity, -selectedDestinationAttribute): New methods.
(-selectedSourceAttribute, -indexOfSourceAttribute:): Ditto.
(-indexOfDestinationAttribute:,joinWithSource:destination:): Ditto.
(-selectedJoin:,updateConnectButton,): Ditto.
(-refresh): Rewrite using new methods.
(-numberOfRowsInTableView:): Add fallback return value.
(-tableView:objectValueForTableColumn:row:): Ditto.
(-tableView:selectionDidChange:): If a source or destination
attribute is now selected, select its counterpart.
(-tableView:shouldSelectRow:): New method to disallow entity
selection if there is a destination entity.
(-tableView:willDisplayCell:forTableColumn:row:): New method,
set the cell text color to disabled text color, if we would disallow
selection.
(-connectionChanged:): Implement disconnection.
* DBModeler/SQLGenerator.h/m: New files initial implementation.
* DBModeler/Resources/SQLGenerator.gorm: Ditto.
* DBModeler/ConsistencyChecker.h/m: Ditto.
* DBModeler/ConsistencyResults.h/m: Ditto.
* DBModeler/ConsistencyResults.gorm: Ditto.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21438 72102866-910b-0410-8b05-ffd578937521
2005-07-09 02:07:42 +00:00
|
|
|
return AUTORELEASE(cell);
|
2005-05-13 00:25:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)initColumn:(NSTableColumn *)tc
|
|
|
|
class:(Class)class
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
name:(NSString *)columnName
|
2005-05-13 00:25:27 +00:00
|
|
|
displayGroup:(EODisplayGroup *)displayGroup
|
|
|
|
document:(EOModelerDocument *)doc
|
|
|
|
{
|
|
|
|
EOColumnAssociation *association;
|
Replaced tabs with spaces throughout the DBModeler sub-project.
* DBModeler/AdaptorsPanel.m, DBModeler/AttributeCell.m,
DBModeler/ConsistencyChecker.m, DBModeler/DefaultColumnProvider.m,
DBModeler/DiagramView.m, DBModeler/EOAdditions.m, DBModeler/EntityView.m,
DBModeler/GNUmakefile, DBModeler/KVDataSource.m,
DBModeler/MainModelEditor.h, DBModeler/MainModelEditor.m,
DBModeler/ModelerAttributeEditor.m, DBModeler/ModelerEntityEditor.h,
DBModeler/ModelerEntityEditor.m,
DBModeler/ModelerTableEmbedibleEditor.h,
DBModeler/ModelerTableEmbedibleEditor.m,
DBModeler/NSView+Additions.m, DBModeler/Preferences.m,
DBModeler/SQLGenerator.m, DBModeler/Inspectors/AdvancedEntityInspector.m,
DBModeler/Inspectors/AttributeInspector.h,
DBModeler/Inspectors/AttributeInspector.m,
DBModeler/Inspectors/RelationshipInspector.h,
DBModeler/Inspectors/RelationshipInspector.m
White-space clean-up. Replaced tabs with spaces.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@26556 72102866-910b-0410-8b05-ffd578937521
2008-05-23 12:11:26 +00:00
|
|
|
NSCell *cell;
|
|
|
|
NSString *aspectKey;
|
|
|
|
NSString *aspect;
|
2005-05-13 00:25:27 +00:00
|
|
|
|
|
|
|
aspectKey = [[_aspectsAndKeys objectForKey:class] objectForKey:columnName];
|
|
|
|
aspect = @"value";
|
|
|
|
association = [[EOColumnAssociation alloc] initWithObject:tc];
|
|
|
|
cell = [self cellForColumnNamed:columnName];
|
2006-12-29 00:09:01 +00:00
|
|
|
[tc setEditable: [cell isEditable]];
|
2005-05-13 00:25:27 +00:00
|
|
|
[tc setDataCell:cell];
|
2006-09-05 22:18:35 +00:00
|
|
|
[self setupTitleForColumn:tc named:columnName];
|
2005-05-13 00:25:27 +00:00
|
|
|
[association bindAspect:aspect displayGroup:displayGroup key:aspectKey];
|
|
|
|
[association establishConnection];
|
|
|
|
[association release];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|