Search in sources :

Example 16 with VerticalLayout

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

the class UndefinedDashlet method getWallboardComponent.

@Override
public DashletComponent getWallboardComponent() {
    DashletComponent dashletComponent = new AbstractDashletComponent() {

        @Override
        public void refresh() {
        }

        @Override
        public Component getComponent() {
            VerticalLayout verticalLayout = new VerticalLayout();
            Label label = new Label("The specified dashlet could not be found!");
            verticalLayout.addComponent(label);
            verticalLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
            return verticalLayout;
        }
    };
    return dashletComponent;
}
Also used : Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 17 with VerticalLayout

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

the class AbstractDashletFactory method getHelpComponent.

/**
     * Returns the help component for the {@link Dashlet}.
     *
     * @return the help component
     */
@Override
public Component getHelpComponent() {
    VerticalLayout verticalLayout = new VerticalLayout();
    Label helpContent = new Label(getHelpContentHTML(), ContentMode.HTML);
    helpContent.addStyleName("help-content");
    Label helpParameters = new Label(getParameterDescriptionsHTML(), ContentMode.HTML);
    helpParameters.addStyleName("help-content");
    verticalLayout.addComponent(helpContent);
    verticalLayout.addComponent(helpParameters);
    return verticalLayout;
}
Also used : Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 18 with VerticalLayout

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

the class SSHTerminalTest method setUp.

@SuppressWarnings("serial")
@Before
public void setUp() throws Exception {
    app = new UI() {

        @Override
        public void init(VaadinRequest request) {
        }
    };
    mainWindow = new VerticalLayout();
    app.setContent(mainWindow);
    SSHWindow sshWindow = new SSHWindow(null, 200, 200);
    app.addWindow(sshWindow);
    SshClient client = SshClient.setUpDefaultClient();
    client.start();
    ClientSession session = null;
    try {
        session = client.connect(testHost, testPort).await().getSession();
    } catch (Exception e) {
        fail("Could not connect to host");
    }
    sshTerm = new SSHTerminal(sshWindow, session, 200, 200);
    sshWindow.setContent(sshTerm);
    UI.setCurrent(app);
}
Also used : UI(com.vaadin.ui.UI) SshClient(org.apache.sshd.SshClient) ClientSession(org.apache.sshd.ClientSession) VerticalLayout(com.vaadin.ui.VerticalLayout) VaadinRequest(com.vaadin.server.VaadinRequest) Before(org.junit.Before)

Example 19 with VerticalLayout

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

the class PreviewClickListener method buttonClick.

/**
     * {@inheritDoc}
     */
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
    final Window window = new Window("Preview");
    window.setModal(true);
    window.setClosable(true);
    window.setResizable(false);
    window.setWidth("80%");
    window.setHeight("90%");
    m_component.getUI().addWindow(window);
    window.setContent(new VerticalLayout() {

        {
            addComponent(new VerticalLayout() {

                {
                    setMargin(true);
                    setSpacing(true);
                    setSizeFull();
                    addComponent(new SurveillanceView(m_view, m_surveillanceViewService, false, false));
                }
            });
        }
    });
}
Also used : Window(com.vaadin.ui.Window) VerticalLayout(com.vaadin.ui.VerticalLayout)

Example 20 with VerticalLayout

use of com.vaadin.ui.VerticalLayout 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

VerticalLayout (com.vaadin.ui.VerticalLayout)75 Label (com.vaadin.ui.Label)33 HorizontalLayout (com.vaadin.ui.HorizontalLayout)21 Link (com.vaadin.ui.Link)13 Button (com.vaadin.ui.Button)12 ExternalResource (com.vaadin.server.ExternalResource)9 ClickEvent (com.vaadin.ui.Button.ClickEvent)8 PostConstruct (javax.annotation.PostConstruct)8 Panel (com.vaadin.ui.Panel)7 ClickListener (com.vaadin.ui.Button.ClickListener)6 Embedded (com.vaadin.ui.Embedded)5 ExternalResource (com.vaadin.terminal.ExternalResource)4 StreamResource (com.vaadin.terminal.StreamResource)4 LayoutClickEvent (com.vaadin.event.LayoutEvents.LayoutClickEvent)3 LayoutClickListener (com.vaadin.event.LayoutEvents.LayoutClickListener)3 InputStream (java.io.InputStream)3 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)3 Resource (com.vaadin.terminal.Resource)2 StreamSource (com.vaadin.terminal.StreamResource.StreamSource)2 CssLayout (com.vaadin.ui.CssLayout)2