Search in sources :

Example 16 with Label

use of com.vaadin.ui.Label in project opennms by OpenNMS.

the class UIHelper method createLabel.

public static Label createLabel(String caption, String content) {
    Label label = new Label(content);
    label.setCaption(caption);
    return label;
}
Also used : Label(com.vaadin.ui.Label)

Example 17 with Label

use of com.vaadin.ui.Label in project opennms by OpenNMS.

the class BusinessServiceVertexStatusInfoPanelItemProvider method createStatusLabel.

public static Label createStatusLabel(final String caption, final Status status, final String text) {
    final Label label = createLabel(caption, text);
    label.setContentMode(ContentMode.HTML);
    label.addStyleName("severity-" + status.toString().toLowerCase());
    label.addStyleName("bright");
    return label;
}
Also used : Label(com.vaadin.ui.Label) UIHelper.createLabel(org.opennms.netmgt.vaadin.core.UIHelper.createLabel)

Example 18 with Label

use of com.vaadin.ui.Label in project opennms by OpenNMS.

the class SimulationModeEnabledPanelItemProvider method createComponent.

private Component createComponent() {
    Label label = new Label("Simulation Mode Enabled");
    label.setDescription("Simulation Mode is enabled");
    label.setIcon(FontAwesome.EXCLAMATION_TRIANGLE);
    label.addStyleName("warning");
    HorizontalLayout layout = new HorizontalLayout();
    layout.addComponent(label);
    layout.addStyleName("simulation");
    return layout;
}
Also used : Label(com.vaadin.ui.Label) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 19 with Label

use of com.vaadin.ui.Label in project opennms by OpenNMS.

the class SeverityGenerator method generateCell.

@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
    Property<OnmsSeverity> property = source.getContainerProperty(itemId, columnId);
    if (property == null || property.getValue() == null) {
        return null;
    } else {
        OnmsSeverity severity = property.getValue();
        String label = severity.getLabel();
        label = label.toLowerCase();
        label = new String(label.substring(0, 1)).toUpperCase() + label.substring(1);
        return new Label("&nbsp;&nbsp;&nbsp;&nbsp;" + escapeHtml(label), Label.CONTENT_XML);
    }
}
Also used : OnmsSeverity(org.opennms.netmgt.model.OnmsSeverity) Label(com.vaadin.ui.Label)

Example 20 with Label

use of com.vaadin.ui.Label in project opennms by OpenNMS.

the class SurveillanceView method setView.

/**
     * Set the view to be displayed by this component.
     *
     * @param view the view to be displayed
     */
public void setView(View view) {
    /**
         * set the field
         */
    m_view = view;
    /**
         * check whether refreshing is enabled
         */
    m_refreshEnabled = (m_view.getRefreshSeconds() > 0);
    m_countdown = m_view.getRefreshSeconds();
    /**
         * alter the table header
         */
    m_surveillanceViewTableHeader.setCaptionText("Surveillance view: " + m_view.getName());
    m_surveillanceViewTableHeader.select(m_view.getName());
    m_surveillanceViewTableHeader.getNativeSelect().setEnabled(m_enabled);
    /**
         * remove old components
         */
    removeAllComponents();
    /**
         * create the layout
         */
    upperLayout = new VerticalLayout();
    upperLayout.setId("surveillance-window");
    upperLayout.setSpacing(false);
    /**
         * create surveillance view table...
         */
    m_surveillanceViewTable = new SurveillanceViewTable(m_view, m_surveillanceViewService, m_dashboard, m_enabled);
    /**
         * ...and add the header and the table itself
         */
    upperLayout.addComponent(new Label("<div id=\"surveillanceview\"/>", ContentMode.HTML));
    upperLayout.addComponent(m_surveillanceViewTableHeader);
    upperLayout.addComponent(m_surveillanceViewTable);
    if (!m_dashboard) {
        addComponent(upperLayout);
    } else {
        /**
             * if dashboard should be displayed add the detail tables and components
             */
        CssLayout leftCssLayout = new CssLayout() {

            @Override
            protected String getCss(Component c) {
                return "padding-bottom: 6px;";
            }
        };
        leftCssLayout.setPrimaryStyleName("col-md-11");
        leftCssLayout.setId("dashboard-content");
        CssLayout rightCssLayout = new CssLayout();
        rightCssLayout.setPrimaryStyleName("col-md-1");
        lowerLayout = new VerticalLayout();
        lowerLayout.setSpacing(true);
        /**
             * create the tables and components
             */
        SurveillanceViewAlarmTable surveillanceViewAlarmTable = new SurveillanceViewAlarmTable(m_surveillanceViewService, m_enabled);
        SurveillanceViewNotificationTable surveillanceViewNotificationTable = new SurveillanceViewNotificationTable(m_surveillanceViewService, m_enabled);
        SurveillanceViewNodeRtcTable surveillanceViewNodeRtcTable = new SurveillanceViewNodeRtcTable(m_surveillanceViewService, m_enabled);
        SurveillanceViewGraphComponent surveillanceViewGraphComponent = new SurveillanceViewGraphComponent(m_surveillanceViewService, m_enabled);
        /**
             * add them to the layout
             */
        surveillanceViewAlarmTable.setId("alarms");
        lowerLayout.addComponent(surveillanceViewAlarmTable);
        surveillanceViewNotificationTable.setId("notifications");
        lowerLayout.addComponent(surveillanceViewNotificationTable);
        surveillanceViewNodeRtcTable.setId("outages");
        lowerLayout.addComponent(surveillanceViewNodeRtcTable);
        surveillanceViewGraphComponent.setId("resourcegraphs");
        lowerLayout.addComponent(surveillanceViewGraphComponent);
        /**
             * associate the detail tables and components with the surveillance view table
             */
        m_surveillanceViewTable.addDetailsTable(surveillanceViewAlarmTable);
        m_surveillanceViewTable.addDetailsTable(surveillanceViewNotificationTable);
        m_surveillanceViewTable.addDetailsTable(surveillanceViewNodeRtcTable);
        m_surveillanceViewTable.addDetailsTable(surveillanceViewGraphComponent);
        /**
             * add the layout to this component
             */
        addComponent(lowerLayout);
        leftCssLayout.addComponent(upperLayout);
        leftCssLayout.addComponent(lowerLayout);
        CssLayout resultsSidebar = new CssLayout();
        resultsSidebar.setPrimaryStyleName("resource-graphs-sidebar hidden-print hidden-xs hidden-sm sidebar-fixed");
        resultsSidebar.setId("results-sidebar");
        resultsSidebar.addComponent(new Label("<ul class=\"nav nav-stacked\">\n" + "                <li>\n" + "                    <a href=\"#surveillanceview\" data-target=\"#surveillanceview\">Surveillance View</a>\n" + "                </li>\n" + "                <li>\n" + "                    <a href=\"#alarms\" data-target=\"#alarms\">Alarms</a>\n" + "                </li>\n" + "                <li>\n" + "                    <a href=\"#notifications\" data-target=\"#notifications\">Notifications</a>\n" + "                </li>\n" + "                <li>\n" + "                    <a href=\"#outages\" data-target=\"#outages\">Outages</a>\n" + "                </li>\n" + "                <li>\n" + "                    <a href=\"#resourcegraphs\" data-target=\"#resourcegraphs\">Resource Graphs</a>\n" + "                </li>\n" + "            </ul>" + "<script type=\"text/javascript\">\n" + "            $('body').scrollspy({ target: '#results-sidebar' });\n" + "</script>\n", ContentMode.HTML));
        rightCssLayout.addComponent(resultsSidebar);
        addComponent(leftCssLayout);
        addComponent(rightCssLayout);
    }
}
Also used : SurveillanceViewAlarmTable(org.opennms.features.vaadin.surveillanceviews.ui.dashboard.SurveillanceViewAlarmTable) SurveillanceViewNodeRtcTable(org.opennms.features.vaadin.surveillanceviews.ui.dashboard.SurveillanceViewNodeRtcTable) CssLayout(com.vaadin.ui.CssLayout) SurveillanceViewNotificationTable(org.opennms.features.vaadin.surveillanceviews.ui.dashboard.SurveillanceViewNotificationTable) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) SurveillanceViewGraphComponent(org.opennms.features.vaadin.surveillanceviews.ui.dashboard.SurveillanceViewGraphComponent) Component(com.vaadin.ui.Component) SurveillanceViewGraphComponent(org.opennms.features.vaadin.surveillanceviews.ui.dashboard.SurveillanceViewGraphComponent)

Aggregations

Label (com.vaadin.ui.Label)158 HorizontalLayout (com.vaadin.ui.HorizontalLayout)45 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)40 VerticalLayout (com.vaadin.ui.VerticalLayout)33 Embedded (com.vaadin.ui.Embedded)29 Button (com.vaadin.ui.Button)18 GridLayout (com.vaadin.ui.GridLayout)17 Link (com.vaadin.ui.Link)14 ClickEvent (com.vaadin.ui.Button.ClickEvent)13 Table (com.vaadin.ui.Table)13 ClickListener (com.vaadin.ui.Button.ClickListener)11 TextField (com.vaadin.ui.TextField)10 Item (com.vaadin.data.Item)9 ExternalResource (com.vaadin.server.ExternalResource)9 StreamResource (com.vaadin.terminal.StreamResource)8 PostConstruct (javax.annotation.PostConstruct)8 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)6 ExternalResource (com.vaadin.terminal.ExternalResource)6 Component (com.vaadin.ui.Component)6 Panel (com.vaadin.ui.Panel)5