1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00
cdt/core/org.eclipse.cdt.ui
Andrew Eidsness d046e0a25f Bug 423679: CEditor navigation actions disabled outside of CEditor
The Open Declaration (F3), etc. actions use code in the ASTProvider.  If
the provider is not able to get an AST then the actions are disabled.
The implementation of the ASTProvider has an "instanceof CEditor" check
the result being that ASTProvider can only be used when the editor is a
CEditor.

This breaks our use case where we have a CEditor embedded as a tab in a
multi-pane editor (see org.eclipse.papyrus.infra.core.sasheditor
.editor.AbstractMultiPageSashEditor).

This patch modifies the ASTProvider to use #getAdapter instead of only
the instanceof check.  I've kept the common case (where the editor is a
CEditor) unchanged and added the new code as extra handling.

I've also introduced a public interface, ITranslationUnitProvider, to
avoid forcing clients to adapt to the internal CEditor class.  The only
part of CEditor that ASTProvider cares about is the ITranslationUnit.
The existing implementation has an unchecked cast.  The new interface
provides the required type directly.

Change-Id: Ie7e68e8909928374fa11fe2b8a857f09d042fb5c
Signed-off-by: Andrew Eidsness <andrewe@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20026
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
2014-01-29 16:23:34 -05:00
..
.settings Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
about_files adding third party code info and license for iSpell dictionaries 2008-06-09 16:21:33 +00:00
browser Bug 374795 - Open Element dialog (CDT) has text field disabled in 3.8M6 2012-03-20 14:38:56 -07:00
dictionaries Bug 406873 - [spell-check] Update the CDT word lists for Kepler 2013-04-30 11:01:29 -07:00
icons bug 416628: "Export" of entries of language settings providers to referencing projects - added capability 2013-09-08 08:09:10 -04:00
META-INF Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
schema [bug 417138] Various schema cleanups in cdt.ui 2013-09-12 23:04:35 -04:00
src/org/eclipse/cdt Bug 423679: CEditor navigation actions disabled outside of CEditor 2014-01-29 16:23:34 -05:00
templateengine/org/eclipse/cdt/ui Bug 389392 - Editor refresh problem when template executed twice 2012-10-09 23:25:23 -04:00
templates Don't produce a blank line at the top of the file if file comment 2013-06-12 17:05:29 -07:00
utils.ui/org/eclipse/cdt/utils/ui/controls Cosmetics 2013-01-24 20:37:09 -08:00
.classpath Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
.cvsignore
.options Bug 45203. Added transitive closing of include maps. 2013-03-30 10:41:59 -07:00
.project Configure API-tooling. 2008-06-18 08:00:42 +00:00
about.html adding third party code info and license for iSpell dictionaries 2008-06-09 16:21:33 +00:00
build.properties Enabled JDK 1.7. 2014-01-24 13:38:55 -05:00
ChangeLog
ChangeLog-2003
doxygenTags.csv Bug 397143 - Some new doxygen commands are missing 2012-12-25 01:51:38 -05:00
NEWS
plugin.properties Bug 45203. User configurable header substitution rules. 2013-06-14 15:54:13 -07:00
plugin.xml bug 416628: "Export" of entries of language settings providers to referencing projects - added provider to do that 2013-09-08 08:09:33 -04:00
pom.xml Bumped up CDT version to 8.4. 2014-01-21 17:35:29 -05:00