ONOS-1479 -- GUI - augmenting topology view for extensibility:
- Saving reference code
Change-Id: I26fba7af0dd2d4e4b42581c7ca1b5e98ce1285aa
diff --git a/web/gui/src/main/webapp/_sdh/overlaywork/AppUiTopoOverlay.java b/web/gui/src/main/webapp/_sdh/overlaywork/AppUiTopoOverlay.java
index 494885d..f6a8341 100644
--- a/web/gui/src/main/webapp/_sdh/overlaywork/AppUiTopoOverlay.java
+++ b/web/gui/src/main/webapp/_sdh/overlaywork/AppUiTopoOverlay.java
@@ -18,7 +18,9 @@
package org.meowster.over;
import org.onosproject.ui.UiTopoOverlay;
+import org.onosproject.ui.topo.ButtonDescriptor;
import org.onosproject.ui.topo.PropertyPanel;
+import org.onosproject.ui.topo.TopoConstants.CoreButtons;
import org.onosproject.ui.topo.TopoConstants.Glyphs;
import static org.onosproject.ui.topo.TopoConstants.Properties.*;
@@ -33,8 +35,12 @@
private static final String MY_TITLE = "I changed the title";
private static final String MY_VERSION = "Beta-1.0.0042";
- private static final String FOO = "foo";
- private static final String BAR = "bar";
+
+ private static final ButtonDescriptor FOO_DESCRIPTOR =
+ new ButtonDescriptor("foo", "chain", "A FOO action");
+
+ private static final ButtonDescriptor BAR_DESCRIPTOR =
+ new ButtonDescriptor("bar", "*banner", "A BAR action");
public AppUiTopoOverlay() {
@@ -61,9 +67,12 @@
public void modifyDeviceDetails(PropertyPanel pp) {
pp.title(MY_TITLE);
pp.removeProps(LATITUDE, LONGITUDE);
- pp.addButton(FOO).addButton(BAR);
- }
-// TODO: override more methods, as required...
+ pp.addButton(FOO_DESCRIPTOR)
+ .addButton(BAR_DESCRIPTOR);
+
+ pp.removeButtons(CoreButtons.SHOW_PORT_VIEW)
+ .removeButtons(CoreButtons.SHOW_GROUP_VIEW);
+ }
}
diff --git a/web/gui/src/main/webapp/_sdh/overlaywork/topov.js b/web/gui/src/main/webapp/_sdh/overlaywork/topov.js
index 80a3fa9..0b5eac8 100644
--- a/web/gui/src/main/webapp/_sdh/overlaywork/topov.js
+++ b/web/gui/src/main/webapp/_sdh/overlaywork/topov.js
@@ -30,18 +30,10 @@
activate: activateOverlay,
deactivate: deactivateOverlay,
- // button descriptors - these can be added to overview or detail panels
- buttons: {
- foo: {
- gid: 'chain',
- tt: 'a FOO action',
- cb: fooCb
- },
- bar: {
- gid: '*banner',
- tt: 'a BAR action',
- cb: barCb
- }
+ // button callbacks matching button identifiers
+ buttonActions: {
+ foo: fooCb,
+ bar: barCb
}
};