Class DefaultIconRepository
- java.lang.Object
-
- org.opennms.features.topology.api.support.DefaultIconRepository
-
- All Implemented Interfaces:
ConfigurableIconRepository
,IconRepository
,org.osgi.service.cm.ManagedService
public class DefaultIconRepository extends java.lang.Object implements ConfigurableIconRepository, org.osgi.service.cm.ManagedService
-
-
Constructor Summary
Constructors Constructor Description DefaultIconRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIconMapping(java.lang.String iconKey, java.lang.String iconId)
Adds a custom icon mapping.boolean
contains(java.lang.String iconKey)
Verifies if a mapping for the provided icon Key is defined.java.lang.String
getSVGIconId(java.lang.String iconKey)
Maps the providediconKey
to an SVG id element.void
removeIconMapping(java.lang.String iconKey)
Removes the giveniconKey
from thisIconRepository
.void
save()
Persists thisIconRepository
.void
updated(java.util.Dictionary<java.lang.String,?> properties)
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.String iconKey)
Description copied from interface:IconRepository
Verifies if a mapping for the provided icon Key is defined.- Specified by:
contains
in interfaceIconRepository
- Parameters:
iconKey
- the icon key- Returns:
- true if a mapping is defined, false otherwise.
-
getSVGIconId
public java.lang.String getSVGIconId(java.lang.String iconKey)
Description copied from interface:IconRepository
Maps the providediconKey
to an SVG id element. If no mapping is defined,null
is returned.- Specified by:
getSVGIconId
in interfaceIconRepository
- Parameters:
iconKey
- The icon key to look up- Returns:
- The icon id, or null if no mapping is defined.
-
addIconMapping
public void addIconMapping(java.lang.String iconKey, java.lang.String iconId)
Description copied from interface:ConfigurableIconRepository
Adds a custom icon mapping. TheiconKey
must be unique in thisIconRepository
.- Specified by:
addIconMapping
in interfaceConfigurableIconRepository
- Parameters:
iconKey
- The icon keyiconId
- The icon id for the icon key
-
removeIconMapping
public void removeIconMapping(java.lang.String iconKey)
Description copied from interface:ConfigurableIconRepository
Removes the giveniconKey
from thisIconRepository
.- Specified by:
removeIconMapping
in interfaceConfigurableIconRepository
- Parameters:
iconKey
- The icon key to remove
-
save
public void save()
Description copied from interface:ConfigurableIconRepository
Persists thisIconRepository
. Should be invoked if changes to thisIconRepository
should be persisted permanently (e.g. on disk)- Specified by:
save
in interfaceConfigurableIconRepository
-
updated
public void updated(java.util.Dictionary<java.lang.String,?> properties) throws org.osgi.service.cm.ConfigurationException
- Specified by:
updated
in interfaceorg.osgi.service.cm.ManagedService
- Throws:
org.osgi.service.cm.ConfigurationException
-
-