|
Class: HTMLDocumentFrame
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--HTMLDocumentFrame
|
+--HTMLDocumentView
- Package:
- stx:libhtml
- Category:
- System-Documentation
- Version:
- rev:
1.284
date: 2024/03/14 12:04:37
- user: stefan
- file: HTMLDocumentFrame.st directory: libhtml
- module: stx stc-classLibrary: libhtml
displays HTML documents.
copyrightCOPYRIGHT (c) 1995 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
accessing
-
documentSearchPathes
-
DocumentSearchPathes := nil
-
documentSearchPathesAdd: something
-
add path without language to search path for html documents
-
fileResolverQuery
-
return the query which, when answered, will provide a file resolver
-
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'
|
image specs
-
image_internal_broken
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self image_internal_broken inspect
ImageEditor openOnClass:self andSelector:#image_internal_broken
Icon flushCachedIcons
|
-
image_internal_gopher_binary
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self image_internal_gopher_binary inspect
ImageEditor openOnClass:self andSelector:#image_internal_gopher_binary
Icon flushCachedIcons
|
-
image_internal_gopher_image
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self image_internal_gopher_image inspect
ImageEditor openOnClass:self andSelector:#image_internal_gopher_image
Icon flushCachedIcons
|
-
image_internal_gopher_sound
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self image_internal_gopher_sound inspect
ImageEditor openOnClass:self andSelector:#image_internal_gopher_sound
Icon flushCachedIcons
|
-
image_internal_gopher_text
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self image_internal_gopher_text inspect
ImageEditor openOnClass:self andSelector:#image_internal_gopher_text
Icon flushCachedIcons
|
-
image_internal_gopher_text_index
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self image_internal_gopher_text_index inspect
ImageEditor openOnClass:self andSelector:#image_internal_gopher_text_index
Icon flushCachedIcons
|
-
image_internal_gopher_unknown
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self image_internal_gopher_unknown inspect
ImageEditor openOnClass:self andSelector:#image_internal_gopher_unknown
Icon flushCachedIcons
|
initialization
-
fileExecutorTable
-
-
fileExtensionTable
-
-
initialize
-
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
|
-
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
-
currentDocumentAndAnchor
-
return the current document plus any local anchor, if we are positioned on one;
returns something like foo#bla
-
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
-
(comment from inherited method)
Set the model.
Here, if I am my own menuPerformer/menuHolder,
set the menuHolder and menuPerformer to the model.
This is a compatibility kludge,
since typically, ST-80 code expects the model to provide a menu
and perform it. If the model does not support a menu message,
it will be forwarded to the view.
Those apps which want the view to provide the (default) menu have to reset
this by sending #menuHolder: message (again)
-
painter
-
the instance of HTMLDocumentPainter, which renders the document
-
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
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
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
-
-
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.
If it returns false, the normal anchor processing takes place.
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
-
contents: htmlText
-
added for compatibility with normal text views
-
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 browse-action link
<A action='browse: <class> >> <selector>'
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: url file: file method: method remember: rem source: source
-
visitedActions isNil ifTrue:[
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
-
(comment from inherited method)
to be redefined in subclasses
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
-
form values
-
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
-
changeScaleForMouseWheelZoom: amount
-
self menu_reload.
-
keyPress: key x: x y: y
-
(key == #InspectIt) ifTrue:[self inspect].
-
keyboardZoom: largerBoolean
-
ALT+/- (was: CTRL+/-) action.
ignored here - redefined in views which can zoom
-
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 from: oldExtentOrNil
-
my view has changed the size (not the contents)
help
-
helpTextAt: aPoint
-
super helpTextAt:aPoint
initialization & release
-
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
-
release
-
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 a pseudo document showing the directory listing
-
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 (wrap into <pre><code>...</code></pre>)
-
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 a pseudo document showing an HTML string
-
pseudoDocumentStreamOnString: aString headLine: headLine title: title
-
create a pseudo document showing a string
-
pseudoDocumentStreamOnString: aString title: title
-
create a pseudo document showing a string (i.e. wrap it into <pre>...</pre>)
menu & actions
-
clickedExampleTextOrNil
-
forget any emphasis
-
copyExampleText
-
-
copyHTMLToClipboard
-
-
copyLink
-
-
copyTextToClipboard
-
-
editImage
-
-
editMenu
-
return an appropriate popUpMenu.
check if pointer is over:
an example - offer copy-example <A type='example'>...</a>
an image - offer inspect-image
a href - offer open-new-browser
-
editThisDocument
-
-
executeAndInspectExampleText
-
-
executeExampleText
-
-
getDocumentHTML
-
return the current document's HTML text as one (possibly big) string
-
inspectImage
-
-
openNewOnAnchor
-
does not work yet
-
saveImage
-
-
showImageInFileBrowser
-
not unloadable
-
terminalOnExampleText
-
-
workspaceOnExampleText
-
initialSyntax:nil. -- not a good idea; most examples are smalltalk
misc
-
ampersandBindings
-
self new ampersandBindings
-
backToPreviousDocument
-
Transcript showCR:historyEntry printString.
-
elementAt: aPoint
-
-
fontEncodingFor: encodingSymbol
-
-
getVerticalPosition
-
-
isValidMethod: methodString
-
-
positionOnAnchor: aLocalAnchor
-
not yet visible - remember to position later
-
positionTo: aPoint
-
-
showEmpty: documentName
-
-
showNotFound: aFileName
-
-
startImageFlushProcess
-
start a bg process which flushes cached images after 5 minutes
queries
-
documentTitle
-
-
extentOfContents
-
-
heightForLines: numberOfLines
-
return the height of the receiver, if numberOfLines are to be displayed
-
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).
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.
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
FileResolverQuery
HRefHistoryEntry
ImageResolverQuery
|