|
Class: CodeView2 (in Tools)
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--Tools::CodeView2
- Package:
- stx:libtool
- Category:
- Interface-CodeView
- Version:
- rev:
1.327
date: 2024/04/09 12:34:04
- user: stefan
- file: Tools__CodeView2.st directory: libtool
- module: stx stc-classLibrary: libtool
documentation to be added.
class:
<a short class summary here, describing what instances represent>
responsibilities:
<describing what my main role is>
collaborators:
<describing with whom and how I talk to>
API:
<public api and main messages>
example:
<a one-line examples on how to use - can also be in a separate example method>
implementation:
<implementation points>
[instance variables:]
[class variables:]
copyrightCOPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
All Rights Reserved
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the 'Software'), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
debugging
-
trace: aSelector
-
-
traceSelectors
-
-
untrace: aSelector
-
-
untraceAll
-
examples
-
example1
-
menu specs
-
debugMenu
-
This resource specification was automatically generated
by the MenuEditor of ST/X.
Usage example(s):
MenuEditor new openOnClass:Tools::CodeView2 andSelector:#debugMenu
(Menu new fromLiteralArrayEncoding:(Tools::CodeView2 debugMenu)) startUp
|
-
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
|
-
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
|
-
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
|
testing
-
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)
accessing
-
acceptAction: aBlock
-
-
acceptEnabled: aBoolean
-
-
breakpoints
-
-
browser
-
-
codeAspect
-
-
codeAspect: aSymbol
-
tell the textView what is shown, so it can adjust the
syntaxhighlighter.
See SyntaxHighlighter codeAspectXXX for possible aspects.
-
compareAction: aBlock
-
-
compilerClass
-
-
compilerClass: aClass
-
-
contents
-
-
contents: aStringOrStringCollection
-
self update:#value with: aStringOrStringCollection from: textView model
-
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)
-
contentsWithoutEmphasis
-
-
currentParseNode
-
-
delegate: anObject
-
I want to see the events of the text and gutter view
-
diffMode
-
-
diffMode: aBoolean
-
-
editedMethodOrClass: aMethodOrClass
-
Sets the edited method or class (for code completion and highlighting)
-
font
-
return the current drawing font.
Forward from my textview
-
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/invalidate. See also: #basicFont:
-
mode
-
-
mode: aSymbol
-
is this the same as codeAspect ?
-
model
-
(comment from inherited method)
return nil - simpleViews have no model (only providing geometric)
-
model: newModel
-
-
modified
-
return true if text was modified
-
modified: aBoolean
-
set/clear the modified flag
-
services
-
-
services: aCollectionOfServices
-
allow setting of the services (instances);
this is needed for FileBrowser, to setup a codeView2 without Smalltalk-specific
services
-
servicesFromClient
-
-
showAcceptCancelBar
-
-
showGutter
-
-
simulatedContext: anObject
-
the context (or mimicri) to be used in doIts
-
simulatedSelf
-
the self to be used in doIts
-
simulatedSelf: anObject
-
the self to be used in doIts
-
smallLintRulesHolder: aHolder
-
if set, this is returned and the browser is not asked
-
synchronizeWith: aCodeView
-
-
unsynchronizeWith: aCodeView
-
-
xOriginOfContents
-
(comment from inherited method)
return the x coordinate of the viewOrigin in pixels;
used by scrollBars to compute thumb position within the document.
-
yOriginOfContents
-
(comment from inherited method)
return the y coordinate of the viewOrigin in pixels;
used by scrollBars to compute thumb position within the document.
accessing-behavior
-
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
-
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
-
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
-
editedLanguage
-
marked as obsolete by exept MBP at 16-09-2021
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
editedLanguage: aProgrammingLanguage
-
marked as obsolete by exept MBP at 16-09-2021
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
klass
-
the class or the class of the method being shown.
-
klass: aClass
-
the class or the class of the method being shown
-
language
-
marked as obsolete by exept MBP at 16-09-2021
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
language: newValue
-
marked as obsolete by exept MBP at 16-09-2021
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
method
-
the method being shown, or nil
-
method: aMethod
-
the method being shown, or nil
-
programmingLanguage
-
return the value in 'languageHolder', the programmingLanguage of the class
or method being shown.
-
programmingLanguage: aProgrammingLanguage
-
Sets the edited (programming) language.
accessing-look
-
backgroundColor: aColor
-
(comment from inherited method)
set the background color of the contents -
here, (since there is no contents), the viewBackground is changed.
-
viewBackground: aColor
-
Modified (format): / 12-02-2017 / 12:58:44 / cg
aspects
-
browserHolder
-
-
browserHolder: aValueModel
-
-
classHolder
-
return/create the 'classHolder' value holder (automatically generated)
-
classHolder: aValueModel
-
set the 'classHolder' value holder (automatically generated)
-
currentBlockNodeHolder
-
return/create the 'currentBlockNodeHolder' value holder (automatically generated)
-
currentBlockNodeHolder: something
-
set the 'currentBlockNodeHolder' value holder (automatically generated)
-
currentParseNodeHolder
-
return/create the 'currentParseNodeHolder' value holder (automatically generated)
-
currentParseNodeHolder: something
-
set the 'currentParseNodeHolder' value holder (automatically generated)
-
languageHolder
-
cg: I don't like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.)
-
languageHolder: aValueModel
-
set the 'languageHolder' value holder (automatically generated)
-
methodHolder
-
return/create the 'methodHolder' value holder (automatically generated)
-
methodHolder: aValueModel
-
set the 'methodHolder' value holder (automatically generated)
-
modeHolder
-
return/create the 'modeHolder' value holder (automatically generated)
-
modeHolder: something
-
set the 'modeHolder' value holder (automatically generated)
-
smalllintRulesHolder
-
change & update
-
update: aspect with: param from: sender
-
languageHolder value class == Workflow::ExecutionEditorShellScript::Shell_Language ifTrue:[self halt].
-
updateGutter
-
-
updateGutterVisibility
-
-
updateScrollersViewBackground
-
this changes the scroller's background, to show the positions of
warnings, for easy location of interesting spots
channels
-
modifiedChannel
-
return the valueHolder holding true if text was modified
Usage example(s):
-
modifiedChannel: aValueHolder
-
set the valueHolder holding true if text was modified
-
reallyModifiedChannel
-
return the valueHolder holding true if text was modified
-
reallyModifiedChannel: aValueModel
-
-
showAcceptCancelBarChannel
-
-
showAcceptCancelBarChannel: aValueHolder
-
set the valueHolder holding true if the accept-cancel bar is to be shown
-
showGutterChannel
-
-
showGutterChannel: aValueHolder
-
set the valueHolder holding true if the gutter is to be shown
code services
-
browseMethod: method
-
-
browseMethod: method label: label
-
-
browseMethods: methods label: label
-
-
extractSelectorAndSelectedTextFrom: givenSelectedText
-
self windowGroup withWaitCursorDo:[
-
implementorsOf: selector
-
-
implementorsOf: selector in: listOfClasses
-
-
sendersOf: selector
-
not exact, but much faster (looks for symbol only, does not parse code for real send)
delegation
-
commentStrings: anArrayOfCommentStrings
-
-
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.
-
executeDoIt: theCode
-
-
hasSelection
-
true if there us a text selection
-
takeFocus
-
(comment from inherited method)
Unconditionally take the focus from my windowGroup
-
textFromCharacterPosition: start to: end
-
-
trimBlankLines: shouldTrimBoolean
-
-
trimLastCR: shouldTrimBoolean
-
delegation-drawing
-
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...
-
redrawVisibleLine: visLineNr
-
-
redrawVisibleLine: visLine col: colNr
-
-
redrawVisibleLine: visLine from: startCol
-
-
redrawVisibleLine: visLine from: startCol to: endCol
-
delegation-events
-
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.
-
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.
-
buttonPress: button x: x y: y in: view
-
Possibly delegate event a service.
Answers true (i.e. event was handled) iff at least
one service handler method returns true.
In that case, the event is is NOT processes by the view.
Notice, that this is called both for events in the gutter AND for events in the text.
-
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.
-
highlightClassVariable: varName
-
interface from browser (when a class var is selected)
-
highlightInstanceVariable: varName
-
interface from browser (when an inst var is selected)
-
highlightVariableNamed: varName
-
interface for whoever likes it
-
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.
-
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.
-
linesDeletedFrom: start to: end
-
-
linesInsertedFrom: start to: end
-
-
linesModifiedFrom: start to: end
-
-
scrollDown: nLines in: view
-
my text view scrolled...
-
scrollTo: origin redraw: doRedraw in: view
-
my text view scrolled...
-
scrollUp: nLines in: view
-
my text view scrolled...
diff mode
-
recomputeDiff: view
-
initialize & release
-
defaultServices
-
used to call "CodeViewService availableServices",
-
initialize
-
Invoked when a new instance is created.
Usage example(s):
-
initializeGutterViewIn: parentView
-
-
initializeServices
-
only do it, if the services have not yet been defined by the user of this view
-
initializeTextView
-
Initialize textView. gutterView has to be already initialized!
-
release
-
(comment from inherited method)
remove all dependencies from the receiver
-
scrollable: aBoolean
-
must be called before initailized (i.e. after basicNew),
to suppress the scrollbar. Useful for synced2TextView,
which wants a single scrollbar for multiple views.
menu actions
-
accept
-
(comment from inherited method)
accept the current contents by executing the accept-action and/or changeMessage.
-
again
-
-
browseImplementorsOfIt
-
-
browseSendersOfIt
-
-
copySelection
-
-
copySelectionBox
-
-
cut
-
-
doIt
-
-
inspectIt
-
-
inspectSelectedSelector
-
-
inspectSyntaxElements
-
-
inspectView
-
-
pasteOrReplace
-
-
pasteOrReplaceFromHistory
-
-
printIt
-
-
profileIt
-
-
undo
-
menus-dynamic
-
debugMenu
-
-
editMenu
-
install the standard 'more' menu into my own menu
-
implementorsMenu
-
self windowGroup withWaitCursorDo:[
-
implementorsMenu: implementors selector: selector
-
-
sendersMenu
-
self windowGroup withWaitCursorDo:[
-
sendersMenu: senders selector: selector
-
-
servicesMenu
-
disabled, because this menu is now on the gutter,
private
-
codeCompletion
-
I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smells a lot!
-
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)
-
showInfo: message
-
private-accessing
-
gutterView
-
-
syntaxElementSelection
-
-
syntaxElementSelection: anElement
-
anElement isNil ifTrue:[
-
syntaxElements
-
-
syntaxElements: aCollection
-
-
textView
-
return my textView component
-
textViewScroller
-
may be nil, if my textview is unscolled
queries-contents
-
heightOfContents
-
(comment from inherited method)
return the height of the contents in logical units
- defaults to view's visible area here.
This method MUST be redefined in all view classess which are
going to be scrolled AND show data which has different size than
the view. For example, a view showing A4-size documents should return
the number of vertical pixels such a document has on this device.
A view showing a bitmap of height 1000 should return 1000.
If not redefined, scrollbars have no way of knowing the actual size
of the contents being shown. This is called by scrollBars to compute
the relative height of the document vs. the view's actual size.
The value returned here must be based on a scale of 1, since users
of this will scale as appropriate.
-
widthOfContents
-
(comment from inherited method)
return the width of the contents in logical units
- defaults to views visible area here.
This method MUST be redefined in all view classess which are
going to be scrolled AND show data which has different size than
the view. For example, a view showing A4-size documents should return
the number of horizontal pixels such a document has on this device.
A view showing a bitmap of width 500 should return 500.
If not redefined, scrollbars have no way of knowing the actual size
of the contents being shown. This is called by scrollBars to compute
the relative width of the document vs. the view's actual width.
The value returned here must be based on a scale of 1, since users
of this will scale as appropriate.
realization
-
disableAllServices
-
-
enableAllServices
-
-
postRealize
-
(comment from inherited method)
invoked after a view was realized.
Can be redefined in subclasses to perform delayed actions.
redrawing
-
clearScrollbarBackground
-
immediate change the scroller to showing nothing;
-
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).
-
flash: aString
-
flash the view and show aString for a moment.
-
flash: messageOrNil withColor: flashColor
-
delegated to my textview
scrolling
-
horizontalScrollStep
-
(comment from inherited method)
return the amount to scroll when stepping left/right.
Subclasses may want to redefine this.
-
scrollDown: nLines
-
(comment from inherited method)
change origin to scroll down some pixels
-
scrollDownLines: nLines
-
-
scrollHorizontalToPercent: p
-
(comment from inherited method)
scroll to a position given in percent of total
-
scrollLeft
-
(comment from inherited method)
scroll left by some amount; this is called when the scrollbars
scroll-step left button is pressed.
-
scrollLeft: nPixels
-
(comment from inherited method)
change origin to scroll left some pixels
-
scrollRight
-
(comment from inherited method)
scroll right by some amount; this is called when the scrollbars
scroll-step right button is pressed.
-
scrollRight: nPixels
-
(comment from inherited method)
change origin to scroll right some pixels
-
scrollTo: newOrigin
-
(comment from inherited method)
change origin to have newOrigin be visible at the top-left.
The argument defines the integer device coordinates of the new top-left
point.
-
scrollToLine: lineNr
-
-
scrollUp: nLines
-
(comment from inherited method)
change origin to scroll up (towards the origin) by some pixels
-
scrollUpLines: nLines
-
-
scrollVerticalToPercent: p
-
(comment from inherited method)
scroll to a position given in percent of total
-
verticalScrollStep
-
(comment from inherited method)
return the amount to scroll when stepping up/down (also used for mouseWheel).
Subclasses may want to redefine this.
-
viewOrigin
-
(comment from inherited method)
return the viewOrigin; that's the coordinate of the contents
which is shown topLeft in the view
(i.e. the origin of the visible part of the contents).
services
-
breakpointService
-
that one or nil
-
breakpointService: newServiceOrNil
-
set the breakpoint service
-
hasBreakpointService
-
-
hasBreakpoints
-
-
inspectBreakpoints
-
-
lintService
-
prefers the smallsense-lint service over others
-
registerService: aCodeViewService
-
-
servicesDo: aBlock
-
-
syntaxHighlightingService
-
that one or nil
-
unregisterAllServices
-
-
unregisterService: aCodeViewService
-
testing
-
isCodeView2
-
(comment from inherited method)
codeview2 seems to require some extra hacks
-
isReadOnly
-
(comment from inherited method)
stupid default - there are queries for this in keyboardProcessor
-
isTextView
-
(comment from inherited method)
Returns true, if the view displays text
AnnotationShowingScrollerBackground
GutterView
TextView
|