Example usage for com.vaadin.ui FormLayout FormLayout

List of usage examples for com.vaadin.ui FormLayout FormLayout

Introduction

In this page you can find the example usage for com.vaadin.ui FormLayout FormLayout.

Prototype

public FormLayout() 

Source Link

Usage

From source file:org.opennms.features.topology.app.internal.ui.info.DefaultEdgeInfoPanelItem.java

License:Open Source License

@Override
protected Component getComponent(EdgeRef ref, GraphContainer container) {
    FormLayout formLayout = new FormLayout();
    formLayout.setSpacing(false);//from  ww w  . j a  v a2s  . c  o  m
    formLayout.setMargin(false);

    if (ref instanceof AbstractEdge) {
        AbstractEdge edge = (AbstractEdge) ref;

        formLayout.addComponent(createLabel("Source", edge.getSource().getVertex().getLabel()));
        formLayout.addComponent(createLabel("Target", edge.getTarget().getVertex().getLabel()));
    }

    return formLayout;
}

From source file:org.opennms.features.topology.app.internal.ui.info.DefaultEdgeInfoPanelItemProvider.java

License:Open Source License

private Component createComponent(EdgeRef ref) {
    FormLayout formLayout = new FormLayout();
    formLayout.setSpacing(false);/*www.  j a v a2 s  .  c om*/
    formLayout.setMargin(false);

    if (ref instanceof AbstractEdge) {
        AbstractEdge edge = (AbstractEdge) ref;

        formLayout.addComponent(createLabel("Source", edge.getSource().getVertex().getLabel()));
        formLayout.addComponent(createLabel("Target", edge.getTarget().getVertex().getLabel()));
    }

    return formLayout;
}

From source file:org.opennms.features.topology.app.internal.ui.info.DefaultVertexInfoPanelItem.java

License:Open Source License

@Override
protected Component getComponent(VertexRef ref, GraphContainer container) {
    FormLayout formLayout = new FormLayout();
    formLayout.setSpacing(false);/*  ww  w  .j  ava 2  s.com*/
    formLayout.setMargin(false);

    formLayout.addComponent(createLabel("Name", ref.getLabel()));
    formLayout.addComponent(createLabel("ID", String.format("%s:%s", ref.getNamespace(), ref.getId())));

    if (ref instanceof AbstractVertex) {
        AbstractVertex vertex = (AbstractVertex) ref;

        formLayout.addComponent(createLabel("Icon Key", vertex.getIconKey()));

        if (vertex.getIpAddress() != null) {
            formLayout.addComponent(createLabel("IP Address", vertex.getIpAddress()));
        }
    }

    return formLayout;
}

From source file:org.opennms.features.topology.app.internal.ui.info.DefaultVertexInfoPanelItemProvider.java

License:Open Source License

private Component createComponent(VertexRef ref) {
    FormLayout formLayout = new FormLayout();
    formLayout.setSpacing(false);/*from   ww w  .java 2 s.  com*/
    formLayout.setMargin(false);

    formLayout.addComponent(createLabel("Name", ref.getLabel()));
    formLayout.addComponent(createLabel("ID", String.format("%s:%s", ref.getNamespace(), ref.getId())));

    if (ref instanceof AbstractVertex) {
        AbstractVertex vertex = (AbstractVertex) ref;

        formLayout.addComponent(createLabel("Icon Key", vertex.getIconKey()));

        if (vertex.getIpAddress() != null) {
            formLayout.addComponent(createLabel("IP Address", vertex.getIpAddress()));
        }
    }

    return formLayout;
}

From source file:org.opennms.features.topology.app.internal.ui.info.NodeInfoPanelItem.java

License:Open Source License

@Override
protected Component getComponent(VertexRef ref, GraphContainer container) {
    if (ref instanceof AbstractVertex && ((AbstractVertex) ref).getNodeID() != null) {
        AbstractVertex vertex = ((AbstractVertex) ref);
        OnmsNode node = nodeDao.get(vertex.getNodeID());

        if (node != null) {
            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(vertex.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()));
            }/*  w  w  w  .  j  a v a2  s.  c o  m*/

            return formLayout;
        }
    }

    return null;
}

From source file:org.opennms.features.topology.app.internal.ui.info.NodeInfoPanelItemProvider.java

License:Open Source License

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);/*from   w  w w  .j  a  v a  2s  .co m*/
    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;
}

From source file:org.opennms.features.topology.plugins.topo.bsm.info.BusinessServiceEdgeInfoPanelItem.java

License:Open Source License

@Override
protected Component getComponent(EdgeRef ref, GraphContainer container) {
    FormLayout formLayout = new FormLayout();
    formLayout.setMargin(false);/*from  w  w w .  ja va2s. co m*/
    formLayout.setSpacing(false);

    final BusinessServiceEdge businessServiceEdge = ((BusinessServiceEdge) ref);
    formLayout.addComponent(
            createLabel("Map Function", describeMapFunction(businessServiceEdge.getMapFunction())));
    formLayout.addComponent(createLabel("Weight", Float.toString(businessServiceEdge.getWeight())));

    return formLayout;
}

From source file:org.opennms.features.topology.plugins.topo.bsm.info.BusinessServiceEdgeInfoPanelItemProvider.java

License:Open Source License

private Component createComponent(BusinessServiceEdge ref) {
    FormLayout formLayout = new FormLayout();
    formLayout.setMargin(false);/* www . ja v  a 2 s .c  o  m*/
    formLayout.setSpacing(false);

    formLayout.addComponent(createLabel("Map Function", describeMapFunction(ref.getMapFunction())));
    formLayout.addComponent(createLabel("Weight", Float.toString(ref.getWeight())));

    return formLayout;
}

From source file:org.opennms.features.topology.plugins.topo.bsm.info.BusinessServiceEdgeStatusInfoPanelItem.java

License:Open Source License

@Override
protected Component getComponent(EdgeRef ref, GraphContainer container) {
    FormLayout formLayout = new FormLayout();
    formLayout.setMargin(false);//from ww w.ja va 2 s  .c  om
    formLayout.setSpacing(false);
    formLayout.addStyleName("severity");

    final BusinessServiceEdge businessServiceEdge = ((BusinessServiceEdge) ref);

    final BusinessServiceStateMachine stateMachine = SimulationAwareStateMachineFactory
            .createStateMachine(businessServiceManager, container.getCriteria());
    final Status outgoingStatus = BusinessServicesStatusProvider.getStatus(stateMachine, businessServiceEdge);
    final Status incomingStatus = BusinessServicesStatusProvider.getStatus(stateMachine,
            ((AbstractBusinessServiceVertex) businessServiceEdge.getTarget().getVertex()));

    formLayout.addComponent(createStatusLabel("Outgoing Severity", outgoingStatus));
    formLayout.addComponent(createStatusLabel("Incoming Severity", incomingStatus));

    return formLayout;
}

From source file:org.opennms.features.topology.plugins.topo.bsm.info.BusinessServiceEdgeStatusInfoPanelItemProvider.java

License:Open Source License

private Component createComponent(BusinessServiceEdge ref, GraphContainer container) {
    FormLayout formLayout = new FormLayout();
    formLayout.setMargin(false);//from   w  ww.  j  av a 2s.  c  o m
    formLayout.setSpacing(false);
    formLayout.addStyleName("severity");

    final BusinessServiceStateMachine stateMachine = SimulationAwareStateMachineFactory
            .createStateMachine(businessServiceManager, container.getCriteria());
    final Status outgoingStatus = BusinessServicesStatusProvider.getStatus(stateMachine, ref);
    final Status incomingStatus = BusinessServicesStatusProvider.getStatus(stateMachine,
            ((AbstractBusinessServiceVertex) ref.getTarget().getVertex()));

    formLayout.addComponent(createStatusLabel("Outgoing Severity", outgoingStatus));
    formLayout.addComponent(createStatusLabel("Incoming Severity", incomingStatus));

    return formLayout;
}