Example usage for com.vaadin.ui FormLayout addStyleName

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

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

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  w ww.  jav  a  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  2 s  . 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;
}

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

License:Open Source License

@Override
protected Component getComponent(VertexRef ref, GraphContainer container) {
    final BusinessServiceVertex vertex = (BusinessServiceVertex) ref;

    final FormLayout rootLayout = new FormLayout();
    rootLayout.setSizeFull();/*from   ww w .  ja va2s  .c  o  m*/
    rootLayout.setSpacing(false);
    rootLayout.setMargin(false);
    rootLayout.addStyleName("severity");

    final BusinessServiceStateMachine stateMachine = SimulationAwareStateMachineFactory
            .createStateMachine(businessServiceManager, container.getCriteria());
    final Status overallStatus = BusinessServicesStatusProvider.getStatus(stateMachine, vertex);
    rootLayout.addComponent(createStatusLabel("Overall", overallStatus));
    rootLayout.addComponent(new Label());

    final BusinessServiceGraph graph = stateMachine.getGraph();
    final BusinessService businessService = businessServiceManager
            .getBusinessServiceById(vertex.getServiceId());
    final Set<GraphVertex> impactingVertices = getImpactingVertices(stateMachine, graph, businessService);
    for (final Edge edge : businessService.getEdges()) {
        // Get the topology vertex for the child to determine the display label
        final Vertex childVertex = businessServicesTopologyProvider
                .getVertex(edge.accept(new EdgeVisitor<VertexRef>() {
                    @Override
                    public VertexRef visit(final IpServiceEdge edge) {
                        return new IpServiceVertex(edge.getIpService(), 0);
                    }

                    @Override
                    public VertexRef visit(final ReductionKeyEdge edge) {
                        return new ReductionKeyVertex(edge.getReductionKey(), 0);
                    }

                    @Override
                    public VertexRef visit(final ChildEdge edge) {
                        return new BusinessServiceVertex(edge.getChild(), 0);
                    }
                }));
        final Status edgeStatus = stateMachine.getOperationalStatus(edge);

        rootLayout.addComponent(createStatusLabel(childVertex.getLabel(), edgeStatus, String.format(
                "%s &times; %d <i class=\"pull-right glyphicon %s\"></i>", edgeStatus.getLabel(),
                edge.getWeight(),
                impactingVertices.contains(graph.getVertexByEdgeId(edge.getId())) ? "glyphicon-flash" : "")));
    }

    return rootLayout;
}

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

License:Open Source License

private Component createComponent(BusinessServiceVertex vertex, GraphContainer container) {
    final FormLayout rootLayout = new FormLayout();
    rootLayout.setSizeFull();//from  w  w w.  ja v a2 s .  c o  m
    rootLayout.setSpacing(false);
    rootLayout.setMargin(false);
    rootLayout.addStyleName("severity");

    final BusinessServiceStateMachine stateMachine = SimulationAwareStateMachineFactory
            .createStateMachine(businessServiceManager, container.getCriteria());
    final Status overallStatus = BusinessServicesStatusProvider.getStatus(stateMachine, vertex);
    rootLayout.addComponent(createStatusLabel("Overall", overallStatus));
    rootLayout.addComponent(new Label());

    final BusinessServiceGraph graph = stateMachine.getGraph();
    final BusinessService businessService = businessServiceManager
            .getBusinessServiceById(vertex.getServiceId());
    final Set<GraphVertex> impactingVertices = getImpactingVertices(stateMachine, graph, businessService);
    for (final Edge edge : businessService.getEdges()) {
        // Get the topology vertex for the child to determine the display label
        final Vertex childVertex = businessServicesTopologyProvider
                .getVertex(edge.accept(new EdgeVisitor<VertexRef>() {
                    @Override
                    public VertexRef visit(final IpServiceEdge edge) {
                        return new IpServiceVertex(edge.getIpService(), 0);
                    }

                    @Override
                    public VertexRef visit(final ReductionKeyEdge edge) {
                        return new ReductionKeyVertex(edge.getReductionKey(), 0);
                    }

                    @Override
                    public VertexRef visit(final ChildEdge edge) {
                        return new BusinessServiceVertex(edge.getChild(), 0);
                    }
                }));
        final Status edgeStatus = stateMachine.getOperationalStatus(edge);

        rootLayout.addComponent(createStatusLabel(childVertex.getLabel(), edgeStatus, String.format(
                "%s &times; %d <i class=\"pull-right glyphicon %s\"></i>", edgeStatus.getLabel(),
                edge.getWeight(),
                impactingVertices.contains(graph.getVertexByEdgeId(edge.getId())) ? "glyphicon-flash" : "")));
    }

    return rootLayout;
}