eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Tools::CodeView2::TextView':

Home

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

Class: TextView (private in CodeView2

This class is only visible from within CodeView2.

Inheritance:

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

Package:
stx:libtool
Category:
Interface-CodeView
Owner:
Tools::CodeView2

Instance protocol:

accessing
o  changedDiffText

o  changedDiffText: something

o  changedLines

o  changedLines: something

o  codeView

o  contents: text
(comment from inherited method)
replace the whole contents by something new.
this is not undoably, unless you care for yourself.
See replaceContentsWith:newContents for an undoable version of this

o  contents: text clear: clearPrevious

o  deletedLines

o  deletedLines: something

o  diffMode

o  diffMode: something

o  emptyLines

o  emptyLines: something

o  fontAscent
(comment from inherited method)
answer the ascent of the current font on the current device

o  insertedLines

o  insertedLines: something

o  originDiffText

o  originDiffText: something

o  reallyModified

accessing-color & font
o  colorChanged

o  colorDeleted
^ Color pink

o  colorInserted

accessing-contents
o  list: aCollection expandTabs: expand scanForNonStrings: scan includesNonStrings: nonStrings
JV: used to be notifyLines... but that method

o  setList: aCollection expandTabs: expandTabs redraw: doRedraw
JV: used to be notifyLines... but that method

accessing-look
o  lineSpacing
(comment from inherited method)
get the lineSpacing - that's an additional number of pixels,
by which lines are vertically separated.

accessing-state
o  beUnmodified

o  isModified

o  isReallyModified

bit blitting
o  copyFrom: aDrawable x: srcX y: srcY toX: dstX y: dstY width: w height: h async: async
If doing a vertical scroll, optimized Gutter redraw by

channels
o  reallyModifiedChannel
return the valueHolder holding true if text was really modified.
This is different from #modified, as the inherited modified flag is cleared
to trigger another change notification with every keystroke (for the syntaxHighighter).
This may be (now) considered a very bad hack

o  reallyModifiedChannel: aValueModel

delegation-events
o  isQuickMenuModifierPressed

o  isQuickMenuModifierReleased

drawing
o  backgroundForVisibleLine: visLineNr default: bg

o  drawFromVisibleLine: startVisLineNr to: endVisLineNr with: fg and: bg
draw a visible line range in fg/bg

o  drawLine: line fromX: x inVisible: visLineNr with: fg and: bg
(comment from inherited method)
draw a given string at visible lines position with
given x position in fg/bg. Clears partial line before drawing the string.
Low level entry; not meant for public use.

o  drawLine: lineStringArg inVisible: visLineNr col: col with: fg and: bg
(comment from inherited method)
draw single character at col index of visible line in fg/bg

o  drawLine: lineStringArg inVisible: visLineNr from: startCol to: endColOrNil with: fg and: bg
(comment from inherited method)
draw part of a visible line in fg/bg

o  drawLine: lineString inVisible: visLineNr from: startCol with: fg and: bg
(comment from inherited method)
draw right part of a visible line from startCol to end of line in fg/bg

o  drawVisibleLine: visLineNr with: fg and: bg
(comment from inherited method)
draw a visible line in fg/bg

o  redrawLines
redraw diff lines

editing
o  deleteCharBeforeCursor
delete single character to the left of cursor and move cursor to left

o  getNewOriginText

editing-basic
o  basicDeleteCharsAtLine: lineNr fromCol: startCol toCol: endCol
delete characters from startCol to endCol in line lineNr

o  basicDeleteFromLine: startLineNr toLine: endLineNr
(comment from inherited method)
delete some lines

o  basicDeleteLineWithoutRedraw: lineNr
(comment from inherited method)
delete line - no redraw;
return true, if something was really deleted

o  basicInsert: aCharacter atLine: lineNr col: colNr
insert a single character at lineNr/colNr;
set emphasis to character at current position

o  basicMergeLine: lineNr removeBlanks: removeBlanks
merge line lineNr with line lineNr+1

o  basicSplitLine: lineNr before: colNr
(comment from inherited method)
split the line linNr before colNr; the right part (from colNr)
is cut off and inserted after lineNr; the view is redrawn

o  basicWithoutRedrawInsertLines: lines from: start to: end before: lineNr
(comment from inherited method)
insert a bunch of lines before line lineNr; the view is not redrawn.
Tabs are expanded here with a tab=8 setting (independent of any editor-setting,
because the text might have been pasted from an alien view.

o  basicWithoutRedrawInsertStringWithoutCRs: aString atLine: lineNr col: colNr
(comment from inherited method)
insert aString (which has no crs) at lineNr/colNr.
Tabs are expanded here with a tab=8 setting (independent of any editor-setting,
because the text might have been pasted from an alien view.

o  insertLines: someText from: start to: end before: lineNr
JV@2011-12-20: HACK, the super implementation should

event handling
o  buttonMotion: button x: x y: y

o  buttonPress: button x: x y: y
((ctrlDown := self sensor ctrlDown) and: [ codeView syntaxElementSelection notNil])
ifTrue: [codeView buttonPressInTextView: button x:x y:y ctrlDown: ctrlDown].
super
buttonPress: button
x: x
y: y

o  buttonRelease: button x: x y: y

o  exposeX: x y: y width: w height: h
if in diffmode...

o  keyPress: key x: x y: y
(comment from inherited method)
catch keyboard shortcuts

o  keyRelease: key x: x y: y
(key = #Control_L) ifTrue:
[ codeView highlightClear. self redraw ].

^ super
keyRelease: key
x: x
y: y

initialization
o  initialize

o  setCodeView: aCodeView2

o  setGutterView: aGutterView

menu & menu actions
o  accept
(comment from inherited method)
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  cancel

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

o  searchVariableVisible
search variable option in searchbox visible?

notification
o  notifyLinesDeletedFrom: startLine to: endLine

o  notifyLinesInsertedFrom: startLine to: endLine

o  notifyLinesModifiedFrom: startLine to: endLine

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

o  notifyReallyModified

o  superEditMenu

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

queries
o  editedClass

o  editedMethod

o  supportsSyntaxElements
syntax elements are a byproduct of the syntax highlighter;
it is a list of elements, which chain together same-named variables
and parts of a keyword message's selector.
These allow for quick forward/backward navigation to the next/prev. occurrence
of a variable. Be aware that the implementation is buggy, in that it does not
deal correctly with same-named blockvars of different blocks

o  syntaxElementAtPosition: position
is there is a syntax element at position?
If so, return the element; otherwise, return nil

o  syntaxElementForSelectedVariable
is there is a syntax element for a variable under the cursor?
If so, return the element; otherwise, return nil

o  syntaxElementForSelectorUnderCursor
is there is a syntax element for a message selector under the cursor?
If so, return the element; otherwise, return nil

o  syntaxElementForVariableUnderCursor
is there is a syntax element for a variable under the cursor?
If so, return the element; otherwise, return nil

o  syntaxElementUnderCursor
is there is a syntax element under the cursor?
If so, return the element; otherwise, return nil

scrolling
o  basicScrollTo: anOrigin redraw: doRedraw

o  scrollTo: anOrigin redraw: doRedraw

undo & again
o  nonUndoableDo: aBlock

o  undoableDo: aBlock info: into
(comment from inherited method)
will trigger an error-dialog there (no need for undo-carekeeping)



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Wed, 24 Apr 2024 23:12:30 GMT