Skip to content

Commit ae0d288

Browse files
committed
Enable Browser searching in Help view and Help Contents dialog
Fixes: #1999
1 parent 8ec17fc commit ae0d288

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

ua/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import java.net.MalformedURLException;
1717
import java.net.URL;
1818
import java.util.ArrayList;
19-
import java.util.Iterator;
2019
import java.util.Vector;
2120
import java.util.concurrent.atomic.AtomicReference;
2221

@@ -121,7 +120,7 @@ public void controlResized(ControlEvent e) {
121120
}
122121
});
123122

124-
browser = new Browser(shell, SWT.NONE);
123+
browser = new Browser(shell, SWT.SEARCH);
125124
browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
126125
initialize(browser);
127126

@@ -254,8 +253,8 @@ private static void initializeShell(Shell s) {
254253
s.setLayout(layout);
255254
s.addDisposeListener(e -> {
256255
if (shellImages != null) {
257-
for (int i = 0; i < shellImages.length; i++) {
258-
shellImages[i].dispose();
256+
for (Image shellImage : shellImages) {
257+
shellImage.dispose();
259258
}
260259
}
261260
});
@@ -444,20 +443,20 @@ private static Image[] createImages() {
444443
String[] productImageURLs = getProductImageURLs();
445444
if (productImageURLs != null) {
446445
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$
449448
continue;
450449
}
451450
URL imageURL = null;
452451
try {
453-
imageURL = new URL(productImageURLs[i]);
452+
imageURL = new URL(productImageURL);
454453
} catch (MalformedURLException mue) {
455454
// must be a path relative to the product bundle
456455
IProduct product = Platform.getProduct();
457456
if (product != null) {
458457
Bundle productBundle = product.getDefiningBundle();
459458
if (productBundle != null) {
460-
imageURL = FileLocator.find(productBundle, IPath.fromOSString(productImageURLs[i]), null);
459+
imageURL = FileLocator.find(productBundle, IPath.fromOSString(productImageURL), null);
461460
}
462461
}
463462
}
@@ -519,8 +518,7 @@ public void setSize(int width, int height) {
519518
shell.setSize(w, h);
520519
}
521520
private void notifyCloseListners() {
522-
for (Iterator<IBrowserCloseListener> it = closeListeners.iterator(); it.hasNext();) {
523-
IBrowserCloseListener listener = it.next();
521+
for (IBrowserCloseListener listener : closeListeners) {
524522
listener.browserClosed();
525523
}
526524
}

ua/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
9797

9898
public BrowserPart(final Composite parent, FormToolkit toolkit,
9999
final IToolBarManager tbm, IMenuManager menuManager) {
100-
browser = new Browser(parent, SWT.NULL);
100+
browser = new Browser(parent, SWT.SEARCH);
101101
browser.addLocationListener(new LocationListener() {
102102

103103
@Override

0 commit comments

Comments
 (0)