Community
Participate
Working Groups
Place the cursor in some method declaration and select Refactor>Self encapsulate field. A message dialog appears saying operation not available on current selection. The action remains enabled. This "Sorry, can't do that" behavior is not user friendly. Either 1) Disable the action if it is not available (prefered) or 2) Use the message dialog to explain what the action does and why it is not available on the current selection. The same situation arises with other refactoring actions.
Enabling/Disabling the action isn't possible because of missing Desktop functionality. Waiting for corresponding desktop features.
RG asks: RG> Do you know anything about this? RG> I am a bit surprised since other editor contributed actions are enabling/disabling based on selection. There was a bug which DS fixed recently where contributions weren't getting the selection changed event when first contributed. Not sure if this applies to context menu contributions though. In general, it depends on the selection logic. The extension mechanism has limited attributes that you can check. Does this action look at more than just the size and class of the selection?
There are two PRs filed describing the problem http://dev.eclipse.org/bugs/show_bug.cgi?id=2912 http://dev.eclipse.org/bugs/show_bug.cgi?id=2896
The action is now only enabled if there is text selected in the editor. Fixed in build > 20020129