|
Class: HTMLDocumentFrame
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--HTMLDocumentFrame
|
+--HTMLDocumentView
- Package:
- stx:libhtml
- Category:
- System-Documentation
- Version:
- rev:
1.233
date: 2019/05/01 09:38:11
- user: cg
- file: HTMLDocumentFrame.st directory: libhtml
- module: stx stc-classLibrary: libhtml
- Author:
- Claus Gittinger
displays HTML documents.
HTMLDocumentView
HTMLDocumentPainter
accessing
-
documentSearchPathes
-
DocumentSearchPathes := nil
-
documentSearchPathesAdd: something
-
add path without language to search path for html documents
-
imageResolverQuery
-
return the query which, when answered, will provide an image resolver
cleanup
-
flushCachedImages
-
-
lowSpaceCleanup
-
cleanup in low-memory situations
defaults
-
defaultAlienAppletsEnabled
-
self defaultAlienAppletsEnabled
-
defaultDocumentSearchPathes
-
default value for the 'DocumentSearchPathes' instance variable (automatically generated)
-
defaultHTMLExtension
-
self defaultHTMLExtension
-
defaultInternalAppletsEnabled
-
self defaultInternalAppletsEnabled
-
defaultJavaAppletsEnabled
-
self defaultJavaAppletsEnabled
-
defaultScriptExecutionEnabled
-
self defaultScriptExecutionEnabled
-
documentFileFor: relativeOrAbsolutePath
-
given a relative path in the documentation hierarchy,
find the file's absolute path - first trying the current language,
if not found, try an english version
usage example(s):
self documentSearchPathesAdd:'./stx/doc/online'.
Smalltalk language:#en.
self documentFileFor:'TOP.html'.
self documentFileFor:'programming/viewintro.html'
Smalltalk language:#de.
self documentFileFor:'TOP.html'.
self documentFileFor:'programming/viewintro.html'
|
-
documentFileFor: relativeOrAbsolutePath searchIn: pathesOrNil
-
given a relative path in the documentation hierarchy,
find the file's absolute path - first trying the current language,
if not found, try an english version
usage example(s):
self documentSearchPathesAdd:'./stx/doc/online'.
Smalltalk language:#en.
self documentFileFor:'TOP.html'.
self documentFileFor:'programming/viewintro.html'
Smalltalk language:#de.
self documentFileFor:'TOP.html'.
self documentFileFor:'programming/viewintro.html'
|
initialization
-
fileExecutorTable
-
-
fileExtensionTable
-
-
initialize
-
self initializeInternalImageTable. -- now done lazily in getter
usage example(s):
self initializeFileExtensionTable. -- now done lazily in getter
|
usage example(s):
-
initializeFileExecutorTable
-
FileExecutorTable := nil.
self initializeFileExecutorTable
-
initializeFileExtensionTable
-
setup the table mapping file-name extensions to
internal document types
usage example(s):
FileExtensionTable := nil.
self initializeFileExtensionTable
|
-
initializeInternalImageTable
-
setup the table mapping internal document types to
bitmap image filenames
usage example(s):
InternalImageTable := nil.
self initializeInternalImageTable
|
-
internalImageTable
-
-
update: something with: aParameter from: changedObject
-
smalltalk is about to save an image - don't save cachedImages
startup
-
onFile: aDocumentName in: aView
-
create a documentationView on aDocumentName in some other view.
Returns the htmlView
-
onFile: aFileName text: htmlText top: topDirectory in: top
-
create a documentationView on aDocumentName or htmlText in
some other view. Returns the htmlView.
Helper for onFile:in: and onText:in:
-
onText: htmlText in: aView
-
create a documentationView on htmlText (must be html) in some other view.
Returns the htmlView.
accessing
-
bind: key to: value
-
-
canGoBackHolder
-
a valueholder which holds true, if there is an URL history entry
to which we can go back
-
currentDirectoryName
-
return the current URLs directoryName
-
currentDocument
-
return the current document
-
currentURL
-
return the current documents URL
-
defaultViewBackgroundColor
-
-
documentAnchor
-
-
documentEncoding
-
-
documentEncoding: anEncodingSymbol
-
Transcript show:'docEncoding: '; showCR:documentEncoding.
-
enableActionLinks: something
-
-
enableExternalLinks: something
-
-
forms
-
-
getDocumentFilename: urlString
-
only resolves local files - not URLs
-
getDocumentSource: anchorHref action: action
-
-
getFileSource: urlString
-
do nothing
-
history
-
-
homeDocument: urlString
-
self showFileDocument:urlString anchor:nil remember:true.
-
homeText: someText
-
-
infoDisplay: aString
-
-
infoHolder: aValueHolder
-
-
locationDisplay: aString
-
-
model: aValueHolder
-
-
painter
-
-
rememberDocument: url host: urlHost text: text action: action inHistory: inHistory
-
remember that the current document was ever visited.
This affects the color in which corresponding anchor elements are drawn.
If inHistory is true, it is also remembered in the back-history
-
setTopDirectoryName: aDirectoryName
-
-
showImages: aBoolean
-
turn on/off image display
-
showInfo: aString
-
-
style
-
returns the style information; a dictionary filled with
font-, color- and other information
-
updateLabelFlag: aBoolean
-
-
updateTopViewsTitleFlag: aBoolean
-
When I encounter a <title>-element, I can optionally update my topview's window title.
This behavior can be controlled by setting/clearing this flag.
The default is false (explicitly turned on by the HTMLDocumentView)
-
uriHolder: aValueHolder
-
-
uriInputHolder: aValueHolder
-
-
visitedURLs
-
accessing-behavior
-
anchorActionPerformer
-
if set, this block gets all anchor actions to be performed,
before ANY internal action is attempted.
The block should return true if it handled the click.
Useful to divert any link action to an external browser.
-
anchorActionPerformer: aBlock
-
if set, this block gets all anchor actions to be performed,
before ANY internal action is attempted.
The block should return true if it handled the click.
Useful to divert any link action to an external browser.
-
linkActionPerformer
-
can be set from applications which embed an html view and want to be
called back when an action-link is pressed.
This avoids the smelly habbit of adding private methods as extensions
to this class (eg. Jan's quickFix).
To use, set the linkActionPerformer in your postBuild method,
then generate action anchors of the form: <A action='doit: linkActionPerformer doSomething'>
-
linkActionPerformer: something
-
set a link-action performer.
Can be set from applications which embed an html view and want to be
called back when an action-link is pressed.
This avoids the smelly habbit of adding private methods as extensions
to this class (eg. Jan's quickFix).
To use, set the linkActionPerformer in your postBuild method,
then generate action anchors of the form: <A action='doit: linkActionPerformer doSomething'>
-
masterClickActionPerformer: aBlock
-
if set, this block gets invoked with element and click position
before ANY internal action or other action is attempted.
The block should return true, if it handled the click.
Useful to divert any click action to an external tool/browser
(can also be used to filter clocks on some elements).
-
selfInDoitExpressions: someone
-
if set, that one will be 'self' in a doit expression.
If not set, the DocumentFrame itself will play this role
accessing-document
-
localImageAt: url put: anImage
-
when using the html-view internally, this allows for images to be provided by
Smalltalk, without a need for a file or http-service
-
performAction: action source: source documentName: urlString remember: rem
-
an action link:
<A action='doit: <ST-expr>'
a browse-action link
<A action='browse: <class>'
a plain-text generating link:
<A action='plaintext: <ST-expr>'
an html-text generating link:
<A action='htmltext: <ST-expr>'
inside a doit expression, 'self' will be bound to selfInDoitExpressions,
which - if never set - defaults to the receiver (i.e. the HTMLDocumentFrame itself).
-
setText: text
-
set the text - see example
-
setText: text anchor: anchor
-
set the text - see example
-
setText: text anchor: anchor documentName: documentName
-
-
setText: text header: header footer: footer id: elementId anchor: anchor
-
set the text - see examples
-
setText: text plain: plain anchor: anchor documentName: documentName remember: rem
-
self topView withWaitCursorDo:[
-
showDocument: urlOrUrlString
-
-
showDocument: url file: fileName onHost: aHost anchor: anchor remember: rem source: showSource
-
uriHolder notNil ifTrue:[
-
showDocument: url source: aBoolean
-
-
showDocument: urlOrUrlString text: anchorText action: action remember: rem source: source
-
Transcript show:'anchor selected text='; showCR:anchorText.
-
showFileDocument: fileName
-
-
showFileDocument: fileName anchor: anchor remember: rem
-
-
showFileDocument: fileName anchor: anchor remember: rem source: showSource
-
-
showFileDocument: fileName remember: rem
-
-
showTextDocument: urlString file: file method: method remember: rem source: source
-
source
accessing-security
-
alienAppletsEnabled
-
-
catchErrors
-
-
enableAlienApplets: aBoolean
-
-
enableExecution: aBoolean
-
-
enableInternalApplets: aBoolean
-
-
enableJavaApplets: aBoolean
-
-
enableScriptExecution: aBoolean
-
-
internalAppletsEnabled
-
-
javaAppletsEnabled
-
-
nameSpaceForExecution: aNameSpace
-
-
scriptExecutionEnabled
-
change & update
-
update: something with: aParameter from: changedObject
-
-
updateFromModel
-
defaults
-
isManPageSuffix: suffix
-
-
mimeTypeFromSuffix: suffix
-
self basicNew mimeTypeFromSuffix:'gif'
self basicNew mimeTypeFromSuffix:'htm'
self basicNew mimeTypeFromSuffix:'qt'
document painter callBacks
-
appletClass: className fromURL: url
-
-
appletClass: className fromURL: url archive: archiveURLOrNil
-
make certain, Applet is not autoloaded into wrong
-
codeStreamFor: url
-
returns a stream on a codeFile or nil
-
fullURLPathFor: url
-
returns an URL's full path
-
imageFor: urlString
-
returns an image or nil
-
imageFor: urlStringIn now: now
-
returns an image or nil. The argument now specifies, if the image
should be converted to a device image right NOW or not.
Usually, it is false (i.e. no interest in a device image) during
document scan, and true when the image is to be displayed.
-
streamForURL: urlStringIn
-
returns a stream or nil
-
submitDoitMethod: method form: info
-
ok, the action contains a block
and the attributes contains the arg <-> value associations
first, parse the block (suing the compiler) to
get more symbolic info about it ...
-
submitForm: info
-
-
title: aString
-
define the title - a callBack when a <TITLE> tag is encountered
-
visitTest: urlString action: actionString
-
('check visited: ' , urlString) printCR.
event handling
-
buttonMotion: state x: x y: y
-
(comment from inherited method)
button was moved
-
buttonPress: button x: x y: y
-
for menus
-
keyPress: key x: x y: y
-
(key == #InspectIt) ifTrue:[self inspect].
-
mouseWheelZoom: amount
-
CTRL-wheel action
-
redraw
-
(comment from inherited method)
redraw myself
if there is a model, this one shall redraw itself,
otherwise we cannot do much here - has to be redefined in subclasses
-
redrawX: x y: y width: w height: h
-
(comment from inherited method)
redraw part of myself immediately, given logical coordinates
(if transformation is nonNil)
The default here is to redraw everything
- subclasses usually redefine this, adding more intelligence
-
showAnchorCursor
-
to be redefined
-
showNormalCursor
-
to be redefined
-
sizeChanged: how
-
first resize
help
-
helpTextAt: aPoint
-
super helpTextAt:aPoint
initialization & release
-
destroy
-
(comment from inherited method)
unmap & destroy - make me invisible, destroy subviews then
make me unknown to the device
-
fetchDeviceResources
-
fetch device specific resources.
-
initFonts: aPageStyle
-
encoding := #'iso8859-1'.
-
initLazyFontStyle: aFontStyle size: fontSize encoding: encoding
-
take the first - for now.
-
initStyle
-
setup style specifics.
-
initialize
-
no - never use dithered colors for the background
-
recreate
-
sent after a snapin or a migration, reinit for new device
-
reinitStyle
-
handle dynamic style changes
internal pseudo documents
-
documentStreamForErrorResponse: reply forURL: urlString location: location onHost: aHost
-
return an array filled with:
stream
newDocument name
newDocument directory
documentHost
mhmh - this is not very object-oriented ...
-
documentStreamForURL: urlOrString file: urlFileName onHost: aHost
-
return an array filled with:
stream
newDocument name
newDocument directory
documentHost
mhmh - this is not very object-oriented ...
-
pseudoDocumentStreamForDirectory: url
-
a directory in an HREF - create pseudo document
-
pseudoDocumentStreamForImageFile: url
-
an image in an HREF - create pseudo document
-
pseudoDocumentStreamForManPageFile: url
-
a manPage in an HREF - create pseudo document
-
pseudoDocumentStreamForPDFFile: url
-
a PDF file in an HREF - create error document, if acroread cannot be opened
-
pseudoDocumentStreamForPlainFile: url
-
a plainFile in an HREF - create pseudo document
-
pseudoDocumentStreamForPostscriptFile: url
-
a postscript file in an HREF - create error document, if ghostview cannot be opened
-
pseudoDocumentStreamForUnreadableFile: urlString
-
an unreadable file in an HREF - create pseudo document
-
pseudoDocumentStreamForUnreadableFile: urlString message: msg
-
an unreadable file in an HREF - create pseudo document
-
pseudoDocumentStreamOnHTML: aString headLine: headLine title: title
-
create pseudo document showing a string
-
pseudoDocumentStreamOnString: aString headLine: headLine title: title
-
create pseudo document showing a string
-
pseudoDocumentStreamOnString: aString title: title
-
create pseudo document showing a string
menu & actions
-
clickedExampleTextOrNil
-
forget any emphasis
-
copyExampleText
-
-
copyLink
-
-
editImage
-
-
editMenu
-
return an appropriate popUpMenu.
check if pointer is over:
an example - offer copy-example
an image - offer inspect-image
a href - offer open-new-browser
-
editThisDocument
-
-
executeAndInspectExampleText
-
-
executeExampleText
-
-
inspectImage
-
-
openNewOnAnchor
-
does not work yet
-
saveImage
-
-
showImageInFileBrowser
-
not unloadable
-
terminalOnExampleText
-
-
workspaceOnExampleText
-
initialSyntax:nil. -- not a good idea; most examples are smalltalk
misc
-
ampersandBindings
-
-
backToPreviousDocument
-
Transcript showCR:historyEntry printString.
-
elementAt: aPoint
-
-
fontEncodingFor: encodingSymbol
-
-
getVerticalPosition
-
-
isValidMethod: methodString
-
-
positionOnAnchor: aLocalAnchor
-
not yet visible - remember to position later
-
positionTo: aPoint
-
-
showNotFound: aFileName
-
-
startImageFlushProcess
-
NoSignal
queries
-
documentTitle
-
-
extentOfContents
-
-
heightForLines: numberOfLines
-
return the height of the receiver, if numberOfLines are to be displayed
-
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.
-
horizontalScrollStep
-
(comment from inherited method)
return the amount to scroll when stepping left/right.
Subclasses may want to redefine this.
-
preferredExtentForLines: numLines cols: numCols
-
get an approximation for the extent to display numLines and
numCols in normal fontsize
-
verticalScrollStep
-
return the amount to scroll when stepping up/down (also used for mouseWheel).
-
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.
user actions
-
anchorElementSelected: anchorElement
-
user clicked on an anchor.
If the anchor has an action link and linkActions are enabled,
or it is an external link, and external links are enabled,
or it is an internal link, then proceed in showDocument:,
which performs the action. Otherwise ignore the click
-
exampleElementSelected: exampleElement
-
user clicked on an example. If execution is enabled,
evaluate it save from any exceptions (show what happened, if
any exception is raised during evaluation).
If the exampleElement has a SHOWRESULT attribute, display the
printString in the infoView.
-
executeExampleText: action withResultDo: resultAction onErrorDo: errorAction
-
user clicked on an example. If execution is enabled,
evaluate it save from any exceptions (show what happened, if
any exception is raised during evaluation).
If the exampleElement has a SHOWRESULT attribute, display the
printString in the infoView.
-
showResultOfCodeExample: rslt
-
-
updateAnchorInfoForX: x y: y
-
look for any anchor under the mouse pointer at x/y;
update infoLabel, if there is any
HRefHistoryEntry
ImageResolverQuery
|