class GeoPackageLayerActivationHandler extends AbstractActivationListener {

    @Override
    public void handleCommit(boolean active, DataGroupInfo dgi, PhasedTaskCanceller canceller)
    {
        super.handleCommit(active, dgi, canceller);
        if (dgi == null)
        {
            return;
        }
        for (DataTypeInfo info : dgi.getMembers(false))
        {
            if (info instanceof GeoPackageDataTypeInfo)
            {
                GeoPackageDataTypeInfo geopackageInfo = (GeoPackageDataTypeInfo)info;
                GeoPackageLayer layer = geopackageInfo.getLayer();
                if (layer.getLayerType() == LayerType.TILE)
                {
                    if (active)
                    {
                        myTileListener.layerActivated(geopackageInfo);
                    }
                    else
                    {
                        myTileListener.layerDeactivated(geopackageInfo);
                    }
                }
                else if (layer.getLayerType() == LayerType.FEATURE && canceller != null)
                {
                    if (active)
                    {
                        myFeatureLayerListener.layerActivated(geopackageInfo);
                    }
                    else
                    {
                        myFeatureLayerListener.layerDeactivated(geopackageInfo);
                    }
                }
            }
        }
    }

    public  GeoPackageLayerActivationHandler(EventManager eventManager, LayerActivationListener tileLayerListener,
            LayerActivationListener featureLayerListener);

}