|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Canvas
org.mozilla.jrex.ui.JRexCanvas
JRexCanvas is the browser component. This component wraps the nsWebBrowser and related interfaces of mozilla embedding. It allows listening to follwing events:
Nested Class Summary |
Nested classes inherited from class java.awt.Canvas |
Canvas.AccessibleAWTCanvas |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
protected |
JRexCanvas(boolean doRrealize,
int waitKey)
Constructor to create JRexCanvas. |
Method Summary | |
static void |
abortBrowserCreation(int waitKey)
This function is used to discard a window creation request from embedding engine. |
void |
addContextMenuListener(ContextMenuListener contextMenuListener)
Adds the specified ContextMenu listener to receive ContextMenu events from this component. |
void |
addHistoryListener(HistoryListener historyListener)
Adds the specified History listener to receive History events from this component. |
void |
addKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component. |
void |
addKeyListenerInternal()
|
void |
addMouseListener(MouseListener l)
Adds the specified mouse listener to receive mouse events from this component. |
void |
addMouseListenerInternal()
|
void |
addMouseMotionListener(MouseMotionListener l)
Adds the specified mouse motion listener to receive mouse motion events from this component. |
void |
addMouseMotionListenerInternal()
|
void |
addNotify()
Creates the peer of the JRexCanvas. |
void |
addProgressListener(ProgressListener progressListener)
Adds the specified progress listener to receive progress events from this component. |
void |
addURIContentListener(URIContentListener uriContentListener)
Adds the specified URIContent listener to receive URIContent events from this component. |
void |
browserRealized()
Invoked to indicate that browser peer has completed realization. |
void |
cancelPrint()
Invoked to cancel an ongoing print request. |
void |
cancelPrintPreview()
Invoked to cancel an print preview. |
boolean |
canCopy()
Indicates whether an copy operation can be done. |
boolean |
canCopyImageContents()
Indicates whether an copy ImageContents operation can be done. |
boolean |
canCopyImageLocation()
Indicates whether an copy Imagelocation operation can be done. |
boolean |
canCopyLinkLocation()
Indicates whether an copy linklocation operation can be done. |
boolean |
canCut()
Indicates whether an cut operation can be done. |
boolean |
canDelete()
Indicates whether an Delete operation can be done. |
boolean |
canPaste()
Indicates whether an Paste operation can be done. |
boolean |
canRedo()
Indicates whether an redo operation can be done. |
boolean |
canUndo()
Indicates whether an undo operation can be done. |
void |
copy()
Invoked to copy selected text. |
void |
copyImageContents()
Invoked to copy ImageContents. |
void |
copyImageLocation()
Invoked to copy selected ImageLocation. |
void |
copyLinkLocation()
Invoked to copy selected LinkLocation. |
static JRexCanvas |
createBrowserComponent(boolean doRrealize)
Use this function to create a JRexCanvas. |
static JRexCanvas |
createBrowserComponent(boolean doRrealize,
int waitKey)
Use this function to create a JRexCanvas. |
void |
cut()
Invoked to cut selected text. |
void |
delete()
Invoked to delete selected text. |
void |
find()
Invoked to find a given text. |
void |
findAgain()
Invoked to repeat previous find. |
Rectangle |
getBounds()
Gets the bounds of this component in the form of a Rectangle object. |
ContextMenuListener[] |
getContextMenuListeners()
Returns an array of all the ContextMenu listeners registered on this component. |
HistoryListener[] |
getHistoryListeners()
Returns an array of all the History listeners registered on this component. |
int |
getJRexPeer()
Return peer component associated with JRexCanvas. |
String |
getJRexWindowTitle()
Gets the JRex Window Title. |
Dimension |
getMinimumSize()
Gets the mininimum size of this component. |
WebNavigation |
getNavigator()
Returns the navigator assocaiated with the browser component. |
Dimension |
getPreferredSize()
Gets the preferred size of this component. |
int |
getPrintPreviewNumPages()
Gets the number of print preview pages. |
ProgressListener[] |
getProgressListeners()
Returns an array of all the progress listeners registered on this component. |
Dimension |
getSize()
Returns the size of this object in the form of a Dimension object. |
boolean |
isEnabled()
Determines whether this component is enabled. |
boolean |
isPrinting()
Indicates whether a print is under progress. |
boolean |
isPrintPreviewing()
Indicates whether a print preview is under progress. |
boolean |
isVisible()
Determines whether this component should be visible when its parent is visible. |
void |
pageSetup()
Invoked to do print PageSetup. |
void |
paint(Graphics g)
Paints the JRexCanvas by signalling Repaint to the peer component. |
void |
paste()
Invoked to paste text from clipboard. |
void |
print(boolean prompt,
boolean showProgress)
Invoked to print the current page shown by the browser |
void |
printPreview(boolean shrinkToFit,
boolean isLandScape)
Invoked to Preview the current page shown by the browser |
void |
printPreviewNavigate(int navType,
int pageNum)
Invoked to nagivate in print preview mode. |
void |
processContextMenuEvent(ContextMenuEvent ce)
Processes ContextMenu events occurring on this browser by dispatching them to any registered ContextMenuListener objects. |
protected void |
processFocusEvent(FocusEvent fe)
Processes focus events occurring on this component by dispatching them to native peer. |
Boolean |
processHistoryEvent(HistoryEvent he)
Processes history events occurring on this browser by dispatching them to any registered HistoryListener objects. |
void |
processProgressEvent(ProgressEvent pe)
Processes progress events occurring on this browser by dispatching them to any registered ProgressListener objects. |
void |
processTooltipEvent(TooltipEvent tte)
|
Object |
processURIContentEvent(URIContentEvent uce)
Processes URIContent events occurring on this browser by dispatching them to registered URIContentListener object. |
void |
redo()
Invoked to redo an edit operation. |
void |
removeContextMenuListener(ContextMenuListener contextMenuListener)
Removes the specified ContextMenu listener so that it no longer receives ContextMenu events from this component. |
void |
removeHistoryListener(HistoryListener historyListener)
Removes the specified History listener so that it no longer receives History events from this component. |
void |
removeKeyListener(KeyListener l)
Removes the specified key listener so that it no longer receives key events from this component. |
void |
removeMouseListener(MouseListener l)
Removes the specified mouse listener so that it no longer receives mouse events from this component. |
void |
removeMouseMotionListener(MouseMotionListener l)
Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component. |
void |
removeNotify()
Destroys the peer of the JRexCanvas. |
void |
removeProgressListener(ProgressListener progressListener)
Removes the specified progress listener so that it no longer receives progress events from this component. |
void |
removeURIContentListener()
Removes the URIContent listener so that it no longer receives URIContent events from this component. |
void |
selectAll()
Invoked to select all text in an control. |
void |
selectNone()
Invoked to clear all selection in an control. |
void |
setBounds(int x,
int y,
int width,
int height)
Moves and resizes this component. |
void |
setEnabled(boolean enable)
Enables or disables this component, depending on the value of the parameter enable . |
void |
setJRexWindowTitle(String title)
Sets the JRex Window Title. |
void |
setVisible(boolean visible)
Sets the visible state of the JRexCanvas. |
void |
undo()
Invoked to undo an edit operation. |
void |
update(Graphics g)
Simply calls paint function. |
Methods inherited from class java.awt.Canvas |
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected JRexCanvas(boolean doRrealize, int waitKey)
doRrealize
- true
indicates that peer will be realized from java.waitKey
- The unique-id associated with JRexCanvas creation.
this is used by WindowManager.Method Detail |
public static JRexCanvas createBrowserComponent(boolean doRrealize)
doRrealize
- true
to realize peer from java.public static JRexCanvas createBrowserComponent(boolean doRrealize, int waitKey)
doRrealize
- true
to realize peer from java.
Note:- doRrealize should be false
for WindowCreation
request from embedding engine to avoid deadlock(Perticluarly when dealing with modal dialogs).waitKey
- The unique-id associated with JRexCanvas creation.
this is used by WindowManager.public int getJRexPeer()
public void addNotify()
true
the native component
is realized and made visible.
This function is also used to associate the JRex peer with java canvas peer in windows platform.
Canvas.addNotify()
public static void abortBrowserCreation(int waitKey)
waitKey
This function is intended to be used by WindowManager.
public void browserRealized()
protected void processFocusEvent(FocusEvent fe)
Component.processFocusEvent(FocusEvent)
public void paint(Graphics g)
g
- the specified Graphics contextComponent.paint(Graphics)
public void update(Graphics g)
g
- the specified Graphics contextpaint(Graphics)
public void removeNotify()
Component.removeNotify()
public void setVisible(boolean visible)
visible
- if true, shows this JRexCanvas peer; otherwise, hides itpublic boolean isVisible()
setVisible(boolean)
public void setEnabled(boolean enable)
enable
.
public boolean isEnabled()
setEnabled(boolean)
public void setBounds(int x, int y, int width, int height)
x
and y
, and the
new size is specified by width
and height
.
x
- the new x-coordinate of this componenty
- the new y-coordinate of this componentwidth
- the new width
of this componentheight
- the new height
of this
componentgetBounds()
public Rectangle getBounds()
Rectangle
object. The bounds specify this
component's width, height, and location relative to
its parent.
setBounds(int, int, int, int)
public Dimension getMinimumSize()
getSize()
,
LayoutManager
public Dimension getSize()
Dimension
object. The height field of the
Dimension
object contains this objects's
height, and the width field of the Dimension
object contains this object's width.
Dimension
object that indicates
the size of this component; null
if
this object is not on the screenpublic Dimension getPreferredSize()
getSize()
public String getJRexWindowTitle()
setJRexWindowTitle(java.lang.String)
public void setJRexWindowTitle(String title)
title
- the tittle to be associated with the browser componentgetJRexWindowTitle()
public WebNavigation getNavigator()
public void addKeyListenerInternal()
public void addKeyListener(KeyListener l)
l
is null
,
no exception is thrown and no action is performed.
l
- the key listener.KeyEvent
,
KeyListener
,
removeKeyListener(java.awt.event.KeyListener)
,
Component.getKeyListeners()
public void addMouseListenerInternal()
public void addMouseListener(MouseListener l)
l
is null
,
no exception is thrown and no action is performed.
l
- the mouse listenerMouseEvent
,
MouseListener
,
removeMouseListener(java.awt.event.MouseListener)
,
Component.getMouseListeners()
public void addMouseMotionListenerInternal()
public void addMouseMotionListener(MouseMotionListener l)
l
is null
,
no exception is thrown and no action is performed.
l
- the mouse motion listenerMouseEvent
,
MouseMotionListener
,
removeMouseMotionListener(java.awt.event.MouseMotionListener)
,
Component.getMouseMotionListeners()
public void addProgressListener(ProgressListener progressListener)
progressListener
is null
,
no exception is thrown and no action is performed.
progressListener
- the Progress listenerProgressEvent
,
removeProgressListener(org.mozilla.jrex.event.progress.ProgressListener)
,
getProgressListeners()
public ProgressListener[] getProgressListeners()
ProgressListener
s
or an empty array if no progress
listeners are currently registeredaddProgressListener(org.mozilla.jrex.event.progress.ProgressListener)
,
removeProgressListener(org.mozilla.jrex.event.progress.ProgressListener)
public void addContextMenuListener(ContextMenuListener contextMenuListener)
contextMenuListener
is null
,
no exception is thrown and no action is performed.
contextMenuListener
- the ContextMenu listenerContextMenuEvent
,
removeContextMenuListener(org.mozilla.jrex.event.context.ContextMenuListener)
,
getContextMenuListeners()
public ContextMenuListener[] getContextMenuListeners()
ContextMenuListener
s
or an empty array if no ContextMenu
listeners are currently registeredaddContextMenuListener(org.mozilla.jrex.event.context.ContextMenuListener)
,
removeContextMenuListener(org.mozilla.jrex.event.context.ContextMenuListener)
public void addHistoryListener(HistoryListener historyListener)
historyListener
is null
,
no exception is thrown and no action is performed.
historyListener
- the History listenerHistoryEvent
,
removeHistoryListener(org.mozilla.jrex.event.history.HistoryListener)
,
getHistoryListeners()
public HistoryListener[] getHistoryListeners()
HistoryListener
s
or an empty array if no History
listeners are currently registeredaddHistoryListener(org.mozilla.jrex.event.history.HistoryListener)
,
removeHistoryListener(org.mozilla.jrex.event.history.HistoryListener)
public void addURIContentListener(URIContentListener uriContentListener)
uriContentListener
is null
,
no exception is thrown and no action is performed.
If listener was already added the uriContentListener
will relace it.
uriContentListener
- the URIContent listenerURIContentEvent
,
removeURIContentListener()
public void removeKeyListener(KeyListener l)
l
is null
,
no exception is thrown and no action is performed.
If list of KeyListeners is empty, native peer is requested to remove the KeyListener.
l
- the key listenerKeyEvent
,
KeyListener
,
addKeyListener(java.awt.event.KeyListener)
,
Component.getKeyListeners()
public void removeMouseListener(MouseListener l)
l
is null
,
no exception is thrown and no action is performed.
If list of MouseListener is empty, native peer is requested to remove the MouseListener.
l
- the mouse listenerMouseEvent
,
MouseListener
,
addMouseListener(java.awt.event.MouseListener)
,
Component.getMouseListeners()
public void removeMouseMotionListener(MouseMotionListener l)
l
is null
,
no exception is thrown and no action is performed.
If list of MouseMotionListener is empty, native peer is requested to remove the MouseMotionListener.
l
- the mouse motion listenerMouseEvent
,
MouseMotionListener
,
addMouseMotionListener(java.awt.event.MouseMotionListener)
,
Component.getMouseMotionListeners()
public void removeProgressListener(ProgressListener progressListener)
progressListener
is null
,
no exception is thrown and no action is performed.
If list of ProgressListener is empty, native peer is requested to remove the ProgressListener.
progressListener
- the progress listenerProgressEvent
,
addProgressListener(org.mozilla.jrex.event.progress.ProgressListener)
,
getProgressListeners()
public void removeContextMenuListener(ContextMenuListener contextMenuListener)
contextMenuListener
is null
,
no exception is thrown and no action is performed.
If list of ContextMenuListener is empty, native peer is requested to remove the ContextMenuListener.
contextMenuListener
- the ContextMenu listenerContextMenuEvent
,
addContextMenuListener(org.mozilla.jrex.event.context.ContextMenuListener)
,
getContextMenuListeners()
public void removeHistoryListener(HistoryListener historyListener)
historyListener
is null
,
no exception is thrown and no action is performed.
If list of HistoryListener is empty, native peer is requested to remove the HistoryListener.
historyListener
- the History listenerHistoryEvent
,
addHistoryListener(org.mozilla.jrex.event.history.HistoryListener)
,
getHistoryListeners()
public void removeURIContentListener()
URIContentEvent
,
addURIContentListener(org.mozilla.jrex.event.uricontent.URIContentListener)
public void processProgressEvent(ProgressEvent pe)
ProgressListener
objects.
This method is not called unless progress events are
enabled for this browser. Progress events are enabled
when an ProgressListener
object is registered
via addProgressListener
.
pe
- the Progress eventProgressListener
public void processContextMenuEvent(ContextMenuEvent ce)
ContextMenuListener
objects.
This method is not called unless ContextMenu events are
enabled for this browser. ContextMenu events are enabled
when an ContextMenuListener
object is registered
via addContextMenuListener
.
ce
- the ContextMenu eventContextMenuListener
public Boolean processHistoryEvent(HistoryEvent he)
HistoryListener
objects.
This method is not called unless history events are
enabled for this browser. History events are enabled
when an HistoryListener
object is registered
via addHistoryListener
.
he
- the History event
HistoryListener
public Object processURIContentEvent(URIContentEvent uce)
URIContentListener
object.
This method is not called unless URIContent events are
enabled for this browser. URIContent events are enabled
when an URIContentListener
object is registered
via addURIContentListener
.
uce
- the URIContent eventURIContentListener
public void processTooltipEvent(TooltipEvent tte)
public void print(boolean prompt, boolean showProgress) throws JRexException
prompt
- If true
system will prompt with print dialog.showProgress
- If true
print progress dialog is shown.
JRexException
public void cancelPrint() throws JRexException
JRexException
isPrinting()
public boolean isPrinting() throws JRexException
JRexException
cancelPrint()
,
print(boolean, boolean)
public void printPreview(boolean shrinkToFit, boolean isLandScape) throws JRexException
shrinkToFit
- If true
Preview will shrink to fit to the browser component view.isLandScape
- If true
Preview will be in LandScape view.
JRexException
print(boolean, boolean)
public void cancelPrintPreview() throws JRexException
JRexException
isPrintPreviewing()
public boolean isPrintPreviewing() throws JRexException
JRexException
cancelPrintPreview()
,
printPreview(boolean, boolean)
public int getPrintPreviewNumPages() throws JRexException
JRexException
printPreview(boolean, boolean)
public void printPreviewNavigate(int navType, int pageNum) throws JRexException
navType
- the type of navigation to perform.pageNum
- the page number to navigate to.
JRexException
see PrintPreview Navigation Constants Above.
public void pageSetup() throws JRexException
JRexException
print(boolean, boolean)
public boolean canUndo() throws JRexException
JRexException
undo()
public boolean canRedo() throws JRexException
JRexException
redo()
public boolean canCut() throws JRexException
JRexException
cut()
public boolean canCopy() throws JRexException
JRexException
copy()
public boolean canCopyLinkLocation() throws JRexException
JRexException
copyLinkLocation()
public boolean canCopyImageLocation() throws JRexException
JRexException
copyImageLocation()
public boolean canCopyImageContents() throws JRexException
JRexException
copyImageContents()
public boolean canPaste() throws JRexException
JRexException
paste()
public boolean canDelete() throws JRexException
JRexException
delete()
public void undo() throws JRexException
JRexException
public void redo() throws JRexException
JRexException
public void cut() throws JRexException
JRexException
public void copy() throws JRexException
JRexException
public void copyLinkLocation() throws JRexException
JRexException
public void copyImageLocation() throws JRexException
JRexException
public void copyImageContents() throws JRexException
JRexException
public void paste() throws JRexException
JRexException
public void selectAll() throws JRexException
JRexException
public void selectNone() throws JRexException
JRexException
public void delete() throws JRexException
JRexException
public void find() throws JRexException
JRexException
public void findAgain() throws JRexException
JRexException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |