eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'CodeView':

Home

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

Class: CodeView


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--ListView
                  |
                  +--TextView
                     |
                     +--EditTextView
                        |
                        +--TextCollector
                           |
                           +--Workspace
                              |
                              +--CodeView
                                 |
                                 +--Tools::CodeView2::TextView
                                 |
                                 +--Tools::NewSystemBrowserCodeView

Package:
stx:libwidg
Category:
Views-Text
Version:
rev: 1.92 date: 2024/04/09 12:20:21
user: stefan
file: CodeView.st directory: libwidg
module: stx stc-classLibrary: libwidg

Description:


a view for text which is known to be smalltalk code. 
It adds 'explain' to the menu, and defines another action: 
  explainAction to be performed for explain.

This action is to be defined by the user of this view 
(i.e. usually the owning browser)

In addition, uncomment/comment are added to the controlMenu.
These are smalltalk specific - if you plan to edit other language code,
you need a different kind of CodeView for that.

If used with a model, accept sends the changeMsg to it (as defined in EditTextView).
(however, it is possible to define both changeMsg and acceptAction)

See how doIt/printIt/inspectIt are handled in the superclass: Workspace.

Caveat:
    in this version, CodeView does not yet support MVC setups for doIt
    and explain.
    If required, simulate this by setting the doItAction and
    explainAction, to notify the model manually about whats going on.

[instance variables:]
    commentStrings          <Array>         an array with 2 entries;
                                            the first defining the EOL-comment string,
                                            the 2nd (another array) defining opening
                                            and closing comment strings.
                                            Default to ST/X comments,
                                            can be changed in an instance for other
                                            programming languages.

copyright

COPYRIGHT (c) 1989 by Claus Gittinger 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.

Instance protocol:

accessing
o  explainAction: aBlock
set the action to be performed on explain

o  formatAction: aBlock
set the action to be performed on format

o  pointerOverWordAction: aBlock

cursor handling
o  cursorReturn
(comment from inherited method)
move cursor to start of next line; scroll if at end of visible text

o  cursorReturn: withPossibleAutoindent
added an argument to disable autoindent, because this method is called from other
places as well (especially: the terminal emulator)...

event handling
o  buttonMotion: buttonState x: x y: y
line := self visibleLineOfY:y.

o  keyPress: key x: x y: y
catch keyboard shortcuts

menu & menu actions
o  accept
redefined accept action;
save cursor and selection to allow restore in case of an error
(we are typically compiling here ... and the compiler may show
errors by highlighting them)

o  editMenu
return the popUpMenu;
to make this independent from what is defined in superclasses,
get the superclass menu and add my functions.

o  explain
explain action;
evaluate the explainBlock passing whole contents and
selection as arguments.

o  format
format action;
evaluate the formatBlock passing whole contents as argument.

o  showLineLimitInMenu
(comment from inherited method)
false.

more do what I mean
o  checkPossiblyRepetitiveReplace: thisOriginal with: thisReplacement
check if user does something repetitive...



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 08:21:48 GMT