Simon Hunt

ONOS-1479 -- GUI - augmenting topology view for extensibility:

- Saving reference code

Change-Id: I26fba7af0dd2d4e4b42581c7ca1b5e98ce1285aa
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
18 package org.meowster.over; 18 package org.meowster.over;
19 19
20 import org.onosproject.ui.UiTopoOverlay; 20 import org.onosproject.ui.UiTopoOverlay;
21 +import org.onosproject.ui.topo.ButtonDescriptor;
21 import org.onosproject.ui.topo.PropertyPanel; 22 import org.onosproject.ui.topo.PropertyPanel;
23 +import org.onosproject.ui.topo.TopoConstants.CoreButtons;
22 import org.onosproject.ui.topo.TopoConstants.Glyphs; 24 import org.onosproject.ui.topo.TopoConstants.Glyphs;
23 25
24 import static org.onosproject.ui.topo.TopoConstants.Properties.*; 26 import static org.onosproject.ui.topo.TopoConstants.Properties.*;
...@@ -33,8 +35,12 @@ public class AppUiTopoOverlay extends UiTopoOverlay { ...@@ -33,8 +35,12 @@ public class AppUiTopoOverlay extends UiTopoOverlay {
33 35
34 private static final String MY_TITLE = "I changed the title"; 36 private static final String MY_TITLE = "I changed the title";
35 private static final String MY_VERSION = "Beta-1.0.0042"; 37 private static final String MY_VERSION = "Beta-1.0.0042";
36 - private static final String FOO = "foo"; 38 +
37 - private static final String BAR = "bar"; 39 + private static final ButtonDescriptor FOO_DESCRIPTOR =
40 + new ButtonDescriptor("foo", "chain", "A FOO action");
41 +
42 + private static final ButtonDescriptor BAR_DESCRIPTOR =
43 + new ButtonDescriptor("bar", "*banner", "A BAR action");
38 44
39 45
40 public AppUiTopoOverlay() { 46 public AppUiTopoOverlay() {
...@@ -61,9 +67,12 @@ public class AppUiTopoOverlay extends UiTopoOverlay { ...@@ -61,9 +67,12 @@ public class AppUiTopoOverlay extends UiTopoOverlay {
61 public void modifyDeviceDetails(PropertyPanel pp) { 67 public void modifyDeviceDetails(PropertyPanel pp) {
62 pp.title(MY_TITLE); 68 pp.title(MY_TITLE);
63 pp.removeProps(LATITUDE, LONGITUDE); 69 pp.removeProps(LATITUDE, LONGITUDE);
64 - pp.addButton(FOO).addButton(BAR);
65 - }
66 70
67 -// TODO: override more methods, as required... 71 + pp.addButton(FOO_DESCRIPTOR)
72 + .addButton(BAR_DESCRIPTOR);
73 +
74 + pp.removeButtons(CoreButtons.SHOW_PORT_VIEW)
75 + .removeButtons(CoreButtons.SHOW_GROUP_VIEW);
76 + }
68 77
69 } 78 }
......
...@@ -30,18 +30,10 @@ ...@@ -30,18 +30,10 @@
30 activate: activateOverlay, 30 activate: activateOverlay,
31 deactivate: deactivateOverlay, 31 deactivate: deactivateOverlay,
32 32
33 - // button descriptors - these can be added to overview or detail panels 33 + // button callbacks matching button identifiers
34 - buttons: { 34 + buttonActions: {
35 - foo: { 35 + foo: fooCb,
36 - gid: 'chain', 36 + bar: barCb
37 - tt: 'a FOO action',
38 - cb: fooCb
39 - },
40 - bar: {
41 - gid: '*banner',
42 - tt: 'a BAR action',
43 - cb: barCb
44 - }
45 } 37 }
46 }; 38 };
47 39
......