IconService.get can take entities now, not just the symbolic name
diff --git a/ui-modules/app-inspector/app/components/entity-tree/entity-tree.directive.js b/ui-modules/app-inspector/app/components/entity-tree/entity-tree.directive.js
index b3f7c25..a151ce7 100644
--- a/ui-modules/app-inspector/app/components/entity-tree/entity-tree.directive.js
+++ b/ui-modules/app-inspector/app/components/entity-tree/entity-tree.directive.js
@@ -78,11 +78,7 @@
                 vm.applications = response.data;
 
                 function spawnNotification(app, opts) {
-                    let baseType = app.type;
-                    if (baseType === 'org.apache.brooklyn.entity.stock.BasicApplication' && app.children.length === 1) {
-                        baseType = app.children[0].catalogItemId || app.children[0].type;
-                    }
-                    iconService.get(baseType).then((icon)=> {
+                    iconService.get(app).then((icon)=> {
                         let options = Object.assign({
                             icon: app.iconUrl || icon,
                         }, opts);
@@ -101,7 +97,7 @@
     }
 }
 
-export function entityNodeDirective() {
+export function entityNodeDirective($log, iconService) {
     return {
         restrict: 'E',
         template: entityNodeTemplate,
@@ -191,3 +187,4 @@
 
     }
 }
+entityNodeDirective.$inject = ['$log', 'iconService'];
diff --git a/ui-modules/utils/icon-generator/icon-generator.js b/ui-modules/utils/icon-generator/icon-generator.js
index 682af6b..cdf4325 100644
--- a/ui-modules/utils/icon-generator/icon-generator.js
+++ b/ui-modules/utils/icon-generator/icon-generator.js
@@ -104,21 +104,45 @@
 
 export function iconServiceProvider() {
     return {
-        $get: ['$q', '$http', 'iconGenerator', function ($q, $http, iconGenerator) {
-            return new IconService($q, $http, iconGenerator, new SessionsStorageWrapper(CACHE_NAME));
+        $get: ['$q', '$http', 'iconGenerator', '$log', function ($q, $http, iconGenerator, $log) {
+            return new IconService($q, $http, iconGenerator, $log, new SessionsStorageWrapper(CACHE_NAME));
         }]
     }
 }
 
-function IconService($q, $http, iconGenerator, cache) {
+function IconService($q, $http, iconGenerator, $log, cache) {
     this.get = getIcon;
-    function getIcon(id) {
+    function getIcon(entityOrTypeId, doNotAutogenerate) {
         let deferred = $q.defer();
+
+        let id;
+        if (typeof entityOrTypeId === 'string') {
+            id = entityOrTypeId;
+        } else if (typeof entityOrTypeId === 'object') {
+            if (entityOrTypeId.iconUrl) {
+                deferred.resolve(entityOrTypeId.iconUrl);
+                return deferred.promise;
+            }
+            if (entityOrTypeId.catalogItemId) {
+                id = entity.catalogItemId;
+            } else if (entityOrTypeId.symbolicName) {
+                id = entity.symbolicName;
+            } else if (entityOrTypeId.type) {
+                let entity = entityOrTypeId;
+                id = entity.type;
+                    if (id === 'org.apache.brooklyn.entity.stock.BasicApplication' && entity.children.length === 1) {
+                    id = entity.children[0].catalogItemId || entity.children[0].type;
+                }
+            }
+        }
+        
         let icon;
         if (angular.isDefined(id)) {
             icon = cache.get(id);
         } else {
-            deferred.reject('Icon ID no defined');
+            $log.warn('No ID found for item, cannot make icon - '+entityOrTypeId, entityOrTypeId);
+            deferred.reject('No ID found for item, cannot make icon - '+entityOrTypeId);
+            return deferred.promise;
         }
         if (angular.isUndefined(icon)) {
             let path = id.split(':');
@@ -130,6 +154,8 @@
                 if (response.data.hasOwnProperty('iconUrl')) {
                     icon = response.data.iconUrl;
                     cache.put(id, icon);
+                } else if (doNotAutogenerate) {
+                    icon = null;
                 } else {
                     icon = iconGenerator(id);
                 }