Search in sources :

Example 16 with VerticalLayout

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

the class CmsLinkInFolderValidationApp method getComponentForState.

/**
 * @see org.opencms.ui.apps.A_CmsWorkplaceApp#getComponentForState(java.lang.String)
 */
@Override
protected Component getComponentForState(String state) {
    m_stateBean = CmsStateBean.parseState(state);
    if (m_revertButton == null) {
        addToolbars();
    }
    m_rootLayout.setMainHeightFull(true);
    HorizontalSplitPanel panel = new HorizontalSplitPanel();
    VerticalLayout result = new VerticalLayout();
    result.setSizeFull();
    VerticalLayout intro = CmsVaadinUtils.getInfoLayout(Messages.GUI_LINKVALIDATION_CHECK_FOLDER_RELATIONS_INTRO_0);
    VerticalLayout nullResult = CmsVaadinUtils.getInfoLayout(Messages.GUI_LINKVALIDATION_CHECK_FOLDER_RELATIONS_NO_RESULT_0);
    nullResult.setVisible(false);
    m_table = new CmsLinkValidationInternalTable(intro, nullResult, new InFolderValidator());
    m_table.setVisible(false);
    m_table.setSizeFull();
    m_table.setWidth("100%");
    result.addComponent(m_table);
    result.addComponent(intro);
    result.addComponent(nullResult);
    m_table.setVisible(false);
    m_table.setSizeFull();
    m_table.setWidth("100%");
    m_resourceSelector = new CmsInternalResources(this);
    panel.setFirstComponent(m_resourceSelector);
    panel.setSecondComponent(result);
    panel.setSplitPosition(CmsFileExplorer.LAYOUT_SPLIT_POSITION, Unit.PIXELS);
    if (!m_stateBean.getResources().isEmpty()) {
        m_table.update(m_stateBean.getResources());
        m_resourceSelector.clearResources();
        for (String resource : m_stateBean.getResources()) {
            m_resourceSelector.addResource(resource);
        }
    }
    return panel;
}
Also used : HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) VerticalLayout(com.vaadin.v7.ui.VerticalLayout)

Example 17 with VerticalLayout

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

the class CmsResourceTypeStatResultList method removeRow.

/**
 * Removes result row representing given results.<p>
 *
 * @param layout with results
 * @param result to be removed
 */
private void removeRow(VerticalLayout layout, CmsResourceTypeStatResult result) {
    Component componentToRemove = null;
    Iterator<Component> iterator = layout.iterator();
    while (iterator.hasNext()) {
        Component component = iterator.next();
        if (component instanceof HorizontalLayout) {
            if (result.equals(((HorizontalLayout) component).getData())) {
                componentToRemove = component;
            }
        }
    }
    if (componentToRemove != null) {
        layout.removeComponent(componentToRemove);
    }
}
Also used : Component(com.vaadin.ui.Component) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout)

Example 18 with VerticalLayout

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

the class CmsMessageBundleEditor method createMainComponent.

/**
 * Creates the main component of the editor with all sub-components.
 * @return the completely filled main component of the editor.
 * @throws IOException thrown if setting the table's content data source fails.
 * @throws CmsException thrown if setting the table's content data source fails.
 */
private Component createMainComponent() throws IOException, CmsException {
    VerticalLayout mainComponent = new VerticalLayout();
    mainComponent.setSizeFull();
    mainComponent.addStyleName("o-message-bundle-editor");
    m_table = createTable();
    Panel navigator = new Panel();
    navigator.setSizeFull();
    navigator.setContent(m_table);
    navigator.addActionHandler(new CmsMessageBundleEditorTypes.TableKeyboardHandler(m_table));
    navigator.addStyleName("v-panel-borderless");
    mainComponent.addComponent(m_options.getOptionsComponent());
    mainComponent.addComponent(navigator);
    mainComponent.setExpandRatio(navigator, 1f);
    m_options.updateShownOptions(m_model.hasMasterMode(), m_model.canAddKeys());
    return mainComponent;
}
Also used : Panel(com.vaadin.ui.Panel) VerticalLayout(com.vaadin.v7.ui.VerticalLayout)

Example 19 with VerticalLayout

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

the class A_CmsAttributeDiff method diff.

/**
 * @see org.opencms.ui.dialogs.history.diff.I_CmsDiffProvider#diff(org.opencms.file.CmsObject, org.opencms.gwt.shared.CmsHistoryResourceBean, org.opencms.gwt.shared.CmsHistoryResourceBean)
 */
public Optional<Component> diff(CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2) throws CmsException {
    List<CmsAttributeComparison> attrCompare = getDifferences(cms, v1, v2);
    if (attrCompare.isEmpty()) {
        return Optional.absent();
    }
    List<CmsPropertyCompareBean> compareBeans = Lists.newArrayList();
    for (CmsAttributeComparison comp : attrCompare) {
        compareBeans.add(new CmsPropertyCompareBean(comp));
    }
    CmsBeanTableBuilder<CmsPropertyCompareBean> builder = CmsBeanTableBuilder.newInstance(CmsPropertyCompareBean.class, A_CmsUI.get().getDisplayType().toString());
    builder.setMacroResolver(new CmsVersionMacroResolver(v1, v2));
    Table table = builder.buildTable(compareBeans);
    table.setSortEnabled(false);
    table.setWidth("100%");
    table.setPageLength(Math.min(12, compareBeans.size()));
    table.setStyleName(COMPARE_TABLE_MARKER);
    VerticalLayout vl = new VerticalLayout();
    vl.setMargin(true);
    vl.addComponent(table);
    Panel panel = new Panel(getCaption());
    panel.setContent(vl);
    return Optional.fromNullable((Component) panel);
}
Also used : CmsAttributeComparison(org.opencms.workplace.comparison.CmsAttributeComparison) Panel(com.vaadin.ui.Panel) Table(com.vaadin.v7.ui.Table) VerticalLayout(com.vaadin.v7.ui.VerticalLayout)

Example 20 with VerticalLayout

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

the class CmsShowVersionButtons method diff.

/**
 * @see org.opencms.ui.dialogs.history.diff.I_CmsDiffProvider#diff(org.opencms.file.CmsObject, org.opencms.gwt.shared.CmsHistoryResourceBean, org.opencms.gwt.shared.CmsHistoryResourceBean)
 */
public Optional<Component> diff(CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2) {
    Panel panel = new Panel("");
    panel.addStyleName(ValoTheme.PANEL_BORDERLESS);
    HorizontalLayout hl = new HorizontalLayout();
    panel.setContent(hl);
    hl.addComponent(createButton(cms, v1));
    hl.addComponent(createButton(cms, v2));
    VerticalLayout outerContainer = new VerticalLayout();
    outerContainer.addComponent(hl);
    outerContainer.setComponentAlignment(hl, Alignment.MIDDLE_RIGHT);
    outerContainer.setMargin(true);
    hl.setSpacing(true);
    return Optional.fromNullable((Component) outerContainer);
}
Also used : Panel(com.vaadin.ui.Panel) VerticalLayout(com.vaadin.v7.ui.VerticalLayout) HorizontalLayout(com.vaadin.v7.ui.HorizontalLayout)

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