0

I am writing an Eclipse editor plugin and my editor class extends AbstractTextEditor. However, I get the error: "The hierarchy of the type MyTextEditor is inconsistent".

Hence, I am wondering whether I forgot some package import. I imported the packages of AbstractTextEditor's parent classes, but the error remains. I guess I either forgot a package or the error is caused by something else... These are the packages I imported so far:

org.eclipse.ui
org.eclipse.ui.part
org.eclipse.ui.texteditor
user2035039
  • 961
  • 3
  • 16
  • 30
  • As long as you write Eclipse plug-ins (as opposed to pure OSGi bundles), why don't you use `Require-Bundle` to specify the dependencies? The AbstractTextEditor is in bundle `o.e.ui.workbench.texteditor` and you'll likely need `o.e.ui`, `o.e.editors`, `o.e.jface.text` (try one by one) – Rüdiger Herrmann Apr 19 '15 at 13:19
  • Yes, that worked :) (org.eclipse.core.runtime is needed as well). Could you write this as an answer please? – user2035039 Apr 19 '15 at 14:37

1 Answers1

0

As long as you write Eclipse plug-ins (as opposed to pure OSGi bundles), you can as well use Require-Bundle to specify the dependencies.

In general, it is much better to express dependencies using Import-Package. However in an Eclipse plug-in setting there is usually no alternate bundle that might provide the the desired API, plus PDE lacks decent support for packages first development.

The AbstractTextEditor is in bundle

  • org.eclipse.ui.workbench.texteditor and you'll likely also need
  • org.eclipse.ui
  • org.eclipse.editors
  • org.eclipse.jface.text
  • org.eclipse.core.runtime.
Community
  • 1
  • 1
Rüdiger Herrmann
  • 20,512
  • 11
  • 62
  • 79