eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SmalltalkCodeGeneratorTool':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: SmalltalkCodeGeneratorTool


Inheritance:

   Object
   |
   +--CodeGeneratorTool
      |
      +--SmalltalkCodeGeneratorTool

Package:
stx:libtool
Category:
Interface-Browsers
Version:
rev: 1.70 date: 2019/06/07 14:09:22
user: stefan
file: SmalltalkCodeGeneratorTool.st directory: libtool
module: stx stc-classLibrary: libtool
Author:
Claus Gittiner

Description:


This utility class contains various code generation facilites;
these were extracted from the old and newBrowser.
There is probably more to come...


Class protocol:

code generation
o  initialMenuSpecMethodSourceForApplications
return code for a menuSpec with typical stuff in it

o  initialPageMenuSpecMethodSourceForWebApplications
return code for a menuSpec with typical stuff in it

usage example(s):

     self initialPageMenuSpecMethodSourceForWebApplications

o  initialPageSpecMethodSourceForWebApplications
return an empty pageSpec

o  initialToolbarMenuSpecMethodSource
return a menuSpec with typical stuff in it

usage example(s):

     self initialToolbarMenuSpecMethodSource

o  initialWindowSpecMethodSourceForApplications
return an empty windowSpec with an initial menubar in it

usage example(s):

     self initialWindowSpecMethodSourceForApplications

o  initialWindowSpecMethodSourceForDialogs
return an empty windowSpec for dialogs

code generation-menus
o  createActionMethodFor: aSelector in: aClass category: aCategory redefine: redefine

o  createAspectMethodFor: aSelector in: aClass category: aCategory redefine: redefine

compilation
o  compile: theCode forClass: aClass inCategory: cat
install some code for a class.
Return the new method or nil.
If refactory browser stuff is available, the refactory tools are used to support undo

o  compile: theCode forClass: aClass inCategory: cat notifying: requestor
install some code for a class.
Return the new method or nil.
If refactory browser stuff is available, the refactory tools are used to support undo

private
o  methodNameTemplateFor: aSelector

utilities - source code
o  methodSourceForVersionMethodCVS: versionString
careful to avoid expansion by cvs here!

o  methodTemplate
return a method definition template string

o  methodTemplateForDocumentation
return a documentation method definition template string

o  methodTemplateForPackageDocumentation
return a documentation-method definition template string for packages


Instance protocol:

code generation
o  createClassInitializeMethodIn: aClass
create a #initialize method on the class side (I'm tired of typing)

o  createClassTypeTestMethodsIn: aClass forClasses: subClasses
create a #isXXX test methods (I'm tired of typing)

o  createEnumTypeCodeFor: aClass

o  createExamplesMethodForApplicationModelClass: aClass
create an examples method

o  createExamplesMethodForViewClass: aClass
create an examples method

o  createInitializationMethodIn: aClass
create a #initialize methods (I'm tired of typing)

o  createInitializedInstanceCreationMethodsIn: aClass
create a #new and #initialize methods (I'm tired of typing)

o  createIsAbstractMethodIn: aClass
create a #isAbstract query method (I'm tired of typing)

o  createIsObsoleteMethodIn: aClass
create a #isObsolete query method (I'm tired of typing)

o  createParametrizedInstanceCreationMethodsNamed: selector in: aClass
create a #selector instance creation method (I'm tired of typing)

o  createPoolInitializationCodeFor: aClass

o  createRedefinedInstanceCreationMethodsIn: aClass
create a redefined #new methods

o  createSingletonPatternInstanceCreationMethodsIn: aClass usingVariable: varName
create redefined #new methods for singleton pattern.
Uses varName (typically a class-instvar) to keep the singleton instance.

o  createStandardPrintOnMethodIn: aClass
create a #printOn: method (I'm tired of typing)

o  createStartupCodeFor: aClass forStartOf: anApplicationClassOrNil
create startup code (main)

o  createTestCaseSampleCodeFor: aClass
create an (almost) empty testCase class

o  createVisitorMethodsIn: visitedClass andVisitorClass: visitorClass
create acceptVisitor: in visitedClass and acceptXXX in visitorClass. (I'm tired of typing)

o  createVisitorMethodsIn: visitedClass andVisitorClass: visitorClass withParameter: withParameter withSuper: withSuper

This is much like createVisitorMethodsIn:andVisitorClass:,
but:
- if withParameter is true, generates
#acceptVisitor:with:
and
#visit<CLASNAME>:with:
- if withSuper is true, generates
self visit<SUPERCLASSNAME>:[with:] in the visitXXX methods body

o  createWebApplicationCodeFor: aClass
create an empty webApplication framework

o  createWebServiceCodeFor: aClass
create an empty webService framework

o  createWidgetCodeFor: aClass
create usually required widget code (redraw, model update, event handling)

code generation-basic
o  createAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange asValueHolder: asValueHolder readersOnly: readersOnly writersOnly: writersOnly lazyInitialization: lazyInitialization
workhorse for creating access methods for instvars.

o  createCollectionAccessMethodsFor: aCollectionOfVarNames in: aClass withChange: withChange
check, if method is not already present

o  createValueHoldersFor: aCollectionOfVarNames in: aClass lazyInitialization: lazyInitialization
workhorse for creating access methods for instvars.

code generation-individual methods
o  createAcceptVisitorMethod: selector in: aClass
(comment from inherited method)
create an acceptVisitor: method
(I'm tired of typing)

o  createAcceptVisitorMethod: selector in: aClass withParameter: withParameter
create an acceptVisitor: method
(I'm tired of typing)

o  createAcceptVisitorMethodIn: aClass
create an acceptVisitor: method
(I'm tired of typing)

o  createAspectMethodFor: anAspectSymbol in: aClass
create an aspect method.

o  createCopyrightMethodFor: copyRightText for: aClass
add copyright method containing text,
but only if not already present.

o  createDocumentationMethodFor: aClass
add documentation method containing doc template
but only if not already present.

o  createExamplesMethodFor: aClass
add examples method containing examples template
but only if not already present.

o  createFalseReturnMethodFor: aSelector category: cat in: aClass
add a ^ false method;
but only if not already present.

o  createImageSpecMethodFor: anImage comment: comment in: aClass selector: sel
if that method already exists, do not overwrite the category

o  createInitialHistoryMethodFor: aClass
add history method containing created-entry
but only if not already present.

o  createInstanceCreationMethodWithSetupFor: selector category: category in: aMetaClass
add an inst-creation method

o  createMultiSetterInstanceCreationMethodFor: aCollectionOfVarNames in: aClass
create a multi-setter instance creator method for instvars.

o  createMultiSetterMethodFor: aCollectionOfVarNames in: aClass
create a multi-setter method for instvars.

o  createShouldImplementMethodFor: aSelector category: cat in: aClass
add a subclassResponsibility method;
but only if not already present.

o  createSubclassResponsibilityMethodFor: aSelector category: cat in: aClass
add a subclassResponsibility method;
but only if not already present.

o  createUpdateMethodIn: aClass
create an update:with:from:-method
(I'm tired of typing)

o  createVersionMethodFor: aClass
add a version method containing RCS template
but only if not already present and it's not a private class.

** This is an obsolete interface - do not use it (it may vanish in future versions) **

code templates
o  anyApplicationClassInProjectOf: aClass

o  codeFor_classInitialize

o  codeFor_closeAccept

o  codeFor_closeDownViews

o  codeFor_closeRequest

o  codeFor_emptyMenuActionCodeFor: selector menuItem: item

o  codeFor_hasUnsavedChanges

o  codeFor_menuSaveAs

o  codeFor_openAboutThisApplication

o  codeFor_openDocumentation

o  codeFor_postBuildWith

o  codeFor_postOpenWith

o  codeFor_standAloneApplicationRegistryPathFor: aClassOrNil

o  codeFor_standAloneApplicationUUID

o  codeFor_standAloneMain

o  codeFor_standAloneMainOnClassSide

o  codeFor_standAloneRealMainMethodFor: aClass

o  codeFor_standAloneUsage

o  code_forWidget_buttonPress

o  code_forWidget_initialize

o  code_forWidget_keyPress

o  code_forWidget_redraw

o  code_forWidget_sizeChanged

o  code_forWidget_update

compilation
o  compilerClass
Return a real compiler classto use to compile code

private
o  codeFor_shouldImplementFor: selector inClass: aClass
used in the 'generate required protocol' to generate a shouldImplement-sending
method for each subclassClassresponsibility method above aClass.



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Wed, 21 Aug 2019 22:16:29 GMT