mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Improved find tool usability, make the screen pan to the selected components
This commit is contained in:
@@ -1069,15 +1069,16 @@ public class Presenter implements IPlugInPort {
|
|||||||
@Override
|
@Override
|
||||||
public void selectMatching(String criteria) {
|
public void selectMatching(String criteria) {
|
||||||
Set<IDIYComponent<?>> matching = new HashSet<IDIYComponent<?>>();
|
Set<IDIYComponent<?>> matching = new HashSet<IDIYComponent<?>>();
|
||||||
|
String regex = ".*" + criteria.toLowerCase() + ".*";
|
||||||
for (IDIYComponent<?> c : currentProject.getComponents()) {
|
for (IDIYComponent<?> c : currentProject.getComponents()) {
|
||||||
ComponentType type = ComponentProcessor.getInstance().extractComponentTypeFrom((Class<? extends IDIYComponent<?>>) c.getClass());
|
ComponentType type = ComponentProcessor.getInstance().extractComponentTypeFrom((Class<? extends IDIYComponent<?>>) c.getClass());
|
||||||
if ((c.getName() != null && c.getName().toLowerCase().matches(criteria.toLowerCase())) ||
|
if ((c.getName() != null && c.getName().toLowerCase().matches(regex)) ||
|
||||||
(c.getValueForDisplay() != null && c.getValueForDisplay().toLowerCase().matches(criteria.toLowerCase())) ||
|
(c.getValueForDisplay() != null && c.getValueForDisplay().toLowerCase().matches(regex)) ||
|
||||||
(type != null && type.getName().toLowerCase().matches(criteria.toLowerCase())))
|
(type != null && type.getName().toLowerCase().matches(regex)))
|
||||||
matching.add(c);
|
matching.add(c);
|
||||||
}
|
}
|
||||||
updateSelection(matching);
|
updateSelection(matching);
|
||||||
messageDispatcher.dispatchMessage(EventType.REPAINT);
|
messageDispatcher.dispatchMessage(EventType.REPAINT, true);
|
||||||
if (matching.size() > 0)
|
if (matching.size() > 0)
|
||||||
messageDispatcher.dispatchMessage(EventType.SCROLL_TO, getSelectionBounds(true));
|
messageDispatcher.dispatchMessage(EventType.SCROLL_TO, getSelectionBounds(true));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4238,6 +4238,10 @@
|
|||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Escape comma in BOM CSV files to avoid component names being split into separate columns</description>
|
<description>Escape comma in BOM CSV files to avoid component names being split into separate columns</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>Improved find tool usability, make the screen pan to the selected components</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
</changes>
|
</changes>
|
||||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||||
</org.diylc.appframework.update.Version>
|
</org.diylc.appframework.update.Version>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ Box
|
|||||||
C-B-E BJT
|
C-B-E BJT
|
||||||
Circle
|
Circle
|
||||||
Coil(s)
|
Coil(s)
|
||||||
Component reordering is possible only when Project Explorer is sorted by z-index
|
Component reordering is possible only when Project Explorer is sorted by z-index.
|
||||||
Configuration
|
Configuration
|
||||||
Could not apply changes. Check the log for details.
|
Could not apply changes. Check the log for details.
|
||||||
D-G-S JFET
|
D-G-S JFET
|
||||||
|
|||||||
Reference in New Issue
Block a user