|
16 | 16 | import java.net.MalformedURLException; |
17 | 17 | import java.net.URL; |
18 | 18 | import java.util.ArrayList; |
19 | | -import java.util.Iterator; |
20 | 19 | import java.util.Vector; |
21 | 20 | import java.util.concurrent.atomic.AtomicReference; |
22 | 21 |
|
@@ -121,7 +120,7 @@ public void controlResized(ControlEvent e) { |
121 | 120 | } |
122 | 121 | }); |
123 | 122 |
|
124 | | - browser = new Browser(shell, SWT.NONE); |
| 123 | + browser = new Browser(shell, SWT.SEARCH); |
125 | 124 | browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
126 | 125 | initialize(browser); |
127 | 126 |
|
@@ -254,8 +253,8 @@ private static void initializeShell(Shell s) { |
254 | 253 | s.setLayout(layout); |
255 | 254 | s.addDisposeListener(e -> { |
256 | 255 | if (shellImages != null) { |
257 | | - for (int i = 0; i < shellImages.length; i++) { |
258 | | - shellImages[i].dispose(); |
| 256 | + for (Image shellImage : shellImages) { |
| 257 | + shellImage.dispose(); |
259 | 258 | } |
260 | 259 | } |
261 | 260 | }); |
@@ -444,20 +443,20 @@ private static Image[] createImages() { |
444 | 443 | String[] productImageURLs = getProductImageURLs(); |
445 | 444 | if (productImageURLs != null) { |
446 | 445 | ArrayList<Image> shellImgs = new ArrayList<>(); |
447 | | - for (int i = 0; i < productImageURLs.length; i++) { |
448 | | - if ("".equals(productImageURLs[i])) { //$NON-NLS-1$ |
| 446 | + for (String productImageURL : productImageURLs) { |
| 447 | + if ("".equals(productImageURL)) { //$NON-NLS-1$ |
449 | 448 | continue; |
450 | 449 | } |
451 | 450 | URL imageURL = null; |
452 | 451 | try { |
453 | | - imageURL = new URL(productImageURLs[i]); |
| 452 | + imageURL = new URL(productImageURL); |
454 | 453 | } catch (MalformedURLException mue) { |
455 | 454 | // must be a path relative to the product bundle |
456 | 455 | IProduct product = Platform.getProduct(); |
457 | 456 | if (product != null) { |
458 | 457 | Bundle productBundle = product.getDefiningBundle(); |
459 | 458 | if (productBundle != null) { |
460 | | - imageURL = FileLocator.find(productBundle, IPath.fromOSString(productImageURLs[i]), null); |
| 459 | + imageURL = FileLocator.find(productBundle, IPath.fromOSString(productImageURL), null); |
461 | 460 | } |
462 | 461 | } |
463 | 462 | } |
@@ -519,8 +518,7 @@ public void setSize(int width, int height) { |
519 | 518 | shell.setSize(w, h); |
520 | 519 | } |
521 | 520 | private void notifyCloseListners() { |
522 | | - for (Iterator<IBrowserCloseListener> it = closeListeners.iterator(); it.hasNext();) { |
523 | | - IBrowserCloseListener listener = it.next(); |
| 521 | + for (IBrowserCloseListener listener : closeListeners) { |
524 | 522 | listener.browserClosed(); |
525 | 523 | } |
526 | 524 | } |
|
0 commit comments