0

I am working on a set of plugins and fragments on eclipse 4.3 (Kepler) but using the 3.x model.

One plugin contains part of the application model and has a fragment which contributes some model editors. (This seems right to me - tell me if it's unnecessarily complicated)

In the main app these editor contributions are not listed. I changed the fragment to a plugin and the editors became visible.

I could change the fragment to a plugin but this would mean that I have to expose more of the model.

I could move the fragment to the host plugin but this would mean mixing model and view (perhaps not a big deal)

Is it generally not possible to contribute from a fragment or have I done something wrong?

Here is the fragment:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<fragment>
   <extension
         point="org.eclipse.ui.editors">
      <editor
            class="com.acme.atf.device.ui.editors.NullConfigEditor"
            default="false"
            id="827299e9-6039-4a76-bfa6-08ef2d7f8724"
            name="VariableEditor">
      </editor>
      <editor
            class="com.acme.atf.device.ui.editors.SerialConfigEditor"
            default="false"
            id="cbaba4b2-8380-4ae5-9896-542cf97ca8cc"
            name="SerialEditor">
      </editor>
   </extension>

Further information

The plugin hierarchy looks like this: (P=plugin, F=fragment)

com.acme.atf.app (P)
com.acme.atf.device (P)
com.acme.atf.device.help (F)
com.acme.atf.device.ui (F)
com.acme.atf.model (P)
com.acme.atf.core.ui (P)

An action in com.acme.atf.app attempts to load an editor (which happens to be in device.ui) which cannot be found. If I change device.uito a plugin then the editor is found.

Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68
paul
  • 13,312
  • 23
  • 81
  • 144
  • There is no problem contributing extensions in a fragment. I just tested contributing an editor similar to your example and it worked fine. – greg-449 Dec 04 '13 at 10:31
  • @greg-449 - thanks! Did you try that as a 3.x compatible RCP app? Wonder why it doesn't work for me... – paul Dec 04 '13 at 10:46
  • It has to be 3.x as e4 does not have editors! I tested with plug-ins in a full Eclipse RCP as I don't have a suitable RCP to test. What do you mean by 'does not show up'? – greg-449 Dec 04 '13 at 11:01
  • @greg-449 - I try to open an editor by id - not found. I listed all contributed editors and those in the fragment were not listed. `Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.ui.editors").getExtensions()` – paul Dec 04 '13 at 11:09
  • 1
    Does the fragment have a `Fragment-Host` in the `manifest.mf`? Is the parent plugin of the fragment declared to be a singleton? – greg-449 Dec 04 '13 at 11:22
  • @greg-449 - yes to both questions – paul Dec 04 '13 at 11:37

1 Answers1

0

Just managed to solve very similar problem with Eclipse 4.4.1. Unfortunately, the solution was to use clean workspace (I've imported my projects from Git). Before that, I tried "playing" with version numbers of host and fragment, singleton flags, recreating fragment project, cleaning all projects and configuration of my RCP app. Also, I used OSGI console trying to get some additional info, but it reported only that:

  • Host plug-in org.aaa.bbb is in ACTIVE state (with no fragments)
  • Fragment bundle is in INSTALLED state (reporting "Unresolved requirement: Fragment-Host: org.aaa.bbb")

I think this is a bug and garbaged workspace (launch) configuration may be the cause. Hope this helps someone.

xmichael91
  • 156
  • 10