Skip to content

Commit 305985d

Browse files
committed
Allow Eclipse 4 contributions to select svg files via the find dialog
With the svg support in SWT we should also allow the selection of svg files for Eclipse 4 application model elements. Fixes #eclipse-platform/eclipse.platform.ui#2911
1 parent b2b12f1 commit 305985d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/AbstractIconDialogWithScopeAndFilter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ private static class SearchThread extends TimerTask {
326326
private final StringMatcher matcherGif;
327327
private final StringMatcher matcherJpg;
328328
private final StringMatcher matcherPng;
329+
private final StringMatcher matcherSvg;
329330
private final StringMatcher matcherBinFolder;
330331
private final Filter filter;
331332
private boolean includeNonBundles;
@@ -335,6 +336,7 @@ public SearchThread(IconMatchCallback callback, Filter filter) {
335336
matcherGif = new StringMatcher("*" + filter.namePattern + "*.gif", true, false); //$NON-NLS-1$//$NON-NLS-2$
336337
matcherJpg = new StringMatcher("*" + filter.namePattern + "*.jpg", true, false); //$NON-NLS-1$//$NON-NLS-2$
337338
matcherPng = new StringMatcher("*" + filter.namePattern + "*.png", true, false); //$NON-NLS-1$//$NON-NLS-2$
339+
matcherSvg = new StringMatcher("*" + filter.namePattern + "*.svg", true, false); //$NON-NLS-1$//$NON-NLS-2$
338340
matcherBinFolder = new StringMatcher("bin/*", true, false); //$NON-NLS-1$
339341
this.callback = callback;
340342
this.filter = filter;
@@ -383,7 +385,8 @@ public void run() {
383385
} else if (resource.getType() == IResource.FILE && !resource.isLinked()) {
384386
final String path = resource.getProjectRelativePath().toString();
385387
if (!matcherBinFolder.match(path)
386-
&& (matcherGif.match(path) || matcherPng.match(path) || matcherJpg.match(path))) {
388+
&& (matcherGif.match(path) || matcherPng.match(path)
389+
|| matcherJpg.match(path) | matcherSvg.match(path))) {
387390
if (E.notEmpty(filter.getPackages())) {
388391
if (!filter.getPackages().contains(
389392
resource.getProjectRelativePath().removeLastSegments(1).toOSString())) {

0 commit comments

Comments
 (0)