Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Cornu2004-01-22 22:42:37 +0000
committerChristophe Cornu2004-01-22 22:42:37 +0000
commit3a61b991b28289b53ad837cd80f29480fe8a2aad (patch)
tree06ec15fd7e4593a64a2cbc84fdfc3d98b96d1ba5 /examples
parentd71b09fe51fb78be0deeffaf3103f2e6182a162e (diff)
downloadeclipse.platform.swt-3a61b991b28289b53ad837cd80f29480fe8a2aad.tar.gz
eclipse.platform.swt-3a61b991b28289b53ad837cd80f29480fe8a2aad.tar.xz
eclipse.platform.swt-3a61b991b28289b53ad837cd80f29480fe8a2aad.zip
50437
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java
index 52b32934b8..89766919b2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java
@@ -143,6 +143,14 @@ public BrowserExample(Composite parent) {
else if (item == itemGo) browser.setUrl(location.getText());
}
};
+ browser.addLocationListener(new LocationListener() {
+ public void changed(LocationEvent event) {
+ busy = true;
+ location.setText(event.location);
+ }
+ public void changing(LocationEvent event) {
+ }
+ });
browser.addProgressListener(new ProgressListener() {
public void changed(ProgressEvent event) {
if (event.total == 0) return;
@@ -168,14 +176,14 @@ public BrowserExample(Composite parent) {
status.setText(event.text);
}
});
- browser.addLocationListener(new LocationListener() {
- public void changed(LocationEvent event) {
- busy = true;
- location.setText(event.location);
- }
- public void changing(LocationEvent event) {
- }
- });
+ if (parent instanceof Shell) {
+ final Shell shell = (Shell)parent;
+ browser.addTitleListener(new TitleListener() {
+ public void changed(TitleEvent event) {
+ shell.setText(event.title+" - "+getResourceString("window.title"));
+ }
+ });
+ }
itemBack.addListener(SWT.Selection, listener);
itemForward.addListener(SWT.Selection, listener);
itemStop.addListener(SWT.Selection, listener);
@@ -311,8 +319,8 @@ public static void main(String [] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
- BrowserExample instance = new BrowserExample(shell);
shell.setText(getResourceString("window.title"));
+ BrowserExample instance = new BrowserExample(shell);
Image icon = new Image(display, BrowserExample.class.getResourceAsStream(iconLocation));
shell.setImage(icon);
shell.open();

Back to the top