eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Tools::CodeView2':

Home

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

Class: CodeView2 (in Tools)


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--Tools::CodeView2

Package:
stx:libtool
Category:
Interface-CodeView
Version:
rev: 1.253 date: 2019/08/11 09:50:51
user: cg
file: Tools__CodeView2.st directory: libtool
module: stx stc-classLibrary: libtool

Class protocol:

debugging
o  trace: aSelector

o  untrace: aSelector

o  untraceAll

examples
o  example1

initialization
o  initialize
Invoked at system start or when the class is dynamically loaded.

menu specs
o  debugMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

o  editMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

usage example(s):

     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu)) startUp

o  editMenu_eclipseStyle
This resource specification was automatically generated
by the MenuEditor of ST/X.

usage example(s):

     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_eclipseStyle
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp

o  editMenu_stxStyle
This resource specification was automatically generated
by the MenuEditor of ST/X.

usage example(s):

     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp


Instance protocol:

accessing
o  acceptAction: aBlock

o  acceptEnabled: aBoolean

o  breakpoints

o  browser

o  codeAspect

o  codeAspect: aSymbol
tell the textView what is shown, so it can adjust the
syntaxhighlighter.
See SyntaxHighlighter codeAspectXXX for possible aspects.

o  compareAction: aBlock

o  compilerClass

o  compilerClass: aClass

o  contents

o  contents: aStringOrStringCollection
self update:#value with: aStringOrStringCollection from: textView model

o  contents: aStringOrStringCollection clear: clearPrevious
Set the contents. If clearPrevous is true, then
previous original text is cleared and set to given one.
(so the text is considered not modified)

o  currentParseNode

o  delegate: anObject
I want to see the events of the text and gutter view

o  diffMode

o  diffMode: aBoolean

o  editedLanguage: aProgrammingLanguage

o  editedMethodOrClass: aMethodOrClass
Sets the edited method or class (for code completion and highlighting)

o  font
(comment from inherited method)
return the current drawing font

o  font: aFont
(comment from inherited method)
set the font for drawing if it has changed.
This should be redefined in some widget to perform an automatic
redraw. See also: #basicFont:

o  mode

o  mode: aSymbol
is this the same as codeAspect ?

o  model
(comment from inherited method)
return nil - simpleViews have no model (only providing geometric)

o  model: newModel

o  modified
return true if text was modified

o  modified: aBoolean
set/clear the modified flag

o  services

o  services: aCollectionOfServices
allow setting of the services (instances);
this is needed for FileBrowser, to setup a codeView2 without Smalltalk-specific
services

o  servicesFromClient

o  showAcceptCancelBar

o  showGutter

o  simulatedSelf

o  synchronizeWith: aCodeView

o  unsynchronizeWith: aCodeView

accessing-behavior
o  expandTabsWhenUpdating
return the tab expansion behavior.
If true (the default), the list of lines as given via #list: or
due to a model update is processed and lines are replaced by lines with
tabs expanded.
This behavior is ok in 99.99% of all applications.
However, you may turn this off iff:
- you are certain, that no tabs are in the passed in list
- it is very expensive to process the list (for example, because the list
is defined by a virtual array, which computes the lines dynamically, on the fly).
One use where this flag should be turned off is in the hex-memory display,
which is able to simulate texts with millions of lines, but they are actually
simulated by generating the presented lines dynamically, as they are displayed.
Notice, that to totally prevent scanning og the whole text, you may have to turn off
other flags, such as checkineEndConventionWhenUpdating

o  expandTabsWhenUpdating: aBoolean
define the tab expansion behavior.
If true (the default), the list of lines as given via #list: or
due to a model update is processed and lines are replaced by lines with
tabs expanded.
This behavior is ok in 99.99% of all applications.
However, you may turn this off iff:
- you are certain, that no tabs are in the passed in list
- it is very expensive to process the list (for example, because the list
is defined by a virtual array, which computes the lines dynamically, on the fly).
One use where this flag should be turned off is in the hex-memory display,
which is able to simulate texts with millions of lines, but they are actually
simulated by generating the presented lines dynamically, as they are displayed.
Notice, that to totally prevent scanning og the whole text, you may have to turn off
other flags, such as checkineEndConventionWhenUpdating

o  readOnly: aBoolean
ignored here; present for compatibility with some textView subclasses,
so that UIPainter can handle it in its TextView spec (which contains a
readOnly field)

accessing-code component
o  klass
the class or the class of the method being shown.

o  klass: aClass
the class or the class of the method being shown

o  language
return the value in 'languageHolder', the programmingLanguage of the class
or method being shown.
BAD name: confusion with the national language.
why not call this 'programmingLanguage' ?

usage example(s):

No, no default language, please (for workspaces, etc.).

o  language: newValue
set the value in 'languageHolder', the programmingLanguage of the class
or method being shown.
BAD name: confusion with the national language.
why not call this 'programmingLanguage' ?

o  method
the method being shown, or nil

o  method: aMethod
the method being shown, or nil

accessing-look
o  backgroundColor: aColor

o  viewBackground: aColor
Modified (format): / 12-02-2017 / 12:58:44 / cg

aspects
o  browserHolder

o  browserHolder: aValueModel

o  classHolder
return/create the 'classHolder' value holder (automatically generated)

o  classHolder: aValueModel
set the 'classHolder' value holder (automatically generated)

o  currentBlockNodeHolder
return/create the 'currentBlockNodeHolder' value holder (automatically generated)

o  currentBlockNodeHolder: something
set the 'currentBlockNodeHolder' value holder (automatically generated)

o  currentParseNodeHolder
return/create the 'currentParseNodeHolder' value holder (automatically generated)

o  currentParseNodeHolder: something
set the 'currentParseNodeHolder' value holder (automatically generated)

o  languageHolder
cg: I don't like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.)

o  languageHolder: aValueModel
set the 'languageHolder' value holder (automatically generated)

o  methodHolder
return/create the 'methodHolder' value holder (automatically generated)

o  methodHolder: aValueModel
set the 'methodHolder' value holder (automatically generated)

o  modeHolder
return/create the 'modeHolder' value holder (automatically generated)

o  modeHolder: something
set the 'modeHolder' value holder (automatically generated)

change & update
o  update: aspect with: param from: sender
languageHolder value class == Workflow::ExecutionEditorShellScript::Shell_Language ifTrue:[self halt].

o  updateGutter

o  updateGutterVisibility

o  updateScrollersViewBackground
this changes the scroller's background, to show the positions of
warnings, for easy location of interesting spots

channels
o  modifiedChannel
return the valueHolder holding true if text was modified

usage example(s):

^ modifiedChannel

o  modifiedChannel: aValueHolder
set the valueHolder holding true if text was modified

o  reallyModifiedChannel
return the valueHolder holding true if text was modified

o  reallyModifiedChannel: aValueModel

o  showAcceptCancelBarChannel

o  showAcceptCancelBarChannel: aValueHolder
set the valueHolder holding true if text was modified

o  showGutterChannel

o  showGutterChannel: aValueHolder
set the valueHolder holding true if text was modified

code services
o  browseMethod: method

o  browseMethod: method label: label

o  browseMethods: methods label: label

o  extractSelectorAndSelectedTextFrom: givenSelectedText
self windowGroup withWaitCursorDo:[

o  implementorsOf: selector

o  sendersOf: selector
not exact, but much faster (looks for symbol only, does not parse code for real send)

delegation
o  doesNotUnderstand: aMessage
(comment from inherited method)
this message is sent by the runtime system (VM) when
a message is not understood by some object (i.e. there
is no method for that selector). The original message has
been packed into aMessage (i.e. the receiver, selector and
any arguments) and the original receiver is then sent the
#doesNotUnderstand: message.
Here, we raise another signal which usually enters the debugger.
You can of course redefine #doesNotUnderstand: in your classes
to implement message delegation,
or handle the MessageNotUnderstood exception gracefully.

o  hasSelection
true if there us a text selection

delegation-drawing
o  drawLine: lineNo in: view atX: x y: yBaseline width: w height: hFont ascent: aFont from: startCol to: endColOrNil with: fg and: bg
See the comment in
CodeViewService>>drawLine:in:atX...

o  redrawVisibleLine: visLineNr

o  redrawVisibleLine: visLine col: colNr

o  redrawVisibleLine: visLine from: startCol

o  redrawVisibleLine: visLine from: startCol to: endCol

delegation-events
o  buttonMotion: button x: x y: y in: view
Delegates events to services. Answers true iff at least
one service handler method returns true. In that case,
the event is is NOT processes by the view.

o  buttonMultiPress: button x: x y: y in: view
Delegates events to services. Answers true iff at least
one service handler method returns true. In that case,
the event is is NOT processes by the view.

o  buttonPress: button x: x y: y in: view
Delegates events to services. Answers true iff at least
one service handler method returns true. In that case,
the event is is NOT processes by the view.

o  buttonRelease: button x: x y: y in: view
Delegates events to services. Answers true iff at least
one service handler method returns true. In that case,
the event is is NOT processes by the view.

o  highlightClassVariable: name
interface from browser (when a class var is selected)

o  highlightInstanceVariable: name
interface from browser (when an inst var is selected)

o  keyPress: key x: x y: y in: view
Delegates events to services. Answers true iff at least
one service handler method returns true. In that case,
the event is is NOT processes by the view.

o  keyRelease: key x: x y: y in: view
Delegates events to services. Answers true iff at least
one service handler method returns true. In that case,
the event is is NOT processes by the view.

o  linesDeletedFrom: start to: end

o  linesInsertedFrom: start to: end

o  linesModifiedFrom: start to: end

o  scrollDown: nLines in: view
my text view scrolled...

o  scrollTo: origin redraw: doRedraw in: view
my text view scrolled...

o  scrollUp: nLines in: view
my text view scrolled...

diff mode
o  recomputeDiff: view

initialize & release
o  defaultServices
used to call "CodeViewService availableServices",

o  initialize
Invoked when a new instance is created.

usage example(s):

Call super initialize

usage example(s):

Now initialize sub-views

usage example(s):

initialize methods

o  initializeGutterView

o  initializeServices
only do it, if the services have not yet been defined by the user of this view

o  initializeTextView
Initialize textView. gutterView has to be already initialized!

o  release
(comment from inherited method)
remove all dependencies from the receiver

menu actions
o  accept

o  again

o  browseImplementorsOfIt

o  browseSendersOfIt

o  copySelection

o  copySelectionBox

o  cut

o  doIt

o  inspectIt

o  inspectSelectedSelector

o  inspectSyntaxElements

o  inspectView

o  pasteOrReplace

o  pasteOrReplaceFromHistory

o  printIt

o  profileIt

o  undo

menus-dynamic
o  debugMenu

o  editMenu
install the standard 'more' menu into my own menu

o  implementorsMenu
self windowGroup withWaitCursorDo:[

o  implementorsMenu: implementors selector: selector
implementors

o  sendersMenu
self windowGroup withWaitCursorDo:[

o  sendersMenu: senders selector: selector

o  servicesMenu
disabled, because this menu is now on the gutter,

private
o  codeCompletion
I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell?

o  reallyModified
check for modified code by comparing the source against
the codeView's contents.
That's the true modified value
(in case user undid his changes, and the displayed text is actually original)

o  showInfo: message

private-accessing
o  gutterView

o  syntaxElementSelection

o  syntaxElementSelection: anElement
anElement isNil ifTrue:[

o  syntaxElements

o  syntaxElements: aCollection

o  textView

o  textViewScroller

realization
o  disableAllServices

o  enableAllServices

o  postRealize
(comment from inherited method)
invoked after a view was realized.
Can be redefined in subclasses to perform delayed actions.

redrawing
o  flash
(comment from inherited method)
flash the view - fill it black, then white, finally
redraw completely.
Can be used to wakeup the user :-)
when problem or warning conditions arise.
Someone may redefine this to flash its contents (instead of black/white).

o  flash: aString
flash the view and show aString for a moment.

o  flash: messageOrNil withColor: flashColor
delegated to my textview

services
o  breakpointService
that one or nil

o  breakpointService: newServiceOrNil
set the breakpoint service

o  hasBreakpointService

o  hasBreakpoints

o  inspectBreakpoints

o  lintService
prefers the smallsense-lint service over others

o  registerService: aCodeViewService

o  servicesDo: aBlock

o  syntaxHighlightingService
that one or nil

o  unregisterAllServices

o  unregisterService: aCodeViewService

testing
o  hasOwnScrollbars
a hack for codeView2, which behaves like a TextView, but has its own
scrollbars embedded - sigh (an extra load one).
This allows for the UIBuilder to avoid creating an extra set around such
a view (as is the case with TextSpec with scrollbars when using CodeView2)

o  isCodeView2
(comment from inherited method)
codeview2 seems to require some extra hacks

o  isReadOnly

o  isTextView
(comment from inherited method)
Returns true, if the view displays text


Private classes:

    AnnotationShowingScrollerBackground
    GutterView
    TextView


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Wed, 24 Apr 2024 18:07:50 GMT