org.eclipse.contribution.visualiser.interfaces.simpleImpl
Class SimpleMarkupProvider

java.lang.Object
  extended byorg.eclipse.contribution.visualiser.interfaces.simpleImpl.SimpleMarkupProvider
All Implemented Interfaces:
IMarkupProvider
Direct Known Subclasses:
FileMarkupProvider, JDTSearchResultsMarkupProvider, MarkerMarkupProvider

public class SimpleMarkupProvider
extends java.lang.Object
implements IMarkupProvider

Example implementation of a markup provider. Loads its information about the markups from a file. Manages the list of markups in a hashtable - the hashtable maps the member ID to a list of 'Stripe instances' (markups).


Field Summary
 java.util.SortedSet markupKinds
           
 java.util.Hashtable markups
           
 
Constructor Summary
SimpleMarkupProvider()
           
 
Method Summary
 void activate()
          Activate the provider
 void addMarkup(java.lang.String membername, Stripe s)
          Add a Stripe to the member with the given name.
 boolean changeMode()
          Change the markup provider mode.
 void deactivate()
          Deactivate the provider
 java.util.SortedSet getAllMarkupKinds()
          Get all the markup kinds.
 org.eclipse.swt.graphics.Color getColorFor(IMarkupKind id)
          Get the colour for a given kind
 java.util.List getGroupMarkups(IGroup group)
          Get the markups for a group.
 java.util.List getMemberMarkups(IMember member)
          Get a List of Stripes for the given member, which are its markups.
 boolean hasMultipleModes()
          Ask if the markup provider has multiple modes.
 void initialise()
          Initialise the markup provider.
 void processMarkups()
          Process all the Stripes that have been added to deal with the overlapping cases
 boolean processMouseclick(IMember member, Stripe stripe, int buttonClicked)
          Process a mouse click on a stripe.
 void resetColours()
          Reset the color memory
 void setColorFor(IMarkupKind kind, org.eclipse.swt.graphics.Color color)
          Set the color for a kind.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

markups

public java.util.Hashtable markups

markupKinds

public java.util.SortedSet markupKinds
Constructor Detail

SimpleMarkupProvider

public SimpleMarkupProvider()
Method Detail

initialise

public void initialise()
Initialise the markup provider. This simple implementation does nothing here.

Specified by:
initialise in interface IMarkupProvider

changeMode

public boolean changeMode()
Change the markup provider mode. This implementaion does nothing and returns false as there has not been a mode change.

Specified by:
changeMode in interface IMarkupProvider
Returns:
true iff the provider requires the visualiser to update,

hasMultipleModes

public boolean hasMultipleModes()
Ask if the markup provider has multiple modes. Returns false.

Specified by:
hasMultipleModes in interface IMarkupProvider
Returns:
true if this markup provider has multiple modes

getMemberMarkups

public java.util.List getMemberMarkups(IMember member)
Get a List of Stripes for the given member, which are its markups.

Specified by:
getMemberMarkups in interface IMarkupProvider

addMarkup

public void addMarkup(java.lang.String membername,
                      Stripe s)
Add a Stripe to the member with the given name.

Parameters:
membername -
s -

processMarkups

public void processMarkups()
Process all the Stripes that have been added to deal with the overlapping cases


getGroupMarkups

public java.util.List getGroupMarkups(IGroup group)
Get the markups for a group. Group markups are a stacked set of member markups.

Specified by:
getGroupMarkups in interface IMarkupProvider

getAllMarkupKinds

public java.util.SortedSet getAllMarkupKinds()
Get all the markup kinds.

Specified by:
getAllMarkupKinds in interface IMarkupProvider
Returns:
a Set of IMarkupKinds

getColorFor

public org.eclipse.swt.graphics.Color getColorFor(IMarkupKind id)
Get the colour for a given kind

Specified by:
getColorFor in interface IMarkupProvider
Parameters:
id - - the kind
Returns:
the Color for that kind

setColorFor

public void setColorFor(IMarkupKind kind,
                        org.eclipse.swt.graphics.Color color)
Set the color for a kind.

Specified by:
setColorFor in interface IMarkupProvider
Parameters:
color - - the Color

resetColours

public void resetColours()
Reset the color memory


processMouseclick

public boolean processMouseclick(IMember member,
                                 Stripe stripe,
                                 int buttonClicked)
Process a mouse click on a stripe. This implementation does nothing and returns true to allow the visualiser to perform the default operations.

Specified by:
processMouseclick in interface IMarkupProvider
See Also:
org.eclipse.contribution.visualiser.interfaces.IMarkupProvider#processMouseclick(IMember, Stripe, String, int)

activate

public void activate()
Activate the provider

Specified by:
activate in interface IMarkupProvider

deactivate

public void deactivate()
Deactivate the provider

Specified by:
deactivate in interface IMarkupProvider