|
Class: CodeGeneratorTool
Object
|
+--CodeGeneratorTool
|
+--JavaScriptCodeGeneratorTool
|
+--SmalltalkCodeGeneratorTool
- Package:
- stx:libtool
- Category:
- Interface-Browsers
- Version:
- rev:
1.128
date: 2018/09/13 12:35:32
- user: cg
- file: CodeGeneratorTool.st directory: libtool
- module: stx stc-classLibrary: libtool
- Author:
- Claus Gittiner
This utility class contains various code generation facilites;
these were extracted from the old and newBrowser.
There is probably more to come...
Note: being refactored into separate per-language generators
code generation
-
createAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange asValueHolder: asValueHolder readersOnly: readersOnly writersOnly: writersOnly
-
create accessors in aClass
-
createApplicationCodeFor: aClass
-
create an empty application framework
-
createClassResponsibleProtocolFor: aClass
-
create stubs for the required protocol
-
createClassTypeTestMethodsIn: aClass forClasses: subClasses
-
create a #isXXX test methods (I'm tired of typing)
-
createDocumentationMethodsFor: aClass
-
create empty documentation methods
-
createEnumTypeCodeFor: aClass
-
-
createInitializationMethodIn: aClass
-
create a #initialize methods (I'm tired of typing)
-
createInitializedInstanceCreationMethodsIn: aClass
-
create a #new and #initialize methods (I'm tired of typing)
-
createIsAbstractMethodIn: aClass
-
create a #isABstract query method (I'm tired of typing)
-
createIsObsoleteMethodIn: aClass
-
create a #isABstract query method (I'm tired of typing)
-
createParametrizedInstanceCreationMethodsNamed: selector in: aClass
-
create a #selector instance creation method (I'm tired of typing)
-
createRedefinedInstanceCreationMethodsIn: aClass
-
create a redefined #new method
-
createSingletonPatternInstanceCreationMethodsIn: aClass usingVariable: varName
-
create redefined #new method for singleton pattern
-
createStandaloneStartupCodeFor: aClass
-
create an empty console application framework
-
createStartupCodeFor: aClass forStartOf: anApplicationClassOrNil
-
create standAloneStartup code
-
createTestCaseSampleCodeFor: aClass
-
create an (almost) empty testCase class
-
createVisitorMethodsIn: visitedClass andVisitorClass: visitorClass
-
create acceptVisitor: in visitedClass and acceptXXX in visitorClass. (I'm tired of typing)
-
createWebApplicationCodeFor: aClass
-
create an empty webApplication framework
-
createWebServiceCodeFor: aClass
-
create an empty webService framework
-
createWidgetCodeFor: aClass
-
create usually required widget code (redraw, model update, event handling)
-
initialMenuSpecMethodSourceForApplications
-
return code for a menuSpec with typical stuff in it
** This method raises an error - it must be redefined in concrete classes **
-
initialPageMenuSpecMethodSourceForWebApplications
-
return code for a menuSpec with typical stuff in it
** This method raises an error - it must be redefined in concrete classes **
-
initialPageSpecMethodSourceForWebApplications
-
return an empty pageSpec
** This method raises an error - it must be redefined in concrete classes **
-
initialToolbarMenuSpecMethodSource
-
return a menuSpec with typical stuff in it
** This method raises an error - it must be redefined in concrete classes **
-
initialWindowSpecMethodSourceForApplications
-
return an empty windowSpec with an initial menubar in it
** This method raises an error - it must be redefined in concrete classes **
-
initialWindowSpecMethodSourceForDialogs
-
return an empty windowSpec for dialogs
** This method raises an error - it must be redefined in concrete classes **
code generation-basic
-
createAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange asValueHolder: asValueHolder readersOnly: readersOnly writersOnly: writersOnly lazyInitialization: lazyInitialization
-
workhorse for creating access methods for instvars.
code generation-individual methods
-
createAcceptVisitorMethod: selector in: aClass
-
create an acceptVisitor: method
(I'm tired of typing)
-
createAcceptVisitorMethodIn: aClass
-
create an acceptVisitor: method
(I'm tired of typing)
-
createAspectMethodFor: anAspectSymbol in: aClass
-
create an aspect method.
-
createCopyrightMethodFor: aClass
-
add copyright method containing your/your companies
copyright template but only if not already present.
this is only added, if specified in the
COPYRIGHT_TEMPLATE_FILE resources.
-
createDocumentationMethodFor: aClass
-
add documentation method containing doc template
but only if not already present.
-
createExamplesMethodFor: aClass
-
add examples method containing examples template
but only if not already present.
-
createFalseReturnMethodFor: aSelector category: cat in: aClass
-
add a ^ false method;
but only if not already present.
-
createImageSpecMethodFor: anImage comment: comment in: aClass selector: sel
-
-
createInitialHistoryMethodFor: aClass
-
add history method containing created-entry
but only if not already present.
-
createInstanceCreationMethodWithSetupFor: selector category: category in: aMetaClass
-
add an inst-creation method
-
createMultiSetterInstanceCreationMethodFor: aCollectionOfVarNames in: aClass
-
create a multi-setter instance creator method for instvars.
This creates a multi setter method (a:val1 b:val2 c:val3...)
and a corresponding new method on the class side.
-
createMultiSetterMethodFor: aCollectionOfVarNames in: aClass
-
create a multi-setter method (a:val1 b:val2 c:val3...) for instvars.
-
createSubclassResponsibilityMethodFor: aSelector category: cat in: aClass
-
add a subclassResponsibility method;
but only if not already present.
-
createUpdateMethodIn: aClass
-
create an update:with:from:-method
(I'm tired of typing)
-
createVersionMethodFor: aClass
-
add a version method containing RCS template
but only if not already present and it's not a private class.
code generation-menus
-
createActionMethodFor: aSelector in: aClass category: aCategory redefine: redefine
-
-
createAspectMethodFor: aSelector in: aClass category: aCategory redefine: redefine
-
compilation
-
compile: theCode forClass: aClass inCategory: cat
-
install some code for a class.
If refactory browser stuff is available the refactory tools are used to support undo
defaults
-
copyrightTemplate
-
return the contents of COPYRIGHT_TEMPLATE_FILE resources
or a standard template
-
copyrightTemplate: aString
-
set the COPYRIGHT_TEMPLATE_FILE
instance creation
-
new
-
interface specs
-
initialMenuSpecForApplications
-
return a menuSpec with typical stuff in it
usage example(s):
MenuEditor new openOnClass:self andSelector:#initialMenuSpecForApplications
|
-
initialPageMenuSpecForWebApplications
-
return a menuSpec with typical stuff in it
usage example(s):
MenuEditor new openOnClass:self andSelector:#initialPageMenuSpecForWebApplications
|
-
initialPageSpecForWebApplications
-
Do not manually edit this! If it is corrupted,
the UIPainter may not be able to read the specification.
usage example(s):
UIPainter new openOnClass:self andSelector:#initialPageSpecForWebApplications
|
-
initialToolbarMenuSpec
-
This resource specification was automatically generated
by the MenuEditor of ST/X.
usage example(s):
MenuEditor new openOnClass:CodeGeneratorTool andSelector:#initialToolbarMenuSpec
(Menu new fromLiteralArrayEncoding:(CodeGeneratorTool initialToolbarMenuSpec)) startUp
|
-
initialWindowSpecForApplications
-
This resource specification was automatically generated
by the UIPainter of ST/X.
usage example(s):
UIPainter new openOnClass:CodeGeneratorTool andSelector:#initialWindowSpecForApplications
|
-
initialWindowSpecForApplications2
-
This resource specification was automatically generated
by the UIPainter of ST/X.
usage example(s):
UIPainter new openOnClass:CodeGeneratorTool andSelector:#initialWindowSpecForApplications2
|
-
initialWindowSpecForDialogs
-
This resource specification was automatically generated
by the UIPainter of ST/X.
usage example(s):
UIPainter new openOnClass:CodeGeneratorTool andSelector:#initialWindowSpecForDialogs
|
private
-
canUseRefactoringSupport
-
check if refactory browser stuff is available
-
methodNameTemplateFor: aSelector
-
queries
-
isAbstract
-
utilities
-
missingRequiredProtocolFor: aClass
-
return the missing required protocol;
that is the set of selectors which send #subclassResponsibility in a superclass and
have no implementation in aClass or in any class between aClass and that superclass
utilities - source code
-
methodTemplate
-
return a method definition template string
-
methodTemplateForDocumentation
-
return a method definition template string for a documentation method
-
methodTemplateForPackageDocumentation
-
return a documentation method definition template string for a package
-
methodTemplateForVersionMethodCVS
-
careful to avoid expansion by cvs here!
bulk changes
-
addChange: aChange
-
-
executeCollectedChangesNamed: name
-
if both the compositeChangeCollector and I myself think, that it should be confirmed,
the let user do it - I am not sure, if the heuristics here is useful;
it might be better to let the generator decide (for example, if it does high-impact
changes, as opposed to simple ones)
-
startCollectChanges
-
code generation
-
createAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange asValueHolder: asValueHolder readersOnly: readersOnly writersOnly: writersOnly
-
create accessors in aClass
-
createApplicationCodeFor: aClass
-
create an empty application framework
-
createClassInitializeMethodIn: aClass
-
create a #initialize method on the class side (I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createClassResponsibleProtocolFor: aClass
-
create stubs for the required protocol
-
createClassTypeTestMethodsIn: aClass forClasses: subClasses
-
create a #isXXX test methods (I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createDocumentationMethodsFor: aClass
-
create empty documentation methods
-
createEnumTypeCodeFor: aClass
-
-
createExamplesMethodForViewClass: aClass
-
create an examples method
** This method raises an error - it must be redefined in concrete classes **
-
createInitializationMethodIn: aClass
-
create a #initialize methods (I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createInitializedInstanceCreationMethodsIn: aClass
-
create a #new and #initialize methods (I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createIsAbstractMethodIn: aClass
-
create a #isAbstract query method (I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createIsObsoleteMethodIn: aClass
-
create a #isObsolete query method (I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createParametrizedInstanceCreationMethodsNamed: selector in: aClass
-
create a #selector instance creation method (I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createPoolInitializationCodeFor: aClass
-
-
createRedefinedInstanceCreationMethodsIn: aClass
-
create a redefined #new methods
** This method raises an error - it must be redefined in concrete classes **
-
createSingletonPatternInstanceCreationMethodsIn: aClass usingVariable: varName
-
create redefined #new methods for a singleton pattern
** This method raises an error - it must be redefined in concrete classes **
-
createStandaloneStartupCodeFor: aClass
-
create an empty console application framework
-
createStandardPrintOnMethodIn: aClass
-
create a #printOn: method (I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createStartupCodeFor: aClass forStartOf: anApplicationClassOrNil
-
create startup code (main)
** This method raises an error - it must be redefined in concrete classes **
-
createTestCaseSampleCodeFor: aClass
-
create an (almost) empty testCase class
** This method raises an error - it must be redefined in concrete classes **
-
createVisitorMethodsIn: visitedClass andCompilerClass: visitorClass
-
This is much like createVisitorMethodsIn:andVisitorClass:,
but generates
acceptVisitor:forEffect:
and
visit<NODE>:forEffect:
in visit* methods.
-
createVisitorMethodsIn: visitedClass andVisitorClass2: visitorClass
-
This is much like createVisitorMethodsIn:andVisitorClass:,
but generates
self visitSuperclass: anObject
in visit* methods.
-
createVisitorMethodsIn: visitedClass andVisitorClass: visitorClass
-
create acceptVisitor: in visitedClass and acceptXXX in visitorClass. (I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createVisitorMethodsIn: arg1 andVisitorClass: arg2 withParameter: arg3 withSuper: arg4
-
raise an error: must be redefined in concrete subclass(es)
** This method raises an error - it must be redefined in concrete classes **
-
createWebApplicationCodeFor: aClass
-
create an empty webApplication framework
** This method raises an error - it must be redefined in concrete classes **
-
createWebServiceCodeFor: aClass
-
create an empty webService framework
** This method raises an error - it must be redefined in concrete classes **
-
createWidgetCodeFor: aClass
-
create usually required widget code (redraw, model update, event handling)
** This method raises an error - it must be redefined in concrete classes **
code generation-basic
-
createAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange asValueHolder: asValueHolder readersOnly: readersOnly writersOnly: writersOnly lazyInitialization: lazyInitialization
-
workhorse for creating access methods for instvars.
** This method raises an error - it must be redefined in concrete classes **
-
createCollectionAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange
-
-
createGetterFor: aVarName in: aClass
-
-
createSetterFor: aVarName in: aClass
-
-
createValueHoldersFor: aCollectionOfVarNames in: aClass lazyInitialization: lazyInitialization
-
workhorse for creating access methods for instvars.
** This method raises an error - it must be redefined in concrete classes **
code generation-individual methods
-
createAcceptVisitorMethod: selector in: aClass
-
create an acceptVisitor: method
(I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createAcceptVisitorMethodIn: aClass
-
create an acceptVisitor: method
(I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createAspectMethodFor: anAspectSymbol in: aClass
-
create an aspect method.
** This method raises an error - it must be redefined in concrete classes **
-
createCopyrightMethodFor: aClass
-
add copyright method containing your/your companies
copyright template but only if not already present.
this is only added, if specified in the
COPYRIGHT_TEMPLATE_FILE resources.
-
createCopyrightMethodFor: copyRightText for: aClass
-
add copyright method containing text,
but only if not already present.
** This method raises an error - it must be redefined in concrete classes **
-
createDocumentationMethodFor: aClass
-
add documentation method containing doc template
but only if not already present.
** This method raises an error - it must be redefined in concrete classes **
-
createExamplesMethodFor: aClass
-
add examples method containing examples template
but only if not already present.
** This method raises an error - it must be redefined in concrete classes **
-
createFalseReturnMethodFor: aSelector category: cat in: aClass
-
add a ^false method;
but only if not already present.
** This method raises an error - it must be redefined in concrete classes **
-
createImageSpecMethodFor: anImage comment: comment in: aClass selector: sel
-
-
createInitialHistoryMethodFor: aClass
-
add history method containing created-entry
but only if not already present.
** This method raises an error - it must be redefined in concrete classes **
-
createInstanceCreationMethodWithSetupFor: selector category: category in: aMetaClass
-
add an inst-creation method
** This method raises an error - it must be redefined in concrete classes **
-
createMultiSetterInstanceCreationMethodFor: aCollectionOfVarNames in: aClass
-
create a multi-setter instance creator method for instvars.
This creates a multi setter method (a:val1 b:val2 c:val3...)
and a corresponding new method on the class side.
** This method raises an error - it must be redefined in concrete classes **
-
createMultiSetterMethodFor: aCollectionOfVarNames in: aClass
-
create a multi-setter method (a:val1 b:val2 c:val3...) for instvars.
** This method raises an error - it must be redefined in concrete classes **
-
createShouldImplementMethodFor: aSelector category: cat in: aClass
-
add a shouldImplement method;
but only if not already present.
** This method raises an error - it must be redefined in concrete classes **
-
createSubclassResponsibilityMethodFor: aSelector category: cat in: aClass
-
add a subclassResponsibility method;
but only if not already present.
** This method raises an error - it must be redefined in concrete classes **
-
createUpdateMethodIn: aClass
-
create an update:with:from:-method
(I'm tired of typing)
** This method raises an error - it must be redefined in concrete classes **
-
createVersionMethodFor: aClass
-
add version method containing RCS template
but only if not already present and its not a private class.
** This method raises an error - it must be redefined in concrete classes **
** This is an obsolete interface - do not use it (it may vanish in future versions) **
code templates
-
codeFor_classInitialize
-
-
codeFor_closeAccept
-
-
codeFor_closeDownViews
-
-
codeFor_closeRequest
-
** This method raises an error - it must be redefined in concrete classes **
-
codeFor_doSaveAs
-
-
codeFor_emptyMenuActionCodeFor: selector menuItem: item
-
-
codeFor_hasUnsavedChanges
-
** This method raises an error - it must be redefined in concrete classes **
-
codeFor_menuNew
-
-
codeFor_menuOpen
-
-
codeFor_menuReload
-
-
codeFor_menuSave
-
-
codeFor_menuSaveAs
-
-
codeFor_openAboutThisApplication
-
-
codeFor_openDocumentation
-
-
codeFor_postBuildWith
-
-
codeFor_postOpenWith
-
-
codeFor_shouldImplementFor: selector inClass: aClass
-
used in the 'generate required protocol' to generate a shouldImplement-sending
method for each subclassClassresponsibility method above aClass.
** This method raises an error - it must be redefined in concrete classes **
-
codeFor_standAloneApplicationRegistryPath
-
-
codeFor_standAloneApplicationRegistryPathFor: aClass
-
** This method raises an error - it must be redefined in concrete classes **
-
codeFor_standAloneApplicationUUID
-
** This method raises an error - it must be redefined in concrete classes **
-
codeFor_standAloneMain
-
** This method raises an error - it must be redefined in concrete classes **
-
codeFor_standAloneRealMainMethodFor: aClass
-
** This method raises an error - it must be redefined in concrete classes **
-
codeFor_standAloneUsage
-
** This method raises an error - it must be redefined in concrete classes **
-
code_forWidget_buttonPress
-
-
code_forWidget_initialize
-
-
code_forWidget_keyPress
-
-
code_forWidget_redraw
-
-
code_forWidget_sizeChanged
-
-
code_forWidget_update
-
compilation
-
compile: theCode forClass: aClass inCategory: cat
-
install some code for a class.
If refactory browser stuff is available the refactory tools are used to support undo
-
compile: theCode forClass: aClass inCategory: categoryOrNil skipIfSame: skipIfSame
-
install some code for a class.
If refactory browser stuff is available the refactory tools are used to support undo
-
compilerClass
-
Return a real compiler classto use to compile code
** This method raises an error - it must be redefined in concrete classes **
initialization
-
confirmChanges
-
if true, let user confirm complicated changes; if false, just do it
-
confirmChanges: aBoolean
-
if true, let user confirm complicated changes; if false, just do it
-
initialize
-
private
-
canUseRefactoringSupport
-
check if refactory browser stuff is available
-
privCreateClassResponsibleProtocolFor: aClass
-
create stubs for the required protocol.
aClass may be a a MetaClass or a non-MetaClass
|