Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326358 - Open Declaration is currently only supported via Hyperlinking, create a specific menu action for it as well
Summary: Open Declaration is currently only supported via Hyperlinking, create a speci...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: IMP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Robert M. Fuhrer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-27 17:52 EDT by Adam Taylor CLA
Modified: 2014-01-09 15:04 EST (History)
0 users

See Also:


Attachments
Proposed Implementation (81.66 KB, patch)
2010-09-27 18:51 EDT, Adam Taylor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Taylor CLA 2010-09-27 17:52:49 EDT
Build Identifier: 

Open Declaration is currently only supported via Hyperlinking, create a specific menu action for it as well like JDT does

Reproducible: Always
Comment 1 Adam Taylor CLA 2010-09-27 18:51:31 EDT
Created attachment 179698 [details]
Proposed Implementation

Additionally this patch simplifies TextEditorActionContributor and corrects ITextEditorActionDefinitionIds
Comment 2 Robert M. Fuhrer CLA 2010-09-30 18:34:24 EDT
Yes, this has been missing for a long time now; thanks for the patch!

It had a couple of other additions mingled in, which I omitted (like support for warning/info annotations). That's for another day. :-)

Some of the code looks as though it's been copied from the JDT, which is of course fine. Did you copy code from any other source?
Comment 3 Adam Taylor CLA 2010-09-30 22:15:39 EDT
Sorry, I thought I had isolated the code which pertained to this particular bug.

JDT was the only source.
Comment 4 Robert M. Fuhrer CLA 2010-10-01 11:01:25 EDT
Ok, it took a while to tease out of the patch the pieces of code that were really intended for this bit of functionality, along with adapting it a bit here and there (including a bit of much-needed refactoring to TargetLink and EditoryUtility).

Also, OpenAction.selectionChanged(ITextSelection) did nothing, which caused the action never to be enabled when the current selection was in a text editor. I fixed that by extracting the code from run(...) that looks at the current selection and identifies the ref target, and using that to determine whether the action should be enabled.

At any rate, it's all checked in now.

BTW, I omitted the piece of logic that called OpenAction.isProcessable(), since this didn't seem to be useful - if this action gets called, the editor in question is always a UniversalEditor. So, as long as there's a valid IParseController, and an IReferenceResolver, and those cough up something useful, the action is able to do what it needs.

I think this may mean that we don't actually need the IAdapter that turns things into IEditorInputs (or was it ISourceEntity's?), but I'm not sure at the moment.

Thanks again for the patch!!