org.eclipse.amp.escape.ascape.adapt
Class AscapeProvider

java.lang.Object
  extended by org.eclipse.amp.escape.ascape.adapt.AscapeProvider
All Implemented Interfaces:
ICompositionProvider, IGraphProvider, ILocationProvider
Direct Known Subclasses:
AscapeTreeMemberProvider

public class AscapeProvider
extends java.lang.Object
implements ILocationProvider, IGraphProvider, ICompositionProvider

The Class AscapeProvider.


Nested Class Summary
(package private)  class AscapeProvider.Location
          The Class Location.
 
Field Summary
(package private) static AscapeProvider singleton
           
 
Constructor Summary
AscapeProvider()
           
 
Method Summary
 void addListener(ILabelProviderListener listener)
           
 void dispose()
           
 java.util.HashMap getAdjacencyMap(java.lang.Object scape)
           
 Array2D getArray2D(Scape scape)
          Gets the array2 d.
 Color getBackground(java.lang.Object element)
           
static AscapeProvider getDefault()
           
 ILocation getExtent(java.lang.Object located)
           
 Color getForeground(java.lang.Object element)
           
 Image getImage(java.lang.Object element)
           
 java.lang.Iterable getIteratable(java.lang.Object object)
          Gets the composition members for this level of the composition in iterable form.
 java.util.List getList(java.lang.Object parent)
          Gets the composition members for this level of the composition as a list.
 ILocation getLocation(java.lang.Object located)
           
 java.util.List getNeighborsFor(java.lang.Object scape, java.lang.Object source)
           
 java.lang.Object getParent(java.lang.Object member)
          Gets the list.
 java.lang.String getText(java.lang.Object element)
           
 java.lang.Object getUnwrapped(java.lang.Object object)
           
 boolean isChildrenComposition(java.lang.Object parent)
          Indicates whether children of the provided object are themselves capable of providing composition members.
 boolean isGraph(java.lang.Object graph)
           
 boolean isLabelProperty(java.lang.Object element, java.lang.String property)
           
 boolean isMutable(java.lang.Object parent)
          Checks if is mutable.
 void removeListener(ILabelProviderListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

static AscapeProvider singleton
Constructor Detail

AscapeProvider

public AscapeProvider()
Method Detail

getText

public java.lang.String getText(java.lang.Object element)
Parameters:
element -
Returns:
See Also:
org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)

getImage

public Image getImage(java.lang.Object element)
Parameters:
element -
Returns:
See Also:
org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)

getLocation

public ILocation getLocation(java.lang.Object located)
Specified by:
getLocation in interface ILocationProvider
Parameters:
located -
Returns:
See Also:
ILocationProvider.getLocation(java.lang.Object)

getExtent

public ILocation getExtent(java.lang.Object located)
Specified by:
getExtent in interface ILocationProvider
Parameters:
located -
Returns:
See Also:
ILocationProvider.getExtent(java.lang.Object)

getArray2D

public Array2D getArray2D(Scape scape)
Gets the array2 d.

Parameters:
scape - the scape
Returns:
the array2 d

getAdjacencyMap

public java.util.HashMap getAdjacencyMap(java.lang.Object scape)
Specified by:
getAdjacencyMap in interface IGraphProvider
Parameters:
graph -
Returns:
See Also:
IGraphProvider.getAdjacencyMap(java.lang.Object)

getNeighborsFor

public java.util.List getNeighborsFor(java.lang.Object scape,
                                      java.lang.Object source)
Specified by:
getNeighborsFor in interface IGraphProvider
Parameters:
graph -
source -
Returns:
See Also:
IGraphProvider.getNeighborsFor(java.lang.Object, java.lang.Object)

isGraph

public boolean isGraph(java.lang.Object graph)
Specified by:
isGraph in interface IGraphProvider
Parameters:
graph -
Returns:
See Also:
IGraphProvider.isGraph(java.lang.Object)

getIteratable

public java.lang.Iterable getIteratable(java.lang.Object object)
Description copied from interface: ICompositionProvider
Gets the composition members for this level of the composition in iterable form. Note that as iterables allow just-in-time usage of the underlying objects and do not require size or index positions to be known, composition consumers should generally use this form for best performance whenever practical. (In the worst case, where only an iterable is known, a call to getList() may require providers to first build a list.) On the other hand, providers should simply provide the most efficient usage which in many cases will simply mean returning getList for this method.

Specified by:
getIteratable in interface ICompositionProvider
Parameters:
hasIterable -
Returns:
See Also:
ICompositionProvider.getIteratable(java.lang.Object)

getList

public java.util.List getList(java.lang.Object parent)
Description copied from interface: ICompositionProvider
Gets the composition members for this level of the composition as a list. Consumers should generally use getIterable(), see above.

Specified by:
getList in interface ICompositionProvider
Parameters:
parent -
Returns:
See Also:
ICompositionProvider.getList(java.lang.Object)

isMutable

public boolean isMutable(java.lang.Object parent)
Description copied from interface: ICompositionProvider
Checks if is mutable.

Specified by:
isMutable in interface ICompositionProvider
Parameters:
parent -
Returns:
See Also:
ICompositionProvider.isMutable(java.lang.Object)

getParent

public java.lang.Object getParent(java.lang.Object member)
Description copied from interface: ICompositionProvider
Gets the list.

Specified by:
getParent in interface ICompositionProvider
Returns:
the list

isChildrenComposition

public boolean isChildrenComposition(java.lang.Object parent)
Description copied from interface: ICompositionProvider
Indicates whether children of the provided object are themselves capable of providing composition members. If not, we can assume that they represent the leaves of the composition structure.

Specified by:
isChildrenComposition in interface ICompositionProvider
Returns:
true if any children of the parent object's level are themselves compositions.

addListener

public void addListener(ILabelProviderListener listener)
Parameters:
listener -
See Also:
org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)

dispose

public void dispose()
See Also:
org.eclipse.jface.viewers.IBaseLabelProvider#dispose()

isLabelProperty

public boolean isLabelProperty(java.lang.Object element,
                               java.lang.String property)
Parameters:
element -
property -
Returns:
See Also:
org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)

removeListener

public void removeListener(ILabelProviderListener listener)
Parameters:
listener -
See Also:
org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)

getUnwrapped

public java.lang.Object getUnwrapped(java.lang.Object object)

getDefault

public static AscapeProvider getDefault()

getForeground

public Color getForeground(java.lang.Object element)
Parameters:
element -
Returns:
See Also:
org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)

getBackground

public Color getBackground(java.lang.Object element)
Parameters:
element -
Returns:
See Also:
org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)


Copyright (C) 2007-2009 Metascape, LLC, 2009 Miles Parker, 2006-2007 Argonne National Labs, and Contributors