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.87 date: 2023/05/25 06:21:48
user: cg
file: SmalltalkCodeGeneratorTool.st directory: libtool
module: stx stc-classLibrary: libtool

Description:


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

copyright

COPYRIGHT (c) 2002 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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  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
generate a method which returns a cached image (typically icons)

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  createUncachedPNGImageSpecMethodFor: anImage comment: comment in: aClass selector: sel
generate a method which returns an uncached PNG image (typically big pictures)

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  codeToAssign: what to: var

o  code_forWidget_buttonPress

o  code_forWidget_initialize

o  code_forWidget_keyPress

o  code_forWidget_redraw

o  code_forWidget_sizeChanged

o  code_forWidget_update

o  eolCommentString

o  nilValueString

o  selfValueString

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:36:47 GMT