Bug 4981 - Refactor actions show more informative error dialogs
Summary: Refactor actions show more informative error dialogs
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC other
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dirk Baeumer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 2896 2912
Blocks:
  Show dependency tree
 
Reported: 2001-10-15 10:31 EDT by Randy Giffen CLA
Modified: 2002-01-29 12:58 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Giffen CLA 2001-10-15 10:31:25 EDT
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.
Comment 1 Dirk Baeumer CLA 2001-10-22 04:46:11 EDT
Enabling/Disabling the action isn't possible because of missing Desktop
functionality. Waiting for corresponding desktop features.
Comment 2 Nick Edgar CLA 2001-10-22 09:54:41 EDT
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?
Comment 3 Dirk Baeumer CLA 2001-10-22 10:22:57 EDT
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
Comment 4 Dirk Baeumer CLA 2002-01-29 12:58:04 EST
The action is now only enabled if there is text selected in the editor.

Fixed in build > 20020129