Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.swt.browser
Class Browser

    java.lang.Object
      org.eclipse.swt.widgets.Widget
          org.eclipse.swt.widgets.Control
              org.eclipse.swt.widgets.Scrollable
                  org.eclipse.swt.widgets.Composite
                      org.eclipse.swt.browser.Browser

All Implemented Interfaces:
  Drawable

public class Browser
extends Composite

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.

Since:
  3.0

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 receive events.
`void` | `addLocationListener(LocationListener listener)` Adds the listener to receive events.
`void` | `addOpenWindowListener(OpenWindowListener listener)` Adds the listener to receive events.
`void` | `addProgressListener(ProgressListener listener)` Adds the listener to receive events.
`void` | `addStatusTextListener(StatusTextListener listener)` Adds the listener to receive events.
`void` | `addTitleListener(TitleListener listener)` Adds the listener to receive events.
`void` | `addVisibilityWindowListener(VisibilityWindowListener listener)` Adds the listener to receive events.
`boolean` | `back()` Navigate to the previous session history item.
`protected void` | `checkSubclass()` Checks that this class can be subclassed.
`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.
`void` | `removeLocationListener(LocationListener listener)` Removes the listener.
`void` | `removeOpenWindowListener(OpenWindowListener listener)` Removes the listener.
`void` | `removeProgressListener(ProgressListener listener)` Removes the listener.
`void` | `removeStatusTextListener(StatusTextListener listener)` Removes the listener.
`void` | `removeTitleListener(TitleListener listener)` Removes the listener.
`void` | `removeVisibilityWindowListener(VisibilityWindowListener listener)` Removes the listener.
`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
`computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList`

Methods inherited from class org.eclipse.swt.widgets.Scrollable
`computeTrim, getClientArea, getHorizontalBar, getVerticalBar`

Methods inherited from class org.eclipse.swt.widgets.Control
`addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update`

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

### Browser

    public Browser(Composite parent,
                   int style)

  Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

  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.

Parameters:
  `parent` - a widget which will be the parent of the new instance (cannot be null)
  `style` - the style of widget to construct
Throws:
  `IllegalArgumentException` -
  - ERROR_NULL_ARGUMENT - if the parent is null
  `SWTException` -
  - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
  `SWTError` -
  - ERROR_NO_HANDLES if a handle could not be obtained for browser creation
Since:
  3.0
See Also:
  `Widget.getStyle()`

Method Detail

### addCloseWindowListener

    public void addCloseWindowListener(CloseWindowListener listener)

  Adds the listener to receive events.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### addLocationListener

    public void addLocationListener(LocationListener listener)

  Adds the listener to receive events.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### addOpenWindowListener

    public void addOpenWindowListener(OpenWindowListener listener)

  Adds the listener to receive events.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### addProgressListener

    public void addProgressListener(ProgressListener listener)

  Adds the listener to receive events.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### addStatusTextListener

    public void addStatusTextListener(StatusTextListener listener)

  Adds the listener to receive events.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### addTitleListener

    public void addTitleListener(TitleListener listener)

  Adds the listener to receive events.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### addVisibilityWindowListener

    public void addVisibilityWindowListener(VisibilityWindowListener listener)

  Adds the listener to receive events.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### back

    public boolean back()

  Navigate to the previous session history item.

  Returns:
    `true` if the operation was successful and `false` otherwise
  Throws:
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0
  See Also:
    `forward()`

### checkSubclass

    protected void checkSubclass()

  Description copied from class: `Widget`
  Checks that this class can be subclassed.

  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.

  Overrides:
    `checkSubclass` in class `Composite`

### forward

    public boolean forward()

  Navigate to the next session history item.

  Returns:
    `true` if the operation was successful and `false` otherwise
  Throws:
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0
  See Also:
    `back()`

### isBackEnabled

    public boolean isBackEnabled()

  Returns `true` if the receiver can navigate to the previous session history item, and `false` otherwise.

  Returns:
    the receiver's back command enabled state
  Throws:
    `SWTException` -
    - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  See Also:
    `back()`

### isForwardEnabled

    public boolean isForwardEnabled()

  Returns `true` if the receiver can navigate to the next session history item, and `false` otherwise.

  Returns:
    the receiver's forward command enabled state
  Throws:
    `SWTException` -
    - ERROR_WIDGET_DISPOSED - if the receiver has been disposed
    - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  See Also:
    `forward()`

### getUrl

    public String getUrl()

  Returns the current URL.

  Returns:
    the current URL or an empty `String` if there is no current URL
  Throws:
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0
  See Also:
    `setUrl(java.lang.String)`

### refresh

    public void refresh()

  Refresh the current page.

  Throws:
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### removeCloseWindowListener

    public void removeCloseWindowListener(CloseWindowListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### removeLocationListener

    public void removeLocationListener(LocationListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### removeOpenWindowListener

    public void removeOpenWindowListener(OpenWindowListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### removeProgressListener

    public void removeProgressListener(ProgressListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### removeStatusTextListener

    public void removeStatusTextListener(StatusTextListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### removeTitleListener

    public void removeTitleListener(TitleListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### removeVisibilityWindowListener

    public void removeVisibilityWindowListener(VisibilityWindowListener listener)

  Removes the listener.

  Parameters:
    `listener` - the listener
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the listener is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

### setText

    public boolean setText(String html)

  Renders HTML.

  Parameters:
    `html` - the HTML content to be rendered
  Returns:
    true if the operation was successful and false otherwise.
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the html is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0
  See Also:
    `setUrl(java.lang.String)`

### setUrl

    public boolean setUrl(String url)

  Loads a URL.

  Parameters:
    `url` - the URL to be loaded
  Returns:
    true if the operation was successful and false otherwise.
  Throws:
    `IllegalArgumentException` -
    - ERROR_NULL_ARGUMENT - if the url is null
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0
  See Also:
    `getUrl()`

### stop

    public void stop()

  Stop any loading and rendering activity.

  Throws:
    `SWTError` -
    - ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
    - ERROR_WIDGET_DISPOSED when the widget has been disposed
  Since:
    3.0

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
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, 2004. All rights reserved.