Moved YANG GUI up the source tree.

Change-Id: I0398f9a0b963942b011acbd74478b053ddad703a
diff --git a/apps/yms/gui/BUCK b/apps/yang-gui/BUCK
similarity index 82%
rename from apps/yms/gui/BUCK
rename to apps/yang-gui/BUCK
index 3d9073e..a3470f8 100644
--- a/apps/yms/gui/BUCK
+++ b/apps/yang-gui/BUCK
@@ -1,5 +1,6 @@
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
+    '//lib:onos-yang-runtime',
 ]
 
 osgi_jar_with_tests (
@@ -13,4 +14,5 @@
     category = 'Utility',
     url = 'http://onosproject.org',
     description = 'YANG Runtime GUI application for visualization of registered YANG models.',
+    required_apps = [ 'org.onosproject.yang' ],
 )
diff --git a/apps/yms/gui/src/main/java/org/onosproject/yms/gui/YangModelMessageHandler.java b/apps/yang-gui/src/main/java/org/onosproject/yang/gui/YangModelMessageHandler.java
similarity index 88%
rename from apps/yms/gui/src/main/java/org/onosproject/yms/gui/YangModelMessageHandler.java
rename to apps/yang-gui/src/main/java/org/onosproject/yang/gui/YangModelMessageHandler.java
index 1dca6f4..475b105 100644
--- a/apps/yms/gui/src/main/java/org/onosproject/yms/gui/YangModelMessageHandler.java
+++ b/apps/yang-gui/src/main/java/org/onosproject/yang/gui/YangModelMessageHandler.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.yms.gui;
+package org.onosproject.yang.gui;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.google.common.collect.ImmutableSet;
@@ -24,13 +24,15 @@
 import org.onosproject.ui.UiMessageHandler;
 import org.onosproject.ui.table.TableModel;
 import org.onosproject.ui.table.TableRequestHandler;
+import org.onosproject.yang.model.YangModel;
+import org.onosproject.yang.runtime.YangModelRegistry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.Collection;
 
 /**
- * ONOS UI Yang Models message handler.
+ * ONOS UI YANG Models message handler.
  */
 public class YangModelMessageHandler extends UiMessageHandler {
 
@@ -53,7 +55,7 @@
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-//    private YmsService ymsService;
+    private YangModelRegistry modelRegistry;
     // TODO: fill out other fields as necessary
 
 
@@ -62,7 +64,7 @@
     @Override
     public void init(UiConnection connection, ServiceDirectory directory) {
         super.init(connection, directory);
-//        ymsService = directory.get(YmsService.class);
+        modelRegistry = directory.get(YangModelRegistry.class);
         // TODO: addListeners(); ???
     }
 
@@ -102,17 +104,15 @@
 
         @Override
         protected void populateTable(TableModel tm, ObjectNode payload) {
-            // TODO: use ymsService(?) to iterate over list of models...
-            for (int k = 0; k < 5; k++) {
-                populateRow(tm.addRow(), k);
+            for (YangModel model : modelRegistry.getModels()) {
+                populateRow(tm.addRow(), model.getYangModulesId().toString());
             }
         }
 
         // TODO: obviously, this should be adapted to arrange YANG model data
         //       into the appropriate table columns
-        private void populateRow(TableModel.Row row, int k) {
-            row.cell(ID, k)
-                    .cell(TYPE, "ymtype-" + k);
+        private void populateRow(TableModel.Row row, String k) {
+            row.cell(ID, k).cell(TYPE, k);
         }
     }
 
diff --git a/apps/yms/gui/src/main/java/org/onosproject/yms/gui/YangModelUiComponent.java b/apps/yang-gui/src/main/java/org/onosproject/yang/gui/YangModelUiComponent.java
similarity index 98%
rename from apps/yms/gui/src/main/java/org/onosproject/yms/gui/YangModelUiComponent.java
rename to apps/yang-gui/src/main/java/org/onosproject/yang/gui/YangModelUiComponent.java
index c3f883e..b4d9697 100644
--- a/apps/yms/gui/src/main/java/org/onosproject/yms/gui/YangModelUiComponent.java
+++ b/apps/yang-gui/src/main/java/org/onosproject/yang/gui/YangModelUiComponent.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.yms.gui;
+package org.onosproject.yang.gui;
 
 import com.google.common.collect.ImmutableList;
 import org.apache.felix.scr.annotations.Activate;
diff --git a/apps/yms/gui/src/main/java/org/onosproject/yms/gui/package-info.java b/apps/yang-gui/src/main/java/org/onosproject/yang/gui/package-info.java
similarity index 95%
rename from apps/yms/gui/src/main/java/org/onosproject/yms/gui/package-info.java
rename to apps/yang-gui/src/main/java/org/onosproject/yang/gui/package-info.java
index 5ec2d11..e7f96ab 100644
--- a/apps/yms/gui/src/main/java/org/onosproject/yms/gui/package-info.java
+++ b/apps/yang-gui/src/main/java/org/onosproject/yang/gui/package-info.java
@@ -17,4 +17,4 @@
 /**
  * GUI elements for YANG Runtime &amp; Live YANG Compiler subsystem.
  */
-package org.onosproject.yms.gui;
\ No newline at end of file
+package org.onosproject.yang.gui;
\ No newline at end of file
diff --git a/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel-theme.css b/apps/yang-gui/src/main/resources/app/view/yangModel/yangModel-theme.css
similarity index 100%
rename from apps/yms/gui/src/main/resources/app/view/yangModel/yangModel-theme.css
rename to apps/yang-gui/src/main/resources/app/view/yangModel/yangModel-theme.css
diff --git a/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.css b/apps/yang-gui/src/main/resources/app/view/yangModel/yangModel.css
similarity index 100%
rename from apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.css
rename to apps/yang-gui/src/main/resources/app/view/yangModel/yangModel.css
diff --git a/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.html b/apps/yang-gui/src/main/resources/app/view/yangModel/yangModel.html
similarity index 100%
rename from apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.html
rename to apps/yang-gui/src/main/resources/app/view/yangModel/yangModel.html
diff --git a/apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.js b/apps/yang-gui/src/main/resources/app/view/yangModel/yangModel.js
similarity index 100%
rename from apps/yms/gui/src/main/resources/app/view/yangModel/yangModel.js
rename to apps/yang-gui/src/main/resources/app/view/yangModel/yangModel.js
diff --git a/apps/yms/gui/src/main/resources/yangModel/css.html b/apps/yang-gui/src/main/resources/yangModel/css.html
similarity index 100%
rename from apps/yms/gui/src/main/resources/yangModel/css.html
rename to apps/yang-gui/src/main/resources/yangModel/css.html
diff --git a/apps/yms/gui/src/main/resources/yangModel/js.html b/apps/yang-gui/src/main/resources/yangModel/js.html
similarity index 100%
rename from apps/yms/gui/src/main/resources/yangModel/js.html
rename to apps/yang-gui/src/main/resources/yangModel/js.html
diff --git a/apps/yang/BUCK b/apps/yang/BUCK
index 41fa681..7af28b0 100644
--- a/apps/yang/BUCK
+++ b/apps/yang/BUCK
@@ -17,7 +17,7 @@
 )
 
 onos_app (
-    title = 'ONOS YANG Extension',
+    title = 'YANG Compiler and Runtime',
     category = 'Utility',
     url = 'http://onosproject.org',
     description = 'Base application to bring in the YANG libraries and assemble them for other apps to use.',