Search in sources :

Example 1 with ExternalResource

use of com.vaadin.server.ExternalResource in project opennms by OpenNMS.

the class PluginManagerAdminApplication method init.

/* (non-Javadoc)
	 * @see com.vaadin.ui.UI#init(com.vaadin.server.VaadinRequest)
	 */
@Override
public void init(VaadinRequest request) {
    m_rootLayout = new VerticalLayout();
    m_rootLayout.setSizeFull();
    m_rootLayout.addStyleName("root-layout");
    setContent(m_rootLayout);
    // dynamically inject style for non write borders - avoids changing themes css
    // Get the stylesheet of the page
    Styles styles = Page.getCurrent().getStyles();
    // inject the new font size as a style. We need .v-app to override Vaadin's default styles here
    styles.add(".v-app .v-textfield-readonly {border: 1px solid #b6b6b6!important;" + " border-top-color: #9d9d9d!important;" + "border-bottom-color: #d6d6d6!important;" + "border-right-color: #d6d6d6!important;" + " opacity: 1.0!important;" + "filter: none;  }");
    styles.add(".v-app .v-textarea-readonly {border: 1px solid #b6b6b6!important;" + " border-top-color: #9d9d9d!important;" + "border-bottom-color: #d6d6d6!important;" + "border-right-color: #d6d6d6!important;" + " opacity: 1.0!important;" + "filter: none;  }");
    addHeader(request);
    // add diagnostic page links
    if (headerLinks != null) {
        // defining 2 horizontal layouts to force links to stay together
        HorizontalLayout horizontalLayout1 = new HorizontalLayout();
        horizontalLayout1.setWidth("100%");
        horizontalLayout1.setDefaultComponentAlignment(Alignment.TOP_RIGHT);
        HorizontalLayout horizontalLayout2 = new HorizontalLayout();
        horizontalLayout1.addComponent(horizontalLayout2);
        for (String name : headerLinks.keySet()) {
            String urlStr = headerLinks.get(name);
            ExternalResource urlResource = new ExternalResource(urlStr);
            Link link = new Link(name, urlResource);
            // adds space between links
            Label label = new Label("   ", ContentMode.HTML);
            horizontalLayout2.addComponent(link);
            horizontalLayout2.addComponent(label);
        }
        m_rootLayout.addComponent(horizontalLayout1);
    }
    PluginManagerUIMainPanel pluginManagerUIMainPanel = new PluginManagerUIMainPanel(sessionPluginManager);
    m_rootLayout.addComponent(pluginManagerUIMainPanel);
    // this forces the UI panel to use up all the available space below the header
    m_rootLayout.setExpandRatio(pluginManagerUIMainPanel, 1.0f);
}
Also used : Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) PluginManagerUIMainPanel(org.opennms.features.pluginmgr.vaadin.pluginmanager.PluginManagerUIMainPanel) ExternalResource(com.vaadin.server.ExternalResource) Link(com.vaadin.ui.Link) Styles(com.vaadin.server.Page.Styles) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 2 with ExternalResource

use of com.vaadin.server.ExternalResource in project cia by Hack23.

the class AdminMonitoringPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();
    final String pageId = getPageId(parameters);
    getMenuItemFactory().createMainPageMenuBar(menuBar);
    final BrowserFrame browser = new BrowserFrame(ADMIN_MONITORING, new ExternalResource(MONITORING_CONTEXT_PATH));
    browser.setSizeFull();
    content.addComponent(browser);
    content.setExpandRatio(browser, ContentRatio.FULL_SIZE);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_MONITORING_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId);
    return content;
}
Also used : BrowserFrame(com.vaadin.ui.BrowserFrame) VerticalLayout(com.vaadin.ui.VerticalLayout) ExternalResource(com.vaadin.server.ExternalResource) Secured(org.springframework.security.access.annotation.Secured)

Example 3 with ExternalResource

use of com.vaadin.server.ExternalResource in project cia by Hack23.

the class PageLinkFactoryImpl method createPoliticianPageLink.

@Override
public Link createPoliticianPageLink(final PersonData personData) {
    final Link pageLink = new Link(POLITICIAN + personData.getFirstName() + ' ' + personData.getLastName(), new ExternalResource(PAGE_PREFIX + UserViews.POLITICIAN_VIEW_NAME + PAGE_SEPARATOR + personData.getId()));
    pageLink.setId(ViewAction.VISIT_POLITICIAN_VIEW.name() + PAGE_SEPARATOR + personData.getId());
    pageLink.setIcon(VaadinIcons.BUG);
    return pageLink;
}
Also used : ExternalResource(com.vaadin.server.ExternalResource) Link(com.vaadin.ui.Link)

Example 4 with ExternalResource

use of com.vaadin.server.ExternalResource in project cia by Hack23.

the class PageLinkFactoryImpl method createUserHomeViewPageLink.

@Override
public Link createUserHomeViewPageLink() {
    final Link pageLink = new Link("User account:" + UserContextUtil.getUserNameFromSecurityContext(), new ExternalResource(PAGE_PREFIX + UserViews.USERHOME_VIEW_NAME));
    pageLink.setId(ViewAction.VISIT_USER_HOME_VIEW.name());
    pageLink.setIcon(VaadinIcons.USER);
    return pageLink;
}
Also used : ExternalResource(com.vaadin.server.ExternalResource) Link(com.vaadin.ui.Link)

Example 5 with ExternalResource

use of com.vaadin.server.ExternalResource in project cia by Hack23.

the class PageLinkFactoryImpl method createSearchDocumentViewPageLink.

@Override
public Link createSearchDocumentViewPageLink() {
    final Link pageLink = new Link(SEARCH, new ExternalResource(PAGE_PREFIX + UserViews.SEARCH_DOCUMENT_VIEW_NAME));
    pageLink.setId(ViewAction.VISIT_DOCUMENT_VIEW.name());
    pageLink.setIcon(VaadinIcons.SEARCH);
    return pageLink;
}
Also used : ExternalResource(com.vaadin.server.ExternalResource) Link(com.vaadin.ui.Link)

Aggregations

ExternalResource (com.vaadin.server.ExternalResource)43 Link (com.vaadin.ui.Link)24 VerticalLayout (com.vaadin.ui.VerticalLayout)18 Label (com.vaadin.ui.Label)13 PostConstruct (javax.annotation.PostConstruct)11 Button (com.vaadin.ui.Button)8 HorizontalLayout (com.vaadin.ui.HorizontalLayout)7 Resource (com.vaadin.server.Resource)5 Point (org.vaadin.addon.leaflet.shared.Point)5 StreamResource (com.vaadin.server.StreamResource)4 BrowserFrame (com.vaadin.ui.BrowserFrame)4 ClickEvent (com.vaadin.ui.Button.ClickEvent)4 LMap (org.vaadin.addon.leaflet.LMap)3 Bounds (org.vaadin.addon.leaflet.shared.Bounds)3 ReportSave (au.com.vaadinutils.jasper.scheduler.entities.ReportSave)2 ReportSaveParameter (au.com.vaadinutils.jasper.scheduler.entities.ReportSaveParameter)2 ClickEventLogged (au.com.vaadinutils.listener.ClickEventLogged)2 ComboBox (com.vaadin.ui.ComboBox)2 TextField (com.vaadin.ui.TextField)2 HashMap (java.util.HashMap)2