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.69 date: 2018/01/18 16:02:16
user: cg
file: CodeView.st directory: libwidg
module: stx stc-classLibrary: libwidg
Author:
Claus Gittinger

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.


Related information:

    Workspace
    EditTextView
    TextView

Class protocol:

others
o  version_CVS


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

o  cursorReturn: withPossibleAutoindent
added an argument to disable autoindent, because this method is called from other
places as well...

event handling
o  buttonMotion: buttonState x: x y: 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.



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Wed, 21 Nov 2018 17:53:02 GMT