|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NewWindowListener
This interface allows the implementer to be notified of NewWindowEvent
s that occur as a result of user browsing. For
example, pop-ups.
The constants defined in this interface should really be defined
on NewWindowEvent
, but they remain here for backwards
compatability. They are given to the user as the value of the
type
property of the NewWindowEvent
. They
advise the user on the characteristics of the new window to be
created. They should be anded with the argument eventType to
determine if they are indicated for this event. Here is an example
of how to create a new window in response to a
NewWindowEvent
:
public void eventDispatched(WebclientEvent newWindowEvent) {
BrowserControl newBrowserControl = null;
BrowserControlCanvas newCanvas = null;
Frame newFrame = new Frame();
long type = newWindowEvent.getType();
if (type & NewWindowListener.CHROME_MENUBAR) {
// create a menu bar for the new window
}
if (type & NewWindowListener.CHROME_WINDOW_CLOSE) {
// Make it so this window cannot be closed
}
try {
newBrowserControl = BrowserControlFactory.newBrowserControl();
newCanvas = (BrowserControlCanvas)
newBrowserControl.queryInterface(BrowserControl.BROWSER_CONTROL_CANVAS_NAME);
// obtain any other interfaces you need.
} catch (Throwable e) {
System.out.println(e.getMessage());
}
newFrame.add(newCanvas, BorderLayout.CENTER);
newFrame.setVisible(true);
newCanvas.setVisible(true);
}
Field Summary | |
---|---|
static long |
CHROME_ALL
|
static long |
CHROME_DEFAULT
|
static long |
CHROME_EXTRA
|
static long |
CHROME_LOCATIONBAR
Specifies whether to display the input field for entering URLs directly into the browser. |
static long |
CHROME_MENUBAR
Specifies whether to display the menu bar. |
static long |
CHROME_PERSONAL_TOOLBAR
Specifies whether to display the personal bar. |
static long |
CHROME_SCROLLBARS
Specifies whether to display horizontal and vertical scroll bars. |
static long |
CHROME_STATUSBAR
Specifies whether to add a status bar at the bottom of the window. |
static long |
CHROME_TITLEBAR
Specifies whether to display a title bar for the window. |
static long |
CHROME_TOOLBAR
Specifies whether to display the browser toolbar, making buttons such as Back, Forward, and Stop available. |
static long |
CHROME_WINDOW_BORDERS
|
static long |
CHROME_WINDOW_CLOSE
|
static long |
CHROME_WINDOW_MIN
Specifies whether the window is minimizable. |
static long |
CHROME_WINDOW_POPUP
|
static long |
CHROME_WINDOW_RESIZE
Specifies whether the window is resizable. |
static long |
CHROME_WITH_POSITION
|
static long |
CHROME_WITH_SIZE
|
Method Summary |
---|
Methods inherited from interface org.mozilla.webclient.WebclientEventListener |
---|
eventDispatched |
Field Detail |
---|
static final long CHROME_DEFAULT
static final long CHROME_WINDOW_BORDERS
static final long CHROME_WINDOW_CLOSE
static final long CHROME_WINDOW_RESIZE
static final long CHROME_MENUBAR
static final long CHROME_TOOLBAR
static final long CHROME_LOCATIONBAR
static final long CHROME_STATUSBAR
static final long CHROME_PERSONAL_TOOLBAR
static final long CHROME_SCROLLBARS
static final long CHROME_TITLEBAR
static final long CHROME_EXTRA
static final long CHROME_WITH_SIZE
static final long CHROME_WITH_POSITION
static final long CHROME_WINDOW_MIN
static final long CHROME_WINDOW_POPUP
static final long CHROME_ALL
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |