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

java.lang.Object
  extended byorg.eclipse.contribution.visualiser.interfaces.simpleImpl.SimpleContentProvider
      extended byorg.eclipse.contribution.visualiser.interfaces.simpleImpl.FileContentProvider
All Implemented Interfaces:
IContentProvider

public class FileContentProvider
extends SimpleContentProvider

Example content provider that lets the superclass SimpleContentProvider do all the grunt work. This provider just loads the data from a file, parsing it and making suitable calls to the superclass to keep track of the groups and members. The important features are 1) initialise() is called by the org.eclipse.contribution.visualiser when it starts up and discovers a content provider, typically allowing the provider to 'get ready' - in this case that means loading a file and building up the group/member list. 2) addGroup() is called to define a new group to the SimpleContentProvider 3) members are not added directly to the simple content provider - they are simply added to the group, the SimpleContentProvider then finds them when it traverses the groups it knows about.


Constructor Summary
FileContentProvider()
           
 
Method Summary
 java.lang.String getEmptyMessage()
          Return message to display when visualiser is empty
 void initialise()
          Initialise the provider - reads in the information from a file
static void loadVisContents(java.lang.String filename)
          Loads the information for a visualisation from a file.
static void log(int msgType, java.lang.String msg, java.lang.Exception e)
          Log the given message
 
Methods inherited from class org.eclipse.contribution.visualiser.interfaces.simpleImpl.SimpleContentProvider
addGroup, getAllGroups, getAllMembers, getAllMembers, numberOfGroupsDefined, processMouseclick
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileContentProvider

public FileContentProvider()
Method Detail

initialise

public void initialise()
Initialise the provider - reads in the information from a file

Specified by:
initialise in interface IContentProvider
Overrides:
initialise in class SimpleContentProvider
See Also:
IContentProvider.initialise()

log

public static void log(int msgType,
                       java.lang.String msg,
                       java.lang.Exception e)
Log the given message

Parameters:
msgType -
msg -
e -

loadVisContents

public static void loadVisContents(java.lang.String filename)
Loads the information for a visualisation from a file. Entries in the file are either of the form Group:XXX or Member:Y [Size:NNN] [Tip:SSSS] A member entry must be after a Group entry, and the member is considered a member of that group.

Parameters:
filename -

getEmptyMessage

public java.lang.String getEmptyMessage()
Return message to display when visualiser is empty

Specified by:
getEmptyMessage in interface IContentProvider
Overrides:
getEmptyMessage in class SimpleContentProvider
See Also:
IContentProvider.getEmptyMessage()