sk.uniba.euromath.plugin.views.outline
Class XMLAccessContentProvider

java.lang.Object
  extended by sk.uniba.euromath.plugin.views.outline.XMLAccessContentProvider
All Implemented Interfaces:
IContentProvider, IStructuredContentProvider, ITreeContentProvider

public class XMLAccessContentProvider
extends Object
implements ITreeContentProvider

Tree xml node structure content provider. Provided content is tree of outline items. Alows to configure which types of nodes are shown. Has auto refresh.

Author:
Tomáš Studva 2.11.2005

Field Summary
protected static boolean showInternalAttributes
          Flag, if internal EM2 attributes should be shown.
 
Constructor Summary
XMLAccessContentProvider()
          Constructor.
 
Method Summary
protected  void addToTree(OutlineItem parent, Node xmlNode)
           
protected  void build(Node topDataNode)
           
protected  void clear()
           
protected  OutlineItem createItem(Node model)
          Creates outline item for node.
 void dispose()
           
 Object[] getChildren(Object parent)
           
 Object[] getElements(Object parent)
           
protected  sk.uniba.euromath.plugin.views.outline.XMLAccessContentProvider.TopLevelOutlineItem getInvisibleRoot()
           
 OutlineItem getItem(Node node)
          Returns OutlineItem which displays node or null if outline view don't have outline item which correspond to that node.
 Object getParent(Object element)
           
protected  Map<Short,Boolean> getVisibilityFlagMap()
           
 boolean hasChildren(Object parent)
           
protected  boolean hasToBeShown(Node node)
          Computes if node should be shown.
 void inputChanged(Viewer v, Object oldInput, Object newInput)
           
protected  boolean isAutoRefresh()
           
protected  void refresh()
          Refreshes the content.
protected  void setAutoRefresh(boolean autoRefresh)
           
 void setShowType(short nodeType, boolean show)
          Sets visibility to nodes of type nodeType.
 void showAll()
          Sets visibility of all nodes types to true and refreshes content if auto refresh is on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

showInternalAttributes

protected static boolean showInternalAttributes
Flag, if internal EM2 attributes should be shown.

Constructor Detail

XMLAccessContentProvider

public XMLAccessContentProvider()
Constructor. Refreshes content. Content is empty, only invisible root exists.

Method Detail

addToTree

protected void addToTree(OutlineItem parent,
                         Node xmlNode)
Parameters:
parent -
xmlNode -

build

protected void build(Node topDataNode)
Parameters:
topDataNode -

clear

protected void clear()

createItem

protected OutlineItem createItem(Node model)
Creates outline item for node.

Parameters:
model - node
Returns:
new created outline item for node model

dispose

public void dispose()
Specified by:
dispose in interface IContentProvider

getChildren

public Object[] getChildren(Object parent)
Specified by:
getChildren in interface ITreeContentProvider

getElements

public Object[] getElements(Object parent)
Specified by:
getElements in interface IStructuredContentProvider

getItem

public OutlineItem getItem(Node node)
Returns OutlineItem which displays node or null if outline view don't have outline item which correspond to that node.

Parameters:
node - which is displayed in outline by some outline item
Returns:
outline item which displays node or null if no such node exists

getParent

public Object getParent(Object element)
Specified by:
getParent in interface ITreeContentProvider

hasChildren

public boolean hasChildren(Object parent)
Specified by:
hasChildren in interface ITreeContentProvider

hasToBeShown

protected boolean hasToBeShown(Node node)
Computes if node should be shown.

Parameters:
node - the node
Returns:
true if node should be shown

getVisibilityFlagMap

protected Map<Short,Boolean> getVisibilityFlagMap()
Returns:
Returns the visibilityFlagMap.

inputChanged

public void inputChanged(Viewer v,
                         Object oldInput,
                         Object newInput)
Specified by:
inputChanged in interface IContentProvider

refresh

protected void refresh()
Refreshes the content.


setShowType

public void setShowType(short nodeType,
                        boolean show)
Sets visibility to nodes of type nodeType. If show is true, nodes of that type will be shown.

Parameters:
nodeType - type of node
show - specifies if to show

isAutoRefresh

protected boolean isAutoRefresh()
Returns:
Returns the autoRefresh.

setAutoRefresh

protected void setAutoRefresh(boolean autoRefresh)
Parameters:
autoRefresh - The autoRefresh to set.

showAll

public void showAll()
Sets visibility of all nodes types to true and refreshes content if auto refresh is on.


getInvisibleRoot

protected sk.uniba.euromath.plugin.views.outline.XMLAccessContentProvider.TopLevelOutlineItem getInvisibleRoot()
Returns:
Returns the invisibleRoot.


Copyright © 2003-2006 null. All Rights Reserved.