public class HtmlViewer extends AppForm
The
Modifier and Type | Class and Description |
---|---|
protected class |
HtmlViewer.HtmlViewerDisplay |
Form.FormMaker, Form.ToolsOrSoftKey, Form.ValidateBeforeExit
Modifier and Type | Field and Description |
---|---|
boolean |
animatedImages
Specifies if animated images should be allowed - true on some systems by default.
|
TextCodec |
codec
This is the codec that will be used to decode text.
|
static int |
DISPLAY_NO_OPEN
A display option for the constructor.
|
static int |
DISPLAY_NO_STATUS_BAR
A display option for the constructor.
|
static int |
DISPLAY_NO_TABS
A display option for the constructor.
|
static int |
DISPLAY_NO_TOOL_BUTTONS
A display option for the constructor.
|
FontChooser |
fontChooser |
PropertyList |
htmlProperties |
static String[] |
images |
protected Handle |
loading |
protected ProgressDisplay |
progress |
boolean |
showImages
Specifies if images should be displayed - true by default.
|
String |
status |
protected CardPanel |
statusCard |
protected Control |
stopButton |
chosenMenuItem, data, isAutoExpandingTabs, menus, SHOW_EXIT_BUTTON, SHOW_NEW_BUTTON, SHOW_OPEN_BUTTON, SHOW_SAVE_AS_BUTTON, SHOW_SAVE_BUTTON, tabs, tools
autoRefreshControls, coroutineStackSize, currentEvent, DoDataTransfer, dontAddSoftkeysAsActions, fieldListeners, fieldsWillNotBeAdded, myObject, objectClass, sampleObject, transferOnAdding, transfers
acceptsDroppedFiles, apply, back, buttons, BUTTONS_TO_SOFT_KEY_FIRST_BUTTON_SEPARATE, BUTTONS_TO_SOFT_KEY_MENU_ALWAYS, BUTTONS_TO_SOFT_KEY_USE_FIRST_SOFT_KEY, buttonsPanel, buttonsPerRow, cancel, CLOSING_FLAG, deflt, dismantleOnClose, dontAddSIPFiller, exitButtonDefined, EXITING_FLAG, exitSystemOnClose, exitValue, firstFocus, formFrame, frameAlpha, handle, hasTitle, hasTopBar, hideSoftKeyBarIfNotFound, inheritSoftKeys, isAutoScrolling, isMainAppletForm, keepFrame, minimumShowTime, moveable, no, noBorder, ok, pl, reset, resizable, resizeOnSIP, shadowed, SHOWN_FLAG, shownTime, softkeyBars, title, titleCancel, titleControls, titleOK, topControls, WINDOW_TITLE_DONT_CHANGE, windowFlagsToClear, windowFlagsToSet, windowIcon, windowTitle, yes
BACKB, CANCELB, checkIcon, close, cross, crossIcon, DEFCANCELB, DEFOKB, EXIT_IDBACK, EXIT_IDCANCEL, EXIT_IDNO, EXIT_IDOK, EXIT_IDYES, IDBACK, IDCANCEL, IDNO, IDOK, IDYES, MBB, MBNONE, MBOK, MBOKCANCEL, MBYESNO, MBYESNOCANCEL, NOB, OKB, stop, tick, YESB
autoSpan, layout, mySplitter, nextSplitter, quickRecalculate
all, calculated, childListeners, defaultAddToMeCellConstraints, defaultTags, equalHeights, equalWidths, grid, lastAdded, layoutManager, made, noInsets, stretchFirstColumn, stretchFirstRow, stretchLastColumn, stretchLastRow, titleGap
isFullScrollClient, origin, scrollPercent, virtualSize
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren, FIND_FOR_MOUSE_PRESS, takeNextFocus
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, parent, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
GoHigher, GoLower, Horizontal, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
KEEP_VISIBLE
Constructor and Description |
---|
HtmlViewer()
Create the viewer with full tools.
|
HtmlViewer(HtmlDisplay display,
int displayOptions)
Create the viewer with a particular HtmlDisplay and using the specified display options.
|
HtmlViewer(int displayOptions)
Create the viewer the specified display options.
|
Modifier and Type | Method and Description |
---|---|
void |
action(String fieldName,
Editor ed)
This gets called by action(FieldTransfer ft,Editor ed) and by fieldChanged(FieldTransfer ft,Editor ed)
if the field changed is a menu item.
|
protected void |
addPropertiesTo(PropertyList pl) |
FormattedTextMaker |
cacheOpened(String name,
FormattedTextMaker maker) |
void |
cancelLoading(boolean startingNewLoad)
Use this to cancel a load/decode operation.
|
protected HtmlDisplay |
createDisplay() |
Handle |
doOpen(String fileOrUrl)
Open the file relative to the current document root, or as a new document/file.
|
protected void |
endedLoad(Handle h) |
void |
fieldChanged(String fieldName,
Editor ed)
This gets called by fieldChanged(FieldTransfer ft,Editor ed).
|
void |
filesDropped(String[] fileName)
This is called when files are dropped on the Form and acceptsDroppedFiles is true.
|
FormattedTextMaker |
findCached(String name) |
TextCodec |
getCodec(PropertyList pl)
Get a codec to decode a Web document.
|
String |
getCurrentURL() |
void |
goBack()
Go to previous document/location.
|
protected boolean |
hotspotPressed(HotSpot hs,
Point where) |
static void |
main(String[] args) |
protected void |
newDocumentLoaded(String url) |
protected void |
noLoading() |
void |
open()
Open a new file.
|
void |
open(FormattedTextMaker maker) |
FormattedTextMaker |
open(String name) |
FormattedTextMaker |
open(String data,
String fileName) |
static HtmlViewer |
openAndDisplay(String url,
int displayOptions,
boolean execute) |
protected Handle |
openDocument(String url,
PropertyList pl) |
void |
reload()
Reload the current document.
|
void |
removeCached(String name) |
void |
setDisplayFont(Font f)
Set the display font.
|
void |
setHtml(FormattedTextMaker html) |
Handle |
setHtml(Link link)
Tell the viewer to load and display the Link.
|
Handle |
setHtml(Object htmlText,
String urlToDisplay,
String bookmark)
Set the Html text directly.
|
FormattedTextMaker |
setHtml(String html,
PropertyList props,
Handle h) |
Handle |
setHtml(URL url)
Tell the viewer to load and display the URL.
|
void |
setupProperties()
Setup the htmlProperties based on selected options.
|
protected void |
startingLoad(Handle h) |
protected String |
toFullURL(String root,
String document)
This returns a String ONLY if the String is the name of a VALID URL resource.
|
void |
update() |
addExpandingTool, addExpandingTool, addStandardFileMenu, addStandardFileMenu, addStandardFileMenu, addToolButton, addToolButton, getStandardFileCommands, setupStandardFileCommands, setupStandardFileCommands
action, addButtonAsAction, addExternalField, addExternalField, addField, addField, addField, addField, addMenuAsAction, addMenuItemAsAction, addSoftKeysAsActions, badField, canExit, changeField, convertData, dataChanged, dataChanged, dataObjectIsCompatible, dismantle, enableScrolling, fieldChanged, fieldEvent, findControlFor, findControlFor, findFields, findFieldTransfer, findFieldTransfer, findFieldTransfer, fireAction, fireFieldChanged, fireFieldEvent, fireFieldEvent, focusOn, formClosing, fromControls, fromControls, fromControls, fromControls, getData, getDataControls, getDataParentObject, getEditedObject, getEditedUnder, getEditorAndFieldValue, getFieldValue, getFieldValue, getProperty, getProperty, handleException, handleTransferError, invokeFieldHandlerMethod, make, modifyControl, modifyFields, modifyPropertiesOrFields, onControlEvent, onDataChangeEvent, onSoftKey, pauseCurrentEventThread, pauseThisEventThread, postEditorEvent, postEditorEvent, removeField, resumeCurrentEventThread, resumeThisEventThread, setData, setDataControls, setEditedObject, setFields, setFields, setObject, setProperty, shown, takeFieldFrom, toControls, toControls, toControls, toControls, transfer, transfer
_getSetField, addButton, addFieldHandler, addFormMaker, addSIPAdjustment, addTabbedPanel, addToolbar, addTools, addToolsFor, addValidateBeforeExit, addValidateBeforeExit, buttonsToMenu, buttonsToSoftKeyBar, buttonsToSoftKeyBar, cancelWait, checkButtons, checkCanExit, close, closeAll, closeForTransfer, closeForTransfer, continueWait, createMenuItem, createMenuItem, createMenuItem, createSipFiller, createWindow, defaultTitleTo, doButtons, doShowExec, enableScrolling, exec, exec, exec, exec, exec, execute, execute, execute, exit, fixWindowTitle, formMain, fromFields, fromFields, fullScreenOnPDA, gatherButtons, getAncestorProperty, getButton, getFileSaver, getFormFrame, getFormWithProperty, getProperties, getSoftKeyBarFor, getTopmostForm, handleAction, handleAction, hasExitButton, makeButtonForForm, makeButtonForForm, makeDefaultButton, makeDefaultButton, makeFrame, makeMenuItemForForm, makeMenuItemForForm, makeSmall, makeSmallOnBigScreen, makeSoftKeys, makeSoftKeys, makeSoftKeys, maximizeOnPDA, menuItemSelected, modifyForSmartPhone, onEvent, onSoftKey, placeCancelOnLeft, removeSoftKeyBarFor, setAsMainAppletForm, setAsShown, setBelowButtonBar, setBelowButtonBars, setDefaultSize, setExitHandle, setFileSaver, setMainScrollBarPanel, setNoTitleBar, setSoftKeyBarFor, setSoftKeyBarForAll, setupFrame, show, show, showButtons, showExecCalled, showWait, showWait, startRunning, stopFormHandle, takeButtons, takeButtons, takeButtons, toFields, toFields, toolsOnBottom, validateBeforeExit, waitUntilClosed, waitUntilClosed, waitUntilClosed, waitUntilShown, willBeMaximized
getCross, getParentObject, getParentObject, getSizedImage, getTick, getToolsIcon, setParentObject
calculateSizes, getFloatingControls, getSubControls, hasFloatingControls, makeLayoutGrid, relayoutMe, removeAll, reShow, resize, resizeTo
add, addChildListener, addDirectly, addLast, addLast, addLast, addNext, addNext, addNext, addNext, calculatedSizes, doBorder, endRow, getControlTag, getPreferredSize, insertRow, isEmpty, layout, remove, removeChildListener, sendToChildListeners, setAsBelowSip, setText
canGo, canScreenScroll, checkScrolls, doScroll, fixOrigin, getActual, getBuffer, getCurrent, getDisplayedSize, getMyHeight, getMySize, getMyWidth, getPercent, getScrollablePanel, getScrollClient, getVisible, getVisibleArea, needScrollBar, onScroll, onSetOrigin, reduceClip, scroll, scroll, scrollToVisible, setOrigin, updateScrollServer
add, completeAddPopupControl, containerHasFocus, dismantle, doHotKey, doPaint, findChild, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getFirstFocus, getNextKeyFocus, gotFocus, grayOut, hide, lostFocus, relayout, removePopupControl, repaintDataNow, setHidden, startAddPopupControl, takeFocus, takePromptControl, unhide
acceptsData, activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doMenu, dontAcceptDrop, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getFontMetricsForSizeCalculations, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHeight, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWidth, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onKeyEvent, onLabelPenEvent, onPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, refresh, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setTextSize, setTiledBackgroundImage, setToolTip, showHoldDownIndicator, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateData, updateDCDuringDD, updateFrom, updateTo, verifyWantDrag, verifyWantHoldDown, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getServer, setServer
public PropertyList htmlProperties
public FontChooser fontChooser
public boolean showImages
public boolean animatedImages
public static final int DISPLAY_NO_STATUS_BAR
public static final int DISPLAY_NO_TOOL_BUTTONS
public static final int DISPLAY_NO_TABS
public static final int DISPLAY_NO_OPEN
public String status
protected ProgressDisplay progress
protected Control stopButton
protected CardPanel statusCard
public TextCodec codec
protected Handle loading
public static String[] images
public HtmlViewer()
displayOptions
- This can be any of the : DISPLAY_XXX options ORed together.public HtmlViewer(int displayOptions)
displayOptions
- This can be any of the : DISPLAY_XXX options ORed together.public HtmlViewer(HtmlDisplay display, int displayOptions)
display
- An HtmlDisplay to use (can be null).displayOptions
- This can be any of: DISPLAY_NO_STATUS_BAR, DISPLAY_NO_TOOL_BUTTONS, DISPLAY_NO_TABS OR'ed together.public TextCodec getCodec(PropertyList pl)
pl
- the properties for the document.protected String toFullURL(String root, String document)
root
- The current document root.document
- The document being referred to.protected Handle openDocument(String url, PropertyList pl)
protected void noLoading()
protected void startingLoad(Handle h)
protected void endedLoad(Handle h)
public String getCurrentURL()
protected void newDocumentLoaded(String url)
public Handle setHtml(URL url)
url
- The url which can be an http:// url or a file name. It can also be relative to
the current document.public Handle setHtml(Link link)
link
- The link which can be an "http://" url or a file name. It can also be relative to
the current document.public Handle setHtml(Object htmlText, String urlToDisplay, String bookmark)
htmlText
- An object representing htmlText. This can be:
urlToDisplay
- The URL to display for the data.bookmark
- An optional bookmark in the file to go to.public void setupProperties()
public void cancelLoading(boolean startingNewLoad)
public Handle doOpen(String fileOrUrl)
fileOrUrl.
- protected HtmlDisplay createDisplay()
public void setHtml(FormattedTextMaker html)
public FormattedTextMaker setHtml(String html, PropertyList props, Handle h)
protected void addPropertiesTo(PropertyList pl)
public FormattedTextMaker open(String data, String fileName)
public void open(FormattedTextMaker maker)
public FormattedTextMaker findCached(String name)
public FormattedTextMaker cacheOpened(String name, FormattedTextMaker maker)
public void removeCached(String name)
public FormattedTextMaker open(String name)
public void action(String fieldName, Editor ed)
Editor
public void goBack()
public void open()
public void reload()
public void fieldChanged(String fieldName, Editor ed)
Editor
fieldChanged
in class Editor
public void update()
public void filesDropped(String[] fileName)
Form
filesDropped
in class Form
fileName
- the list of fileNames dropped.public void setDisplayFont(Font f)
public static HtmlViewer openAndDisplay(String url, int displayOptions, boolean execute)
public static void main(String[] args)