|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.browser.Browser
Instances of this class implement the browser user interface metaphor. It allows the user to visualize and navigate through HTML documents.
Note that although this class is a subclass of Composite
,
it does not make sense to set a layout on it.
IMPORTANT: This class is not intended to be subclassed.
Field Summary |
---|
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
Browser(Composite parent,
int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
---|---|
void |
addCloseWindowListener(CloseWindowListener listener)
Adds the listener to the collection of listeners who will be notified when the window hosting the receiver should be closed. |
void |
addLocationListener(LocationListener listener)
Adds the listener to the collection of listeners who will be notified when the current location has changed or is about to change. |
void |
addOpenWindowListener(OpenWindowListener listener)
Adds the listener to the collection of listeners who will be notified when a new window needs to be created. |
void |
addProgressListener(ProgressListener listener)
Adds the listener to the collection of listeners who will be notified when a progress is made during the loading of the current URL or when the loading of the current URL has been completed. |
void |
addStatusTextListener(StatusTextListener listener)
Adds the listener to the collection of listeners who will be notified when the status text is changed. |
void |
addTitleListener(TitleListener listener)
Adds the listener to the collection of listeners who will be notified when the title of the current document is available or has changed. |
void |
addVisibilityWindowListener(VisibilityWindowListener listener)
Adds the listener to the collection of listeners who will be notified when a window hosting the receiver needs to be displayed or hidden. |
boolean |
back()
Navigate to the previous session history item. |
protected void |
checkSubclass()
Checks that this class can be subclassed. |
boolean |
execute(String script)
Execute the specified script. |
boolean |
forward()
Navigate to the next session history item. |
String |
getUrl()
Returns the current URL. |
boolean |
isBackEnabled()
Returns true if the receiver can navigate to the
previous session history item, and false otherwise. |
boolean |
isForwardEnabled()
Returns true if the receiver can navigate to the
next session history item, and false otherwise. |
void |
refresh()
Refresh the current page. |
void |
removeCloseWindowListener(CloseWindowListener listener)
Removes the listener from the collection of listeners who will be notified when the window hosting the receiver should be closed. |
void |
removeLocationListener(LocationListener listener)
Removes the listener from the collection of listeners who will be notified when the current location is changed or about to be changed. |
void |
removeOpenWindowListener(OpenWindowListener listener)
Removes the listener from the collection of listeners who will be notified when a new window needs to be created. |
void |
removeProgressListener(ProgressListener listener)
Removes the listener from the collection of listeners who will be notified when a progress is made during the loading of the current URL or when the loading of the current URL has been completed. |
void |
removeStatusTextListener(StatusTextListener listener)
Removes the listener from the collection of listeners who will be notified when the status text is changed. |
void |
removeTitleListener(TitleListener listener)
Removes the listener from the collection of listeners who will be notified when the title of the current document is available or has changed. |
void |
removeVisibilityWindowListener(VisibilityWindowListener listener)
Removes the listener from the collection of listeners who will be notified when a window hosting the receiver needs to be displayed or hidden. |
boolean |
setText(String html)
Renders HTML. |
boolean |
setUrl(String url)
Loads a URL. |
void |
stop()
Stop any loading and rendering activity. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, computeSize, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Browser(Composite parent, int style)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent
- a widget which will be the parent of the new instance (cannot be null)style
- the style of widget to construct
IllegalArgumentException
- SWTException
- SWTError
- Widget.getStyle()
Method Detail |
public void addCloseWindowListener(CloseWindowListener listener)
This notification occurs when a javascript command such as
window.close
gets executed by a Browser
.
listener
- the listener which should be notified
IllegalArgumentException
- SWTException
- public void addLocationListener(LocationListener listener)
This notification typically occurs when the application navigates
to a new location with setUrl(String)
or when the user
activates a hyperlink.
listener
- the listener which should be notified
IllegalArgumentException
- SWTException
- public void addOpenWindowListener(OpenWindowListener listener)
This notification occurs when a javascript command such as
window.open
gets executed by a Browser
.
listener
- the listener which should be notified
IllegalArgumentException
- SWTException
- public void addProgressListener(ProgressListener listener)
listener
- the listener which should be notified
IllegalArgumentException
- SWTException
- public void addStatusTextListener(StatusTextListener listener)
The status text is typically displayed in the status bar of a browser application.
listener
- the listener which should be notified
IllegalArgumentException
- SWTException
- public void addTitleListener(TitleListener listener)
listener
- the listener which should be notified
IllegalArgumentException
- SWTException
- public void addVisibilityWindowListener(VisibilityWindowListener listener)
listener
- the listener which should be notified
IllegalArgumentException
- SWTException
- public boolean back()
true
if the operation was successful and false
otherwise
SWTException
- forward()
protected void checkSubclass()
Widget
The SWT class library is intended to be subclassed
only at specific, controlled points (most notably,
Composite
and Canvas
when
implementing new widgets). This method enforces this
rule unless it is overridden.
IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
checkSubclass
in class Composite
public boolean execute(String script)
Execute a script containing javascript commands in the context of the current document.
script
- the script with javascript commands
true
if the operation was successful and false
otherwise
IllegalArgumentException
- SWTException
- public boolean forward()
true
if the operation was successful and false
otherwise
SWTException
- back()
public boolean isBackEnabled()
true
if the receiver can navigate to the
previous session history item, and false
otherwise.
SWTException
- back()
public boolean isForwardEnabled()
true
if the receiver can navigate to the
next session history item, and false
otherwise.
SWTException
- forward()
public String getUrl()
String
if there is no current URL
SWTException
- setUrl(java.lang.String)
public void refresh()
SWTException
- public void removeCloseWindowListener(CloseWindowListener listener)
listener
- the listener which should no longer be notified
IllegalArgumentException
- SWTException
- public void removeLocationListener(LocationListener listener)
listener
- the listener which should no longer be notified
IllegalArgumentException
- SWTException
- public void removeOpenWindowListener(OpenWindowListener listener)
listener
- the listener which should no longer be notified
IllegalArgumentException
- SWTException
- public void removeProgressListener(ProgressListener listener)
listener
- the listener which should no longer be notified
IllegalArgumentException
- SWTException
- public void removeStatusTextListener(StatusTextListener listener)
listener
- the listener which should no longer be notified
IllegalArgumentException
- SWTException
- public void removeTitleListener(TitleListener listener)
listener
- the listener which should no longer be notified
IllegalArgumentException
- SWTException
- public void removeVisibilityWindowListener(VisibilityWindowListener listener)
listener
- the listener which should no longer be notified
IllegalArgumentException
- SWTException
- public boolean setText(String html)
The html parameter is Unicode encoded since it is a java String
.
As a result, the HTML meta tag charset should not be set. The charset is implied
by the String
itself.
html
- the HTML content to be rendered
IllegalArgumentException
- SWTException
- setUrl(java.lang.String)
public boolean setUrl(String url)
url
- the URL to be loaded
IllegalArgumentException
- SWTException
- getUrl()
public void stop()
SWTException
-
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.