Search in sources :

Example 1 with NodeInfoWindow

use of org.opennms.features.topology.app.internal.ui.NodeInfoWindow in project opennms by OpenNMS.

the class NodeInfoPanelItemProvider method createComponent.

private Component createComponent(AbstractVertex ref) {
    Preconditions.checkState(ref.getNodeID() != null, "no Node ID defined.");
    OnmsNode node = nodeDao.get(ref.getNodeID());
    FormLayout formLayout = new FormLayout();
    formLayout.setSpacing(false);
    formLayout.setMargin(false);
    formLayout.addComponent(createLabel("Node ID", "" + node.getId()));
    final HorizontalLayout nodeButtonLayout = new HorizontalLayout();
    Button nodeButton = createButton(node.getLabel(), null, null, event -> new NodeInfoWindow(ref.getNodeID()).open());
    nodeButton.setStyleName(BaseTheme.BUTTON_LINK);
    nodeButtonLayout.addComponent(nodeButton);
    nodeButtonLayout.setCaption("Node Label");
    formLayout.addComponent(nodeButtonLayout);
    if (!Strings.isNullOrEmpty(node.getSysObjectId())) {
        formLayout.addComponent(createLabel("Enterprise OID", node.getSysObjectId()));
    }
    return formLayout;
}
Also used : FormLayout(com.vaadin.ui.FormLayout) OnmsNode(org.opennms.netmgt.model.OnmsNode) Button(com.vaadin.ui.Button) UIHelper.createButton(org.opennms.netmgt.vaadin.core.UIHelper.createButton) NodeInfoWindow(org.opennms.features.topology.app.internal.ui.NodeInfoWindow) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

Button (com.vaadin.ui.Button)1 FormLayout (com.vaadin.ui.FormLayout)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1 NodeInfoWindow (org.opennms.features.topology.app.internal.ui.NodeInfoWindow)1 OnmsNode (org.opennms.netmgt.model.OnmsNode)1 UIHelper.createButton (org.opennms.netmgt.vaadin.core.UIHelper.createButton)1