org.eclipse.contribution.visualiser.simpleImpl
Class FileContentProvider
java.lang.Object
org.eclipse.contribution.visualiser.simpleImpl.SimpleContentProvider
org.eclipse.contribution.visualiser.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.
Method Summary |
void |
initialise()
Initialise the provider - reads in the information from a file |
void |
loadVisContents(java.io.InputStream in)
Loads the information for a visualisation from an input stream. |
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.simpleImpl.SimpleContentProvider |
activate, addGroup, deactivate, getAllGroups, getAllMembers, getAllMembers, getGroupViewIcon, getMemberViewIcon, numberOfGroupsDefined, processMouseclick, resetModel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileContentProvider
public FileContentProvider()
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 void loadVisContents(java.io.InputStream in)
- Loads the information for a visualisation from an input stream. Entries
in the file are either of the form:
Group:XX
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:
in
- input stream