Class IconRepositoryManager
- java.lang.Object
-
- org.opennms.features.topology.app.internal.support.IconRepositoryManager
-
- All Implemented Interfaces:
IconManager
public class IconRepositoryManager extends java.lang.Object implements IconManager
-
-
Constructor Summary
Constructors Constructor Description IconRepositoryManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurableIconRepository
findRepositoryByIconKey(java.lang.String iconKey)
Returns the firstIconRepository
which has the providediconKey
mapping defined.java.util.List<java.lang.String>
getSVGIconFiles()
Returns the list of available svg-files, e.g.java.lang.String
getSVGIconId(java.lang.String iconKey)
Returns the icon id assigned to the providediconKey
.java.lang.String
getSVGIconId(Vertex vertex)
Returns the icon id assigned to the providedVertex
.void
onBind(ConfigurableIconRepository iconRepo)
void
onBind(IconRepository iconRepo)
void
onUnbind(ConfigurableIconRepository iconRepo)
void
onUnbind(IconRepository iconRepo)
boolean
removeIconMapping(Vertex vertex)
Removes the icon mapping for theVertex
if defined.java.lang.String
setIconMapping(Vertex vertex, java.lang.String newIconId)
Sets a new icon mapping from theVertex
to thenewIconId
.
-
-
-
Method Detail
-
onBind
public void onBind(IconRepository iconRepo)
-
onUnbind
public void onUnbind(IconRepository iconRepo)
-
onBind
public void onBind(ConfigurableIconRepository iconRepo)
-
onUnbind
public void onUnbind(ConfigurableIconRepository iconRepo)
-
setIconMapping
public java.lang.String setIconMapping(Vertex vertex, java.lang.String newIconId)
Description copied from interface:IconManager
Sets a new icon mapping from theVertex
to thenewIconId
.- Specified by:
setIconMapping
in interfaceIconManager
- Parameters:
vertex
- the vertex to mapnewIconId
- the icon id to map the vertex to- Returns:
- the icon key of the vertex if this
IconManager
was able to save the mapping, null otherwise
-
removeIconMapping
public boolean removeIconMapping(Vertex vertex)
Description copied from interface:IconManager
Removes the icon mapping for theVertex
if defined.- Specified by:
removeIconMapping
in interfaceIconManager
- Parameters:
vertex
- theVertex
to remove the icon mapping for- Returns:
true
if the mapping was removed,false
if no icon mapping was found for the providedVertex
and therefore could not be removed
-
getSVGIconId
public java.lang.String getSVGIconId(Vertex vertex)
Description copied from interface:IconManager
Returns the icon id assigned to the providedVertex
.- Specified by:
getSVGIconId
in interfaceIconManager
- Parameters:
vertex
- the vertex to get the icon id for- Returns:
- the icon id assigned to the provided
Vertex
-
getSVGIconId
public java.lang.String getSVGIconId(java.lang.String iconKey)
Description copied from interface:IconManager
Returns the icon id assigned to the providediconKey
.- Specified by:
getSVGIconId
in interfaceIconManager
- Parameters:
iconKey
- theiconKey
to look up- Returns:
- the icon id assigned to the provided
iconKey
-
getSVGIconFiles
public java.util.List<java.lang.String> getSVGIconFiles()
Description copied from interface:IconManager
Returns the list of available svg-files, e.g. 'theme://svg/file.svg'.- Specified by:
getSVGIconFiles
in interfaceIconManager
- Returns:
- the list of available svg-files, e.g. 'theme://svg/file.svg'
-
findRepositoryByIconKey
public ConfigurableIconRepository findRepositoryByIconKey(java.lang.String iconKey)
Description copied from interface:IconManager
Returns the firstIconRepository
which has the providediconKey
mapping defined.- Specified by:
findRepositoryByIconKey
in interfaceIconManager
- Parameters:
iconKey
- theiconKey
to look up- Returns:
- the first
IconRepository
which has the providediconKey
mapping defined, ornull
if noIconRepository
exists with the providediconKey
-
-