neilcsmith-net commented on code in PR #9776:
URL: https://github.com/apache/netbeans/pull/9776#discussion_r4501239824
##########
ide/projectui/src/org/netbeans/modules/project/ui/actions/LookupSensitiveAction.java:
##########
@@ -164,28 +174,50 @@ private void doRefresh(boolean immediate) {
r.setResourceBundle(NbBundle.getBundle(LookupSensitiveAction.class));
r.setParameters(new Object[]{
getClass(),
- lookup
+ context
});
r.setLoggerName(LOG.getName());
LOG.log(r);
}
- refresh(lookup, immediate);
+ refresh(context);
} finally {
refreshing = false;
}
needsRefresh = false;
}
- // Abstract methods
--------------------------------------------------------
-
/** Called when the action is performed
*/
protected abstract void actionPerformed( Lookup context );
- /** Place where to change properties (enablement/name) when
- * the set of current projects changes.
+ /**
+ * Place where to change properties (enablement/name) when
+ * the set of current projects changes.
+ *
+ * <p>Invoked on a background (request processor) thread for
+ * scheduled refreshes, or synchronously on the calling thread
+ * (usually the EDT) when {@link #isEnabled()} or
+ * {@link #getValue(String)} forces a refresh of stale state.
*/
- protected abstract void refresh(Lookup context, boolean immediate);
+ protected abstract void refresh(Lookup context);
Review Comment:
At this is not public facing API I'm not going to push better EDT
separation, but at least add to the documentation that code implementing this
method must only touch action state within `Mutex.EVENT.writeAccess()`.
Neither direct calling or within `invokeLater` will have the correct semantics.
--
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