Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.e4.ui.workbench.swt;singleton:=true
Bundle-Version: 0.17.600.qualifier
Bundle-Version: 0.17.700.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2019 IBM Corporation and others.
* Copyright (c) 2005, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -14,6 +14,7 @@
*******************************************************************************/
package org.eclipse.e4.ui.workbench.swt.internal.copy;

import java.util.stream.Stream;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.dialogs.filteredtree.PatternFilter;
import org.eclipse.e4.ui.model.LocalizationHelper;
Expand Down Expand Up @@ -42,20 +43,8 @@ public boolean isElementSelectable(Object element) {

@Override
protected boolean isLeafMatch(Viewer viewer, Object element) {
if (element instanceof String) {
return false;
}

String text = null;
if (element instanceof MPartDescriptor) {
MPartDescriptor desc = (MPartDescriptor) element;
text = LocalizationHelper.getLocalized(desc.getLabel(), desc,
context);
if (wordMatches(text)) {
return true;
}
}

return false;
return element instanceof MPartDescriptor desc && Stream.of(desc.getLabel(), desc.getCategory()) //
.map(text -> LocalizationHelper.getLocalized(text, desc, context)) //
.anyMatch(this::wordMatches);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2014 IBM Corporation and others.
* Copyright (c) 2005, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -14,6 +14,7 @@
*******************************************************************************/
package org.eclipse.ui.internal.dialogs;

import java.util.stream.Stream;
import org.eclipse.e4.ui.model.LocalizationHelper;
import org.eclipse.e4.ui.model.application.descriptor.basic.MPartDescriptor;
import org.eclipse.jface.viewers.Viewer;
Expand All @@ -34,19 +35,8 @@ public boolean isElementSelectable(Object element) {

@Override
protected boolean isLeafMatch(Viewer viewer, Object element) {
if (element instanceof String) {
return false;
}

String text = null;
if (element instanceof MPartDescriptor) {
MPartDescriptor desc = (MPartDescriptor) element;
text = LocalizationHelper.getLocalized(desc.getLabel(), desc);
if (wordMatches(text)) {
return true;
}
}

return false;
return element instanceof MPartDescriptor desc && Stream.of(desc.getLabel(), desc.getCategory()) //
.map(text -> LocalizationHelper.getLocalized(text, desc)) //
.anyMatch(this::wordMatches);
}
}
Loading