org.eclipse.mylar.monitor
Class AbstractUserInteractionMonitor

java.lang.Object
  extended by org.eclipse.mylar.monitor.AbstractUserInteractionMonitor
All Implemented Interfaces:
org.eclipse.ui.ISelectionListener
Direct Known Subclasses:
BrowserMonitor, JavaEditingMonitor, MockSelectionMonitor, ResourceInteractionMonitor

public abstract class AbstractUserInteractionMonitor
extends java.lang.Object
implements org.eclipse.ui.ISelectionListener

Self-registering on construction. Encapsulates users' interaction with the context model.

Author:
Mik Kersten

Field Summary
protected  java.lang.Object lastSelectedElement
           
 
Constructor Summary
AbstractUserInteractionMonitor()
          Requires workbench to be active.
 
Method Summary
 void dispose()
           
 org.eclipse.mylar.context.core.InteractionEvent.Kind getEventKind()
           
protected  void handleElementEdit(org.eclipse.ui.IWorkbenchPart part, java.lang.Object selectedElement, boolean contributeToContext)
          Intended to be called back by subclasses.
protected  org.eclipse.mylar.context.core.InteractionEvent handleElementSelection(org.eclipse.ui.IWorkbenchPart part, java.lang.Object selectedElement, boolean contributeToContext)
          Intended to be called back by subclasses.
protected  void handleNavigation(org.eclipse.ui.IWorkbenchPart part, java.lang.Object targetElement, java.lang.String kind, boolean contributeToContext)
          Intended to be called back by subclasses.
protected abstract  void handleWorkbenchPartSelection(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection, boolean contributeToContext)
           
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastSelectedElement

protected java.lang.Object lastSelectedElement
Constructor Detail

AbstractUserInteractionMonitor

public AbstractUserInteractionMonitor()
Requires workbench to be active.

Method Detail

dispose

public void dispose()

selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener

handleWorkbenchPartSelection

protected abstract void handleWorkbenchPartSelection(org.eclipse.ui.IWorkbenchPart part,
                                                     org.eclipse.jface.viewers.ISelection selection,
                                                     boolean contributeToContext)

handleElementSelection

protected org.eclipse.mylar.context.core.InteractionEvent handleElementSelection(org.eclipse.ui.IWorkbenchPart part,
                                                                                 java.lang.Object selectedElement,
                                                                                 boolean contributeToContext)
Intended to be called back by subclasses.


handleElementEdit

protected void handleElementEdit(org.eclipse.ui.IWorkbenchPart part,
                                 java.lang.Object selectedElement,
                                 boolean contributeToContext)
Intended to be called back by subclasses.


handleNavigation

protected void handleNavigation(org.eclipse.ui.IWorkbenchPart part,
                                java.lang.Object targetElement,
                                java.lang.String kind,
                                boolean contributeToContext)
Intended to be called back by subclasses.


getEventKind

public org.eclipse.mylar.context.core.InteractionEvent.Kind getEventKind()