mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-21 02:20:55 +00:00
* DBModeler/Modeler.m: use sel_isEqual to check menu
* DBModeler/Resources/SQLGenerator.gsmarkup: make window resizeable * DBModeler/CodeGenerator.m: add credits for initialCapitalString and initialLowercaseString use ASSIGN() in generated code. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@30260 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2f65a25e2f
commit
51b728a2b8
5 changed files with 46 additions and 11 deletions
|
@ -6,6 +6,11 @@
|
||||||
added - (NSString *)cScalarTypeString
|
added - (NSString *)cScalarTypeString
|
||||||
* DBModeler/CodeGenerator.h/m: new file
|
* DBModeler/CodeGenerator.h/m: new file
|
||||||
Added a Code Generator like EOGenerator from www.rubicode.com
|
Added a Code Generator like EOGenerator from www.rubicode.com
|
||||||
|
* DBModeler/Modeler.m: use sel_isEqual to check menu
|
||||||
|
* DBModeler/Resources/SQLGenerator.gsmarkup: make window resizeable
|
||||||
|
* DBModeler/CodeGenerator.m: add credits for initialCapitalString and
|
||||||
|
initialLowercaseString
|
||||||
|
use ASSIGN() in generated code.
|
||||||
|
|
||||||
2010-04-26 David Wetzel <dave@turbocat.de>
|
2010-04-26 David Wetzel <dave@turbocat.de>
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,38 @@
|
||||||
|
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@implementation NSString (GeneratorAddtions)
|
@implementation NSString (GeneratorAddtions)
|
||||||
|
|
||||||
|
// those 2 methods are from EOGenerator
|
||||||
|
|
||||||
|
/*-
|
||||||
|
* Copyright (c) 2002-2006 Carl Lindberg and Mike Gentry
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
- (NSString *)initialCapitalString
|
- (NSString *)initialCapitalString
|
||||||
{
|
{
|
||||||
NSRange firstLetterRange;
|
NSRange firstLetterRange;
|
||||||
|
@ -463,7 +493,7 @@ void addToUsedClasses(NSMutableArray * mutArray,NSSet * knownNames, NSArray * ot
|
||||||
[[eoAttr name] initialCapitalString],
|
[[eoAttr name] initialCapitalString],
|
||||||
[eoAttr valueClassName], lowStr];
|
[eoAttr valueClassName], lowStr];
|
||||||
|
|
||||||
[cs appendFormat:@" [self willChange];\n [_%@ release];\n _%@ = [aValue retain];\n}\n\n",
|
[cs appendFormat:@" [self willChange];\n ASSIGN(_%@, aValue);\n}\n\n",
|
||||||
lowStr, lowStr];
|
lowStr, lowStr];
|
||||||
[cs appendFormat:@"- (%@ *) %@\n{\n return _%@;\n}\n\n", [eoAttr valueClassName], [eoAttr name], lowStr];
|
[cs appendFormat:@"- (%@ *) %@\n{\n return _%@;\n}\n\n", [eoAttr valueClassName], [eoAttr name], lowStr];
|
||||||
}
|
}
|
||||||
|
@ -482,7 +512,7 @@ void addToUsedClasses(NSMutableArray * mutArray,NSSet * knownNames, NSArray * ot
|
||||||
[[eoRel name] initialCapitalString],
|
[[eoRel name] initialCapitalString],
|
||||||
[[eoRel destinationEntity] className], lowStr];
|
[[eoRel destinationEntity] className], lowStr];
|
||||||
|
|
||||||
[cs appendFormat:@" [self willChange];\n [_%@ release];\n _%@ = [aValue retain];\n}\n\n",
|
[cs appendFormat:@" [self willChange];\n ASSIGN(_%@, aValue);\n}\n\n",
|
||||||
lowStr, lowStr];
|
lowStr, lowStr];
|
||||||
[cs appendFormat:@"- (%@ *)%@\n{\n return _%@;\n}\n\n", [[eoRel destinationEntity] className], [eoRel name], lowStr];
|
[cs appendFormat:@"- (%@ *)%@\n{\n return _%@;\n}\n\n", [[eoRel destinationEntity] className], [eoRel name], lowStr];
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,9 +235,7 @@
|
||||||
|
|
||||||
- (BOOL) validateMenuItem:(NSMenuItem *)menuItem
|
- (BOOL) validateMenuItem:(NSMenuItem *)menuItem
|
||||||
{
|
{
|
||||||
|
if (sel_isEqual([menuItem action], @selector(createTemplate:))) {
|
||||||
if (([menuItem action] == @selector(createTemplate:))) {
|
|
||||||
NSLog(@"validateMenuItem: OK");
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
<gsmarkup>
|
<gsmarkup>
|
||||||
<objects>
|
<objects>
|
||||||
|
|
||||||
<window title="SQL Generation" id="sqlgenWindow" resizable="no">
|
<window title="SQL Generation" id="sqlgenWindow" resizable="yes">
|
||||||
<vbox leftPadding="10" padding="10">
|
<vbox leftPadding="10" padding="10">
|
||||||
<box title="SQL Generation Options" topPadding="10"
|
<box title="SQL Generation Options" topPadding="10"
|
||||||
leftPadding="15" rightPadding="15" width="425">
|
leftPadding="15" rightPadding="15" width="425">
|
||||||
<hbox halign="wexpand">
|
<hbox halign="wexpand" valign="top">
|
||||||
<vbox halign="left" valign="wexpand">
|
<vbox halign="left" valign="top" rightPadding="15">
|
||||||
<button id="dropDatabase" title="Drop Database"
|
<button id="dropDatabase" title="Drop Database"
|
||||||
type="switch" halign="left" valign="top"
|
type="switch" halign="left" valign="top"
|
||||||
action="switchChanged:" target="#NSOwner"
|
action="switchChanged:" target="#NSOwner"
|
||||||
|
@ -17,14 +17,12 @@
|
||||||
type="switch" halign="left" valign="top"
|
type="switch" halign="left" valign="top"
|
||||||
action="switchChanged:" target="#NSOwner"
|
action="switchChanged:" target="#NSOwner"
|
||||||
padding="1.5" />
|
padding="1.5" />
|
||||||
<vspace />
|
|
||||||
<button id="dropPKSupport"
|
<button id="dropPKSupport"
|
||||||
title="Drop Primary Key Support" type="switch"
|
title="Drop Primary Key Support" type="switch"
|
||||||
halign="left" valign="bottom"
|
halign="left" valign="top"
|
||||||
action="switchChanged:" target="#NSOwner"
|
action="switchChanged:" target="#NSOwner"
|
||||||
padding="1.5" />
|
padding="1.5" />
|
||||||
</vbox>
|
</vbox>
|
||||||
<hspace />
|
|
||||||
<vbox halign="right" valign="top">
|
<vbox halign="right" valign="top">
|
||||||
<button id="createDB" title="Create Database"
|
<button id="createDB" title="Create Database"
|
||||||
type="switch" halign="left" valign="top"
|
type="switch" halign="left" valign="top"
|
||||||
|
|
|
@ -248,6 +248,10 @@
|
||||||
NSString * vType = [self valueType];
|
NSString * vType = [self valueType];
|
||||||
unichar myChar;
|
unichar myChar;
|
||||||
|
|
||||||
|
if ([vType length] < 1) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
myChar = [vType characterAtIndex:0];
|
myChar = [vType characterAtIndex:0];
|
||||||
|
|
||||||
switch (myChar) {
|
switch (myChar) {
|
||||||
|
|
Loading…
Reference in a new issue