Search in sources :

Example 6 with VerticalLayout

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

the class CmsInfoButton method getLayout.

/**
 * The layout which is shown in window by triggering onclick event of button.<p>
 *
 * @param htmlLines to be shown
 * @param additionalElements further vaadin elements
 * @return vertical layout
 */
protected VerticalLayout getLayout(final List<String> htmlLines, final List<InfoElementBean> additionalElements) {
    VerticalLayout layout = new VerticalLayout();
    Label label = new Label();
    label.setWidthUndefined();
    layout.setMargin(true);
    label.setContentMode(ContentMode.HTML);
    layout.addStyleName(OpenCmsTheme.INFO);
    String htmlContent = "";
    for (String line : htmlLines) {
        htmlContent += line;
    }
    label.setValue(htmlContent);
    layout.addComponent(label);
    for (InfoElementBean infoElement : additionalElements) {
        layout.addComponent(infoElement.getComponent(), infoElement.getPos());
    }
    layout.setWidthUndefined();
    return layout;
}
Also used : Label(com.vaadin.v7.ui.Label) VerticalLayout(com.vaadin.v7.ui.VerticalLayout)

Example 7 with VerticalLayout

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

the class CmsInfoButton method getClickListener.

/**
 * Clicklistener for the button.<p>
 *
 * @param htmlLines to be shown in Label
 * @param additionalElements to be placed in the verticalllayout which holds the label
 * @return ClickListener
 */
private ClickListener getClickListener(final List<String> htmlLines, final List<InfoElementBean> additionalElements) {
    return new Button.ClickListener() {

        private static final long serialVersionUID = -553128629431329217L;

        public void buttonClick(ClickEvent event) {
            final Window window = CmsBasicDialog.prepareWindow(CmsBasicDialog.DialogWidth.content);
            window.setCaption(m_windowCaption == null ? CmsVaadinUtils.getMessageText(Messages.GUI_INFO_BUTTON_CAPTION_0) : m_windowCaption);
            window.setResizable(false);
            CmsBasicDialog dialog = new CmsBasicDialog();
            if (m_addButton != null) {
                dialog.addButton(m_addButton, false);
            }
            VerticalLayout layout = getLayout(htmlLines, additionalElements);
            dialog.setContent(layout);
            Button button = new Button(CmsVaadinUtils.messageClose());
            button.addClickListener(new Button.ClickListener() {

                private static final long serialVersionUID = 5789436407764072884L;

                public void buttonClick(ClickEvent event1) {
                    window.close();
                }
            });
            dialog.addButton(button);
            window.setContent(dialog);
            UI.getCurrent().addWindow(window);
        }
    };
}
Also used : Window(com.vaadin.ui.Window) Button(com.vaadin.ui.Button) VerticalLayout(com.vaadin.v7.ui.VerticalLayout)

Example 8 with VerticalLayout

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

the class CmsVaadinUtils method getInfoLayout.

/**
 * Creates a layout with info panel.<p>
 *
 * @param messageString Message to be displayed
 * @return layout
 */
public static VerticalLayout getInfoLayout(String messageString) {
    VerticalLayout ret = new VerticalLayout();
    ret.setMargin(true);
    ret.addStyleName("o-center");
    ret.setWidth("100%");
    VerticalLayout inner = new VerticalLayout();
    inner.addStyleName("o-workplace-maxwidth");
    Panel panel = new Panel();
    panel.setWidth("100%");
    Label label = new Label(CmsVaadinUtils.getMessageText(messageString));
    label.addStyleName("o-report");
    panel.setContent(label);
    inner.addComponent(panel);
    ret.addComponent(inner);
    return ret;
}
Also used : Panel(com.vaadin.ui.Panel) Label(com.vaadin.v7.ui.Label) VerticalLayout(com.vaadin.v7.ui.VerticalLayout)

Example 9 with VerticalLayout

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

the class CmsLoginUI method showLoginView.

/**
 * Initializes the login view.<p>
 *
 * @param preselectedOu a potential preselected OU
 */
public void showLoginView(String preselectedOu) {
    VerticalLayout content = new VerticalLayout();
    content.setSizeFull();
    m_targetOpener = new CmsLoginTargetOpener(A_CmsUI.get());
    // content.setExpandRatio(m_targetOpener, 0f);
    content.addComponent(m_loginForm);
    content.setComponentAlignment(m_loginForm, Alignment.MIDDLE_CENTER);
    content.setExpandRatio(m_loginForm, 1);
    setContent(content);
    m_loginForm.selectOrgUnit(preselectedOu);
}
Also used : VerticalLayout(com.vaadin.v7.ui.VerticalLayout)

Example 10 with VerticalLayout

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

the class CmsSourceSearchApp method getComponentForState.

/**
 * @see org.opencms.ui.apps.A_CmsWorkplaceApp#getComponentForState(java.lang.String)
 */
@Override
protected Component getComponentForState(String state) {
    m_rootLayout.setMainHeightFull(true);
    HorizontalSplitPanel sp = new HorizontalSplitPanel();
    sp.setSizeFull();
    m_searchForm = new CmsSourceSearchForm(this);
    sp.setFirstComponent(m_searchForm);
    VerticalLayout result = new VerticalLayout();
    result.setSizeFull();
    m_infoIntroLayout = CmsVaadinUtils.getInfoLayout(Messages.GUI_SOURCESEARCH_INTRO_0);
    m_infoEmptyResult = CmsVaadinUtils.getInfoLayout(Messages.GUI_SOURCESEARCH_EMPTY_0);
    m_resultTable = new CmsFileTable(null);
    result.addComponent(m_resultTable);
    result.addComponent(m_infoEmptyResult);
    result.addComponent(m_infoIntroLayout);
    m_resultTable.setVisible(false);
    m_infoEmptyResult.setVisible(false);
    m_infoIntroLayout.setVisible(true);
    m_resultTable.applyWorkplaceAppSettings();
    m_resultTable.setContextProvider(new I_CmsContextProvider() {

        /**
         * @see org.opencms.ui.apps.I_CmsContextProvider#getDialogContext()
         */
        public I_CmsDialogContext getDialogContext() {
            CmsFileTableDialogContext context = new CmsFileTableDialogContext(CmsProjectManagerConfiguration.APP_ID, ContextType.fileTable, m_resultTable, m_resultTable.getSelectedResources());
            storeCurrentFileSelection(m_resultTable.getSelectedResources());
            context.setEditableProperties(CmsFileExplorer.INLINE_EDIT_PROPERTIES);
            return context;
        }
    });
    m_resultTable.setSizeFull();
    if (m_resultTableFilter == null) {
        m_resultTableFilter = new TextField();
        m_resultTableFilter.setIcon(FontOpenCms.FILTER);
        m_resultTableFilter.setInputPrompt(Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_FILTER_0));
        m_resultTableFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
        m_resultTableFilter.setWidth("200px");
        m_resultTableFilter.addTextChangeListener(new TextChangeListener() {

            private static final long serialVersionUID = 1L;

            public void textChange(TextChangeEvent event) {
                m_resultTable.filterTable(event.getText());
            }
        });
        m_infoLayout.addComponent(m_resultTableFilter);
    }
    sp.setSecondComponent(result);
    sp.setSplitPosition(CmsFileExplorer.LAYOUT_SPLIT_POSITION, Unit.PIXELS);
    if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(state)) {
        CmsSearchReplaceSettings settings = getSettingsFromState(state);
        if (settings != null) {
            m_currentState = state;
            m_searchForm.initFormValues(settings);
            search(settings, false);
        }
    }
    return sp;
}
Also used : I_CmsDialogContext(org.opencms.ui.I_CmsDialogContext) TextChangeEvent(com.vaadin.v7.event.FieldEvents.TextChangeEvent) HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) CmsFileTableDialogContext(org.opencms.ui.components.CmsFileTableDialogContext) VerticalLayout(com.vaadin.v7.ui.VerticalLayout) I_CmsContextProvider(org.opencms.ui.apps.I_CmsContextProvider) TextField(com.vaadin.v7.ui.TextField) CmsFileTable(org.opencms.ui.components.CmsFileTable) TextChangeListener(com.vaadin.v7.event.FieldEvents.TextChangeListener)

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