Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mylyn-integrators] Re: Problems adding (non-IResource) context

Ok, I figured out one of my problems is that I didn't implement the "org.eclipse.mylyn.context.ui.bridges" extension point.

It is also not clear if I need to make a call to the MonitorUiPlugin (as below)

icm.processInteractionEvent(event);
MonitorUiPlugin.getDefault().notifyInteractionObserved(event);

This call seems to be being done in several places.

On Tue, May 27, 2008 at 4:32 PM, Tim Halloran <hallorant@xxxxxxxxx> wrote:
I'm trying to add a new context that monitors use of static analysis findings (think FindBugs).  The trouble is that the context is not a File (or IResource) it is stored in a database.

I implemented a plug-in that registers

   <extension
         point="org.eclipse.mylyn.context.core.bridges">
      <structureBridge
            class="com.surelogic.sierra.mylyn.FindingContextStructureBridge"
            name="com.surelogic.sierra.mylyn.FindingContextStructureBridge">
      </structureBridge>
   </extension>


Where the FindingContextStructureBridge is a bridge to my FindingDetails type.  It uses a string representation of our finding identifer (a long) as its handle identifier.

Now I added a listener in my mylyn plug-in to monitor selection of findings that does the following:

private static final FindingDetailsView.IFindingSelectionObserver OBS = new FindingDetailsView.IFindingSelectionObserver() {
        public void selectionNotify(long findingId) {
            System.out.println("selectionNotify(" + findingId + ")");
            final InteractionContextManager icm = ContextCorePlugin
                    .getContextManager();
            final String handle = Long.toString(findingId);
            final InteractionEvent event = new InteractionEvent(
                    InteractionEvent.Kind.SELECTION,
                    FindingContextStructureBridge.CONTENT_TYPE_FINDING, handle,
                    FindingDetailsView.ID);
            icm.processInteractionEvent(event);
        }
    };


When I run this I see the selections, however, nothing shows up in the context of the activated task (I'm testing with a local task).

I'm also not seeing anything in the workspace-dir/.mylyn/monitor-log.xml

Thanks in advance for any tips/help!

Tim




Back to the top