mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
enhance search
This commit is contained in:
@@ -1004,12 +1004,15 @@ public class Presenter implements IPlugInPort {
|
||||
drawingManager.clearContinuityArea();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void selectMatching(String criteria) {
|
||||
Set<IDIYComponent<?>> matching = new HashSet<IDIYComponent<?>>();
|
||||
for (IDIYComponent<?> c : currentProject.getComponents()) {
|
||||
ComponentType type = ComponentProcessor.getInstance().extractComponentTypeFrom((Class<? extends IDIYComponent<?>>) c.getClass());
|
||||
if ((c.getName() != null && c.getName().toLowerCase().matches(criteria.toLowerCase())) ||
|
||||
(c.getValueForDisplay() != null && c.getValueForDisplay().toLowerCase().matches(criteria.toLowerCase())))
|
||||
(c.getValueForDisplay() != null && c.getValueForDisplay().toLowerCase().matches(criteria.toLowerCase())) ||
|
||||
type.getName().toLowerCase().matches(criteria.toLowerCase()))
|
||||
matching.add(c);
|
||||
}
|
||||
updateSelection(matching);
|
||||
|
||||
Reference in New Issue
Block a user