mbien commented on code in PR #9771:
URL: https://github.com/apache/netbeans/pull/9771#discussion_r4434919395
##########
platform/openide.explorer/src/org/openide/explorer/DefaultEMLookup.java:
##########
@@ -136,9 +162,22 @@ protected synchronized void beforeLookup(Template<?> t) {
}
}
+ @Override
public void propertyChange(PropertyChangeEvent evt) {
- if (ExplorerManager.PROP_SELECTED_NODES == evt.getPropertyName()) {
- updateLookups((Node[]) evt.getNewValue());
+ if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName()))
{
+ scheduleUpdate();
+ }
+ }
+
+ /**
+ * Schedules an update of this lookup to the currently selected nodes
+ * on a background thread. Pending updates are postponed. The update reads
+ * the selection when it runs, so a superseded update can never leave a
stale
+ * state behind.
+ */
+ private void scheduleUpdate() {
Review Comment:
>just the schedule(later) fix can hardly be compatible with current behavior
>the tests perform an action and expect to see the result immediately
yes that is what I said and I agree. This won't work unfortunately. And the
very exception which occurred indicates that something very similar had been
tried before and reverted.
([`DelayedLkp`](https://github.com/apache/netbeans/blob/e337e53eeccd036f5cb14d0261413b59484a70df/platform/openide.loaders/src/org/openide/loaders/FolderChildren.java#L587-L592))
we are stuck running this on EDT. What remains is to make consumers
non-blocking.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists