Search in sources :

Example 51 with VerticalLayout

use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.

the class CmsLinkValidationApp method getInternalComponent.

/**
 * Returns the component for the internal link validation.<p>
 *
 * @return vaadin component
 */
private HorizontalSplitPanel getInternalComponent() {
    m_rootLayout.setMainHeightFull(true);
    HorizontalSplitPanel sp = new HorizontalSplitPanel();
    sp.setSizeFull();
    VerticalLayout result = new VerticalLayout();
    result.setSizeFull();
    VerticalLayout intro = CmsVaadinUtils.getInfoLayout(Messages.GUI_LINKVALIDATION_INTRODUCTION_0);
    VerticalLayout nullResult = CmsVaadinUtils.getInfoLayout(Messages.GUI_LINKVALIDATION_NO_BROKEN_LINKS_0);
    nullResult.setVisible(false);
    CmsLinkValidationInternalTable table = new CmsLinkValidationInternalTable(intro, nullResult, new InternalValidator());
    table.setVisible(false);
    table.setSizeFull();
    table.setWidth("100%");
    result.addComponent(table);
    result.addComponent(intro);
    result.addComponent(nullResult);
    VerticalLayout leftCol = new VerticalLayout();
    leftCol.setSizeFull();
    CmsInternalResources resources = new CmsInternalResources(table);
    leftCol.addComponent(resources);
    leftCol.setExpandRatio(resources, 1);
    sp.setFirstComponent(leftCol);
    sp.setSecondComponent(result);
    sp.setSplitPosition(CmsFileExplorer.LAYOUT_SPLIT_POSITION, Unit.PIXELS);
    return sp;
}
Also used : HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) VerticalLayout(com.vaadin.v7.ui.VerticalLayout)

Example 52 with VerticalLayout

use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.

the class CmsSitemapExtension method showLocaleComparison.

/**
 * @see org.opencms.ui.shared.rpc.I_CmsSitemapServerRpc#showLocaleComparison(java.lang.String)
 */
public void showLocaleComparison(String id) {
    if (m_localeCompareContainer == null) {
        m_localeCompareContainer = new VerticalLayout();
        CmsExternalLayout layout = new CmsExternalLayout(CmsGwtConstants.ID_LOCALE_COMPARISON, m_localeCompareContainer);
        m_ui.getContent().addComponent(layout);
    }
    m_localeCompareContainer.removeAllComponents();
    m_localeCompareContainer.addComponent(new CmsLocaleComparePanel(id));
}
Also used : CmsExternalLayout(org.opencms.ui.components.CmsExternalLayout) VerticalLayout(com.vaadin.v7.ui.VerticalLayout)

Example 53 with VerticalLayout

use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.

the class CmsLoginUI method showPasswordResetDialog.

/**
 * Shows the password reset dialog.<p>
 */
public void showPasswordResetDialog() {
    String caption = CmsVaadinUtils.getMessageText(Messages.GUI_PWCHANGE_FORGOT_PASSWORD_0);
    A_CmsUI r = A_CmsUI.get();
    r.setContent(new Label());
    Window window = CmsBasicDialog.prepareWindow(DialogWidth.narrow);
    CmsBasicDialog dialog = new CmsBasicDialog();
    VerticalLayout result = new VerticalLayout();
    dialog.setContent(result);
    window.setContent(dialog);
    window.setCaption(caption);
    window.setClosable(true);
    final CmsForgotPasswordDialog forgotPassword = new CmsForgotPasswordDialog();
    window.addCloseListener(new CloseListener() {

        /**
         * Serial version id.
         */
        private static final long serialVersionUID = 1L;

        public void windowClose(CloseEvent e) {
            forgotPassword.cancel();
        }
    });
    for (Button button : forgotPassword.getButtons()) {
        dialog.addButton(button);
    }
    r.addWindow(window);
    window.center();
    VerticalLayout vl = result;
    vl.addComponent(forgotPassword);
}
Also used : Window(com.vaadin.ui.Window) CmsBasicDialog(org.opencms.ui.components.CmsBasicDialog) CloseEvent(com.vaadin.ui.Window.CloseEvent) Button(com.vaadin.ui.Button) CloseListener(com.vaadin.ui.Window.CloseListener) Label(com.vaadin.v7.ui.Label) VerticalLayout(com.vaadin.v7.ui.VerticalLayout) A_CmsUI(org.opencms.ui.A_CmsUI)

Example 54 with VerticalLayout

use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.

the class CmsHistoryDialog method tryCompare.

/**
 * Opens the 'compare' view for the two selected versions of the resource.<p>
 *
 * @throws CmsException if something goes wrong
 */
public void tryCompare() throws CmsException {
    CmsObject cms = A_CmsUI.getCmsObject();
    CheckBox check1 = m_group1.getSelected();
    CheckBox check2 = m_group2.getSelected();
    if (!canCompare(check1, check2)) {
        Notification.show(CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_SELECT_TWO_DIFFERENT_VERSIONS_0));
    } else {
        CmsHistoryResourceBean bean1 = (CmsHistoryResourceBean) (check1.getData());
        CmsHistoryResourceBean bean2 = (CmsHistoryResourceBean) (check2.getData());
        VerticalLayout diffContainer = new VerticalLayout();
        diffContainer.setSpacing(true);
        for (I_CmsDiffProvider diff : m_diffs) {
            Optional<Component> optionalDiff = diff.diff(cms, bean1, bean2);
            if (optionalDiff.isPresent()) {
                diffContainer.addComponent(optionalDiff.get());
            }
        }
        Panel panel = new Panel();
        panel.setSizeFull();
        diffContainer.setWidth("100%");
        diffContainer.setMargin(true);
        panel.addStyleName(ValoTheme.PANEL_BORDERLESS);
        panel.setContent(diffContainer);
        openChildDialog(CmsHistoryDialog.this, panel, CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_COMPARE_0));
    }
}
Also used : Panel(com.vaadin.ui.Panel) CmsHistoryResourceBean(org.opencms.gwt.shared.CmsHistoryResourceBean) CmsObject(org.opencms.file.CmsObject) I_CmsDiffProvider(org.opencms.ui.dialogs.history.diff.I_CmsDiffProvider) CheckBox(com.vaadin.v7.ui.CheckBox) VerticalLayout(com.vaadin.v7.ui.VerticalLayout) Component(com.vaadin.ui.Component)

Example 55 with VerticalLayout

use of com.vaadin.v7.ui.VerticalLayout in project opencms-core by alkacon.

the class CmsHistoryDialog method openChildDialog.

/**
 * Replaces the contents of the window containing a given component with a basic dialog
 * consisting of a back button to restore the previous window state and another user provided widget.<p>
 *
 * @param currentComponent the component whose parent window's content should be replaced
 * @param newView the user supplied part of the new window content
 * @param newCaption the caption for the child dialog
 */
public static void openChildDialog(Component currentComponent, Component newView, String newCaption) {
    final Window window = CmsVaadinUtils.getWindow(currentComponent);
    final String oldCaption = window.getCaption();
    CmsBasicDialog dialog = new CmsBasicDialog();
    VerticalLayout vl = new VerticalLayout();
    dialog.setContent(vl);
    Button backButton = new Button(CmsVaadinUtils.getMessageText(Messages.GUI_CHILD_DIALOG_GO_BACK_0));
    HorizontalLayout buttonBar = new HorizontalLayout();
    buttonBar.addComponent(backButton);
    buttonBar.setMargin(true);
    vl.addComponent(buttonBar);
    vl.addComponent(newView);
    final Component oldContent = window.getContent();
    if (oldContent instanceof CmsBasicDialog) {
        List<CmsResource> infoResources = ((CmsBasicDialog) oldContent).getInfoResources();
        dialog.displayResourceInfo(infoResources);
        if (oldContent instanceof CmsHistoryDialog) {
            dialog.addButton(((CmsHistoryDialog) oldContent).createCloseButton());
        }
    }
    backButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            window.setContent(oldContent);
            window.setCaption(oldCaption);
            window.center();
        }
    });
    window.setContent(dialog);
    window.setCaption(newCaption);
    window.center();
}
Also used : Window(com.vaadin.ui.Window) CmsBasicDialog(org.opencms.ui.components.CmsBasicDialog) ClickEvent(com.vaadin.ui.Button.ClickEvent) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout) CmsResource(org.opencms.file.CmsResource) Button(com.vaadin.ui.Button) VerticalLayout(com.vaadin.v7.ui.VerticalLayout) Component(com.vaadin.ui.Component) ClickListener(com.vaadin.ui.Button.ClickListener)

Aggregations

VerticalLayout (com.vaadin.v7.ui.VerticalLayout)34 VerticalLayout (com.vaadin.ui.VerticalLayout)25 Button (com.vaadin.ui.Button)22 Label (com.vaadin.ui.Label)18 Label (com.vaadin.v7.ui.Label)17 HorizontalLayout (com.vaadin.ui.HorizontalLayout)16 Window (com.vaadin.ui.Window)12 Component (com.vaadin.ui.Component)11 ValoTheme (com.vaadin.ui.themes.ValoTheme)11 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)11 VaadinIcons (com.vaadin.icons.VaadinIcons)10 Panel (com.vaadin.ui.Panel)10 TextField (com.vaadin.v7.ui.TextField)10 Strings (de.symeda.sormas.api.i18n.Strings)10 ButtonHelper (de.symeda.sormas.ui.utils.ButtonHelper)10 CssStyles (de.symeda.sormas.ui.utils.CssStyles)10 Captions (de.symeda.sormas.api.i18n.Captions)9 Alignment (com.vaadin.ui.Alignment)8 CheckBox (com.vaadin.v7.ui.CheckBox)8 OptionGroup (com.vaadin.v7.ui.OptionGroup)8