Example usage for com.vaadin.ui Panel Panel

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

Introduction

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

Prototype

public Panel() 

Source Link

Document

Creates a new empty panel.

Usage

From source file:info.magnolia.ui.framework.overlay.OverlayPresenter.java

License:Open Source License

/**
 * Opens a notification of given {@link MessageStyleType type}, with given body; it can close automatically after a timeout.
 *///from   ww w.  j av a2  s.  c  o  m
@Override
public void openNotification(final MessageStyleType type, boolean doesTimeout, View viewToShow) {
    final Notification notification = new Notification(type);
    notification.setContent(viewToShow.asVaadinComponent());

    Panel shortcutPanel = new Panel();
    shortcutPanel.setStyleName("shortcut-panel");
    shortcutPanel.setWidth(null);
    shortcutPanel.setContent(notification.asVaadinComponent());
    final OverlayCloser closer = openOverlay(new ViewAdapter(shortcutPanel), ModalityLevel.NON_MODAL);

    final ShortcutListener escapeShortcut = new ShortcutListener("Escape shortcut",
            ShortcutAction.KeyCode.ESCAPE, null) {
        @Override
        public void handleAction(Object sender, Object target) {
            closer.close();
        }
    };
    shortcutPanel.addShortcutListener(escapeShortcut);

    notification.addCloseButtonListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent clickEvent) {
            closer.close();
        }
    });

    notification.addNotificationBodyClickListener(new LayoutEvents.LayoutClickListener() {
        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent layoutClickEvent) {
            closer.setCloseTimeout(-1);
        }
    });

    if (doesTimeout) {
        closer.setCloseTimeout(TIMEOUT_SECONDS_DEFAULT);
    }

}

From source file:info.magnolia.ui.workbench.WorkbenchViewImpl.java

License:Open Source License

public WorkbenchViewImpl() {
    setSizeFull();/*from   w  w w .  j a v  a2s  .  c o  m*/
    setMargin(new MarginInfo(true, false, false, true));
    addStyleName("workbench");

    viewModes.setStyleName("view-modes");

    toolBar.addStyleName("toolbar");
    toolBar.setWidth(100.0F, Sizeable.Unit.PERCENTAGE);
    toolBar.addComponent(viewModes);
    toolBar.setExpandRatio(viewModes, 1f);

    addComponent(toolBar);
    setExpandRatio(toolBar, 0.0F);

    this.keyboardEventPanel = new Panel();
    this.keyboardEventPanel.setSizeFull();
    this.keyboardEventPanel.addStyleName("keyboard-panel");
    addComponent(keyboardEventPanel, 1);
    setExpandRatio(keyboardEventPanel, 1.0F);

    bindKeyboardHandlers();
}

From source file:infodoc.ui.module.help.AboutWindow.java

License:Open Source License

public AboutWindow() {
    super(InfodocConstants.uiAbout);
    addStyleName(InfodocTheme.WINDOW_OPAQUE);
    setIcon(new ThemeResource(InfodocTheme.iconAbout));
    setSizeUndefined();/*from  w  w w. j  a  v a2  s .  c om*/
    setWidth("580px");
    setResizable(false);

    String installedModules = InfodocConstants.infodocModules.replace(" ", "");
    String installedModulesHtml = "";

    for (String module : installedModules.split(",")) {
        installedModulesHtml += "<span style='margin-left: 20px;'>" + module + "</span><br/>";
    }

    String top = "<h2><i>InfoDoc " + InfodocConstants.infodocVersion + "</i></h2>" + "Modules:" + "<pre><small>"
            + installedModulesHtml + "</small></pre>" + "<br/>License granted to:"
            + "<pre><small><span style='margin-left: 20px;'>" + InfodocConstants.infodocCompanyName + "</span>"
            + (InfodocConstants.infodocCompanyId == null ? ""
                    : "<br/><span style='margin-left: 20px;'> " + InfodocConstants.infodocCompanyId + "</span>")
            + (InfodocConstants.infodocCompanyAddress == null ? ""
                    : "<br/><span style='margin-left: 20px;'>" + InfodocConstants.infodocCompanyAddress
                            + "</span></pre></small>")
            + "<br/><br/>";

    String lower = "<br/>Contact the developer: <a href='" + InfodocConstants.infodocDeveloperUrl + "'>"
            + InfodocConstants.infodocDeveloperUrl + "</a>," + "<br/><b>All rights reserved</b>.";

    Label topLabel = new Label(top, Label.CONTENT_XHTML);
    Label lowerLabel = new Label(lower, Label.CONTENT_XHTML);
    lowerLabel.addStyleName(InfodocTheme.LABEL_TINY);

    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setMargin(true);
    rightLayout.setStyleName(InfodocTheme.PANEL_LIGHT);
    rightLayout.addStyleName(InfodocTheme.PANEL_BORDERLESS);
    rightLayout.addStyleName(InfodocTheme.COOL_FONT);
    rightLayout.addComponent(topLabel);
    rightLayout.addComponent(lowerLabel);

    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setWidth("130px");
    leftLayout.addComponent(new Label("<h2></h2>", Label.CONTENT_XHTML));
    leftLayout.addComponent(new Embedded(null, new ThemeResource(InfodocTheme.infodocBoxImage)));

    HorizontalLayout layout = new HorizontalLayout();
    layout.setSizeFull();
    layout.addComponent(leftLayout);
    layout.addComponent(rightLayout);
    layout.setExpandRatio(rightLayout, 1);

    Panel panel = new Panel();
    panel.addComponent(layout);

    setContent(panel);
}

From source file:it.vige.greenarea.bpm.custom.ui.dettaglio.admin.letturafiltri.LetturaFiltriPanel.java

License:Apache License

public LetturaFiltriPanel(Task task, DettaglioPage taskPage) {
    this.task = task;
    this.taskPage = taskPage;

    this.taskService = getDefaultProcessEngine().getTaskService();
    this.formService = getDefaultProcessEngine().getFormService();
    this.repositoryService = getDefaultProcessEngine().getRepositoryService();
    this.viewManager = get().getViewManager();
    this.i18nManager = get().getI18nManager();
    this.notificationManager = get().getNotificationManager();
    setSizeFull();//  www  .j av  a2 s .  c  o  m
    addStyleName(STYLE_DETAIL_PANEL);

    mainPanel = new Panel();
    mainPanel.addStyleName(PANEL_LIGHT);
    mainPanel.setSizeFull();
    super.addComponent(mainPanel);
}

From source file:it.vige.greenarea.bpm.custom.ui.dettaglio.operatorelogistico.anagrafeveicoli.AnagrafeVeicoliOpPanel.java

License:Apache License

public AnagrafeVeicoliOpPanel(Task task, DettaglioPage taskPage) {
    this.task = task;
    this.taskPage = taskPage;

    this.taskService = getDefaultProcessEngine().getTaskService();
    this.formService = getDefaultProcessEngine().getFormService();
    this.repositoryService = getDefaultProcessEngine().getRepositoryService();
    this.viewManager = get().getViewManager();
    this.i18nManager = get().getI18nManager();
    this.notificationManager = get().getNotificationManager();
    setSizeFull();//  w  w  w .j  a v a2s  .c om
    addStyleName(STYLE_DETAIL_PANEL);

    mainPanel = new Panel();
    mainPanel.addStyleName(PANEL_LIGHT);
    mainPanel.setSizeFull();
    super.addComponent(mainPanel);
}

From source file:it.vige.greenarea.bpm.custom.ui.dettaglio.operatorelogistico.richiedireportmissioni.RichiediReportMissioniOpPanel.java

License:Apache License

public RichiediReportMissioniOpPanel(Task task, DettaglioPage taskPage) {
    this.task = task;
    this.taskPage = taskPage;

    this.taskService = getDefaultProcessEngine().getTaskService();
    this.formService = getDefaultProcessEngine().getFormService();
    this.repositoryService = getDefaultProcessEngine().getRepositoryService();
    this.viewManager = get().getViewManager();
    this.i18nManager = get().getI18nManager();
    this.notificationManager = get().getNotificationManager();
    setSizeFull();/*from   w  w w .  j av a2s.  c  o  m*/
    addStyleName(STYLE_DETAIL_PANEL);

    mainPanel = new Panel();
    mainPanel.addStyleName(PANEL_LIGHT);
    mainPanel.setSizeFull();
    super.addComponent(mainPanel);
}

From source file:it.vige.greenarea.bpm.custom.ui.dettaglio.operatorelogistico.verificastatoconsegneeritiri.VerificaStatoConsegneERitiriPanel.java

License:Apache License

public VerificaStatoConsegneERitiriPanel(Task task, DettaglioPage taskPage) {
    this.task = task;
    this.taskPage = taskPage;

    this.taskService = getDefaultProcessEngine().getTaskService();
    this.formService = getDefaultProcessEngine().getFormService();
    this.repositoryService = getDefaultProcessEngine().getRepositoryService();
    this.viewManager = get().getViewManager();
    this.i18nManager = get().getI18nManager();
    this.notificationManager = get().getNotificationManager();
    setSizeFull();/*from   w w  w  .  j av  a  2  s .c  o m*/
    addStyleName(STYLE_DETAIL_PANEL);

    mainPanel = new Panel();
    mainPanel.addStyleName(PANEL_LIGHT);
    mainPanel.setSizeFull();
    super.addComponent(mainPanel);
}

From source file:it.vige.greenarea.bpm.custom.ui.dettaglio.operatorelogistico.visualizzamissioniautorizzate.VisualizzaMissioniAutorizzateOpPanel.java

License:Apache License

public VisualizzaMissioniAutorizzateOpPanel(Task task, DettaglioPage taskPage) {
    this.task = task;
    this.taskPage = taskPage;

    this.taskService = getDefaultProcessEngine().getTaskService();
    this.formService = getDefaultProcessEngine().getFormService();
    this.repositoryService = getDefaultProcessEngine().getRepositoryService();
    this.viewManager = get().getViewManager();
    this.i18nManager = get().getI18nManager();
    this.notificationManager = get().getNotificationManager();
    setSizeFull();/*from ww  w .  j a  v a  2  s.  c om*/
    addStyleName(STYLE_DETAIL_PANEL);

    mainPanel = new Panel();
    mainPanel.addStyleName(PANEL_LIGHT);
    mainPanel.setSizeFull();
    super.addComponent(mainPanel);
}

From source file:it.vige.greenarea.bpm.custom.ui.dettaglio.pa.impattoambientale.ImpattoAmbientalePanel.java

License:Apache License

public ImpattoAmbientalePanel(Task task, DettaglioPage taskPage) {
    this.task = task;
    this.taskPage = taskPage;

    this.taskService = getDefaultProcessEngine().getTaskService();
    this.formService = getDefaultProcessEngine().getFormService();
    this.repositoryService = getDefaultProcessEngine().getRepositoryService();
    this.viewManager = get().getViewManager();
    this.i18nManager = get().getI18nManager();
    this.notificationManager = get().getNotificationManager();
    setSizeFull();//w w w .  j ava  2  s  .  c o  m
    addStyleName(STYLE_DETAIL_PANEL);

    mainPanel = new Panel();
    mainPanel.addStyleName(PANEL_LIGHT);
    mainPanel.setSizeFull();
    super.addComponent(mainPanel);
}

From source file:it.vige.greenarea.bpm.custom.ui.dettaglio.pa.letturafasceorarie.LetturaFasceOrariePanel.java

License:Apache License

public LetturaFasceOrariePanel(Task task, DettaglioPage taskPage) {
    this.task = task;
    this.taskPage = taskPage;

    this.taskService = getDefaultProcessEngine().getTaskService();
    this.formService = getDefaultProcessEngine().getFormService();
    this.repositoryService = getDefaultProcessEngine().getRepositoryService();
    this.viewManager = get().getViewManager();
    this.i18nManager = get().getI18nManager();
    this.notificationManager = get().getNotificationManager();
    setSizeFull();/*from w  w  w.  j  ava  2s.  c  om*/
    addStyleName(STYLE_DETAIL_PANEL);

    mainPanel = new Panel();
    mainPanel.addStyleName(PANEL_LIGHT);
    mainPanel.setSizeFull();
    super.addComponent(mainPanel);
}