|
Class: TextView (private in CodeView2
This class is only visible from within
CodeView2.
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--ListView
|
+--TextView
|
+--EditTextView
|
+--TextCollector
|
+--Workspace
|
+--CodeView
|
+--Tools::CodeView2::TextView
- Package:
- stx:libtool
- Category:
- Interface-CodeView
- Owner:
- Tools::CodeView2
accessing
-
changedDiffText
-
-
changedDiffText: something
-
-
changedLines
-
-
changedLines: something
-
-
codeView
-
-
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
-
contents: text clear: clearPrevious
-
-
deletedLines
-
-
deletedLines: something
-
-
diffMode
-
-
diffMode: something
-
-
emptyLines
-
-
emptyLines: something
-
-
fontAscent
-
(comment from inherited method)
answer the ascent of the current font on the current device
-
insertedLines
-
-
insertedLines: something
-
-
listOriginal
-
-
originDiffText
-
-
originDiffText: something
-
accessing-color & font
-
colorChanged
-
-
colorDeleted
-
^ Color pink
-
colorInserted
-
accessing-contents
-
list: aCollection expandTabs: expand scanForNonStrings: scan includesNonStrings: nonStrings
-
JV: used to be notifyLines... but that method
-
setList: aCollection expandTabs: expandTabs redraw: doRedraw
-
JV: used to be notifyLines... but that method
accessing-look
-
lineSpacing
-
(comment from inherited method)
get the lineSpacing - that's an additional number of pixels,
by which lines are vertically separated.
accessing-state
-
beUnmodified
-
-
isModified
-
-
isReallyModified
-
bit blitting
-
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
-
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
-
reallyModifiedChannel: aValueModel
-
set the reallyModifiedChannel - a valueHolder holding true,
if the text was really modified; that is: it was edited by the user
and the new text is different from the original (which is usually either
a file's contents, a method source or similar.
With this mechanism, we can hide the accept-cancel bar, if the user changes the
text back to the original (not all applications do this correctly).
delegation-events
-
isQuickMenuModifierPressed
-
is the modifier-key for quick codeview actions pressed?
either CTRL or META
-
isQuickMenuModifierReleased
-
drawing
-
backgroundForVisibleLine: visLineNr default: bg
-
-
drawFromVisibleLine: startVisLineNr to: endVisLineNr with: fg and: bg
-
draw a visible line range in fg/bg
-
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.
-
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
-
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
-
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
-
drawVisibleLine: visLineNr with: fg and: bg
-
(comment from inherited method)
draw a visible line in fg/bg
-
redrawLines
-
redraw diff lines
editing
-
deleteCharBeforeCursor
-
delete single character to the left of cursor and move cursor to left
-
getNewOriginText
-
editing-basic
-
basicDeleteCharsAtLine: lineNr fromCol: startCol toCol: endCol
-
delete characters from startCol to endCol in line lineNr
-
basicDeleteFromLine: startLineNr toLine: endLineNr
-
(comment from inherited method)
delete some lines.
Does not tell dependents
-
basicDeleteLineWithoutRedraw: lineNr
-
(comment from inherited method)
delete line - no redraw;
Does not tell dependents
return true, if something was really deleted
-
basicInsert: aCharacter atLine: lineNr col: colNr
-
insert a single character at lineNr/colNr;
set emphasis to character at current position
-
basicMergeLine: lineNr removeBlanks: removeBlanks
-
merge line lineNr with line lineNr+1
-
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.
Does not tell dependents
-
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.
Does not tell dependents
-
basicWithoutRedrawInsertStringWithoutCRs: aString atLine: lineNr col: colNr
-
no - there was no cr inserted
-
insertLines: someText from: start to: end before: lineNr
-
JV@2011-12-20: HACK, the super implementation should
event handling
-
buttonMotion: button x: x y: y
-
(comment from inherited method)
line := self visibleLineOfY:y.
-
buttonPress: button x: x y: y
-
| ctrlDown |
Usage example(s):
((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
|
-
buttonRelease: button x: x y: y
-
Modified (format): / 03-03-2022 / 09:40:01 / cg
-
exposeX: x y: y width: w height: h
-
if in diffmode...
-
keyPress: key x: x y: y
-
(comment from inherited method)
catch keyboard shortcuts
-
keyRelease: key x: x y: y
-
(key = #Control_L) ifTrue:
[ codeView highlightClear. self redraw ].
^ super
keyRelease: key
x: x
y: y
initialization
-
initialize
-
needed for per-position tooltips
-
setCodeView: aCodeView2
-
-
setGutterView: aGutterView
-
menu & menu actions
-
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)
-
cancel
-
-
compare
-
-
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.
-
searchVariableVisible
-
search variable option in searchbox visible?
notification
-
notifyLinesDeletedFrom: startLine to: endLine
-
-
notifyLinesInsertedFrom: startLine to: endLine
-
-
notifyLinesModifiedFrom: startLine to: endLine
-
private
-
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)
-
notifyReallyModified
-
-
superEditMenu
-
-
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
-
addAuthorToCommentLines
-
-
editedClass
-
(comment from inherited method)
for the code completion
-
editedMethod
-
(comment from inherited method)
for the code completion
-
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
-
syntaxElementAtPosition: position
-
is there is a syntax element at position?
If so, return the element; otherwise, return nil
-
syntaxElementForSelectedVariable
-
is there is a syntax element for a variable under the cursor?
If so, return the element; otherwise, return nil
-
syntaxElementForSelectorUnderCursor
-
is there is a syntax element for a message selector under the cursor?
If so, return the element; otherwise, return nil
-
syntaxElementForVariableUnderCursor
-
is there is a syntax element for a variable under the cursor?
If so, return the element; otherwise, return nil
-
syntaxElementUnderCursor
-
is there is a syntax element under the cursor?
If so, return the element; otherwise, return nil
scrolling
-
basicScrollTo: anOrigin redraw: doRedraw
-
-
scrollTo: anOrigin redraw: doRedraw
-
undo & again
-
nonUndoableDo: aBlock
-
-
undoableDo: aBlock info: into
-
(comment from inherited method)
will trigger an error-dialog there (no need for undo-carekeeping)
|