com.vaadin.v7.ui.VerticalLayout.addComponent() - java examples

Here are the examples of the java api com.vaadin.v7.ui.VerticalLayout.addComponent() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

49 Examples 7

19 View Complete Implementation : CmsDbSynchDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * shows the synchronization report.<p>
 */
protected void showReport() {
    m_confirm.setVisible(false);
    m_report.setVisible(true);
    CmsSynchronizeThread thread = new CmsSynchronizeThread(A_CmsUI.getCmsObject());
    thread.start();
    CmsReportWidget widget = new CmsReportWidget(thread);
    widget.setHeight("500px");
    widget.setWidth("100%");
    m_report.addComponent(widget);
    m_okButton.setEnabled(false);
}

19 View Complete Implementation : CmsGitToolOptionsPanel.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Removes all currently selectable modules.
 */
private void resetSelectableModules() {
    m_moduleCheckboxes.clear();
    m_moduleSelectionContainer.removeAllComponents();
    m_moduleSelectionContainer.addComponent(m_moduleSelectorContainer);
}

18 View Complete Implementation : CmsDbStaticExportView.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Start export thread.<p>
 */
void startThread() {
    m_reportPanel.setVisible(true);
    m_startPanel.setVisible(false);
    m_report.setVisible(false);
    CmsStaticExportThread thread = new CmsStaticExportThread(A_CmsUI.getCmsObject());
    CmsReportWidget report = new CmsReportWidget(thread);
    report.setHeight("500px");
    report.setWidth("100%");
    m_layout.addComponent(report);
    thread.start();
}

18 View Complete Implementation : CmsPermissionDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Displays the user permissions.<p>
 *
 * @param user the selected user
 */
void displayUserPermissions(CmsUser user) {
    CmsPermissionView view = buildPermissionEntryForm(user.getId(), buildPermissionsForCurrentUser(), false, false);
    view.hideDeniedColumn();
    m_userPermissions.addComponent(view);
}

18 View Complete Implementation : CmsMessageBundleEditor.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * 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;
}

17 View Complete Implementation : CmsResourceTypeStatResultList.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Sets the layout.<p>
 *
 * @param layout to display the result in
 * @param addAll indicates if the whole list should be added or just the last item
 */
public void setVerticalLayout(VerticalLayout layout, boolean addAll) {
    if (m_results.size() > 0) {
        if (addAll) {
            for (CmsResourceTypeStatResult result : m_results) {
                layout.addComponent(getLayoutFromResult(result), 0);
            }
        } else {
            CmsResourceTypeStatResult statResult = m_results.get(m_results.size() - 1);
            if (m_updated) {
                removeRow(layout, statResult);
            }
            layout.addComponent(getLayoutFromResult(statResult), 0);
        }
    }
}

17 View Complete Implementation : CmsSitemapExtension.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @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));
}

17 View Complete Implementation : ExportDialog.java
Copyright GNU General Public License v3.0
Author : JumpMind
@SuppressWarnings("unchecked")
private void updateAffectedObjects() {
    Set<String> flowIds = (Set<String>) exportFlowGroup.getValue();
    Set<String> modelIds = (Set<String>) exportModelGroup.getValue();
    affectedLayout.removeAllComponents();
    Set<Flow> flows = new HashSet<Flow>();
    for (String flowId : flowIds) {
        flows.addAll(context.getConfigurationService().findAffectedFlowsByFlow(flowId));
    }
    for (String modelId : modelIds) {
        flows.addAll(context.getConfigurationService().findAffectedFlowsByModel(modelId));
    }
    for (Flow flow : flows) {
        // only add flow to affected flows if its not already being exported
        if (!flowIds.contains(flow.getId())) {
            affectedLayout.addComponent(new Label(" - " + flow.getName()));
        }
    }
}

17 View Complete Implementation : ImportXmlTemplateWindow.java
Copyright GNU General Public License v3.0
Author : JumpMind
protected void rebuildOptionLayout() {
    optionLayout.removeAllComponents();
    if (optionGroup.getValue().equals(OPTION_TEXT)) {
        optionLayout.addComponent(editor);
        editor.focus();
    } else if (optionGroup.getValue().equals(OPTION_FILE)) {
        optionLayout.addComponent(upload);
        upload.focus();
    } else if (optionGroup.getValue().equals(OPTION_URL)) {
        optionLayout.addComponent(urlTextField);
        urlTextField.focus();
    } else if (optionGroup.getValue().equals(OPTION_RESOURCE)) {
        optionLayout.addComponent(resourceComboBox);
        resourceComboBox.focus();
    }
}

16 View Complete Implementation : CmsAccountsApp.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @see org.opencms.ui.apps.A_CmsWorkplaceApp#openSubView(java.lang.String, boolean)
 */
@Override
public void openSubView(String state, boolean updateState) {
    if (updateState) {
        CmsAppWorkplaceUi.get().changeCurrentAppState(state);
    }
    Component comp = getComponentForState(state);
    updateInfoButton();
    if (comp != null) {
        VerticalLayout layout = new VerticalLayout();
        layout.setSizeFull();
        comp.setSizeFull();
        layout.addComponent(m_table.getEmptyLayout());
        layout.addComponent(m_table);
        handleSetTable(m_table);
        m_splitScreen.setSecondComponent(layout);
    } else {
        m_splitScreen.setSecondComponent(new Label("Malformed path, tool not available for path: " + state));
        handleSetTable(null);
    }
    m_splitScreen.setSizeFull();
    updateSubNav(getSubNavEntries(state));
    updateBreadCrumb(getBreadCrumbForState(state));
}

16 View Complete Implementation : CmsLoginUI.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * 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);
    if (preselectedOu == null) {
        preselectedOu = "/";
    }
    m_loginForm.selectOrgUnit(preselectedOu);
}

14 View Complete Implementation : CmsGitToolOptionsPanel.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Adds a check box and info widget for a module which should be selectable for check-in.<p>
 *
 * @param moduleName the name of the module
 */
public void addSelectableModule(final String moduleName) {
    boolean enabled = true;
    /* OpenCms.getModuleManager().hasModule(moduleName); */
    CheckBox moduleCheckBox = new CheckBox();
    String iconUri = CmsWorkplace.getResourceUri("tools/modules/buttons/modules.png");
    CmsResourceInfo info = new CmsResourceInfo(moduleName, "", iconUri);
    HorizontalLayout line = new HorizontalLayout();
    line.setWidth("100%");
    line.addComponent(moduleCheckBox);
    info.setWidth("100%");
    line.addComponent(info);
    line.setComponentAlignment(moduleCheckBox, Alignment.MIDDLE_CENTER);
    line.setExpandRatio(info, 1.0f);
    moduleCheckBox.setEnabled(true);
    // If enabled, then checked by default
    moduleCheckBox.setValue(Boolean.valueOf(enabled));
    m_moduleCheckboxes.put(moduleName, moduleCheckBox);
    m_moduleSelectionContainer.addComponent(line, m_moduleSelectionContainer.getComponentCount() - 1);
    setTab(m_dialogTab);
}

13 View Complete Implementation : CmsInfoButton.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * 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;
}

13 View Complete Implementation : PropertySheet.java
Copyright GNU General Public License v3.0
Author : JumpMind
@SuppressWarnings("unchecked")
public void setSource(Object obj) {
    value = obj;
    VerticalLayout vLayout = new VerticalLayout();
    FormLayout formLayout = new FormLayout();
    formLayout.setWidth(100, Unit.PERCENTAGE);
    formLayout.setMargin(false);
    formLayout.addStyleName(ValoTheme.FORMLAYOUT_LIGHT);
    if (obj != null) {
        if (obj instanceof List<?>) {
            List<Object> l = (List<Object>) obj;
            if (l.size() == 1) {
                if (l.get(0) instanceof FlowStep) {
                    obj = (FlowStep) l.get(0);
                }
            }
        }
        if (obj instanceof FlowStep) {
            obj = ((FlowStep) obj).getComponent();
        }
        if (obj instanceof Component) {
            Component component = (Component) obj;
            context.getConfigurationService().refresh(component, true);
            addComponentProperties(formLayout, component);
        }
        if (obj instanceof Resource) {
            Resource resource = (Resource) obj;
            addButtonBar(vLayout, resource);
            addResourceProperties(formLayout, resource);
        }
        if (obj instanceof AbstractObjectWithSettings) {
            List<XMLSetting> settings = buildSettings(obj);
            if (settings != null) {
                for (XMLSetting definition : settings) {
                    addSettingField(definition, (AbstractObjectWithSettings) obj, formLayout);
                }
            }
        }
        if (obj instanceof Component) {
            Component component = (Component) obj;
            XMLComponentDefinition componentDefintion = context.getDefinitionFactory().getComponentDefinition(component.getProjectVersionId(), component.getType());
            addThreadCount(componentDefintion, formLayout, component);
        }
        if (obj instanceof List<?>) {
            addCommonComponentSettings(formLayout, obj);
        }
    }
    vLayout.addComponent(formLayout);
    panel.setContent(vLayout);
}

13 View Complete Implementation : TableColumnSelectWindow.java
Copyright GNU General Public License v3.0
Author : JumpMind
protected void rebuildOptionLayout() {
    optionLayout.removeAllComponents();
    if (optionGroup.getValue().equals(OPTION_DB)) {
        optionLayout.addComponent(scrollable);
        scrollable.focus();
    } else if (optionGroup.getValue().equals(OPTION_REL_FILE)) {
        optionLayout.addComponent(relCsvUpload);
        relCsvUpload.focus();
    } else if (optionGroup.getValue().equals(OPTION_FILE_HEADER_ROW)) {
        optionLayout.addComponent(fileHeaderEnreplacedy);
        optionLayout.setExpandRatio(fileHeaderEnreplacedy, 0.2f);
        optionLayout.addComponent(fileHeaderDelimiter);
        optionLayout.setExpandRatio(fileHeaderDelimiter, 0.2f);
        optionLayout.addComponent(fileHeaderUpload);
        optionLayout.setExpandRatio(fileHeaderUpload, 0.8f);
        fileHeaderEnreplacedy.focus();
    }
}

12 View Complete Implementation : CmsCacheViewApp.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Creates in info button for java cache statistics.<p>
 * @param memory memory object
 *
 * @return CmsInfoButton
 */
public static CmsInfoButton getJavaStatisticButton(CmsMemoryStatus memory) {
    Map<String, String> infoMap = new LinkedHashMap<String, String>();
    infoMap.put(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_JAVA_HEAP_MAX_0), CmsFileUtil.formatFilesize(memory.getMaxMemory() * 1048576, A_CmsUI.getCmsObject().getRequestContext().getLocale()));
    infoMap.put(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_JAVA_HEAP_TOTAL_0), CmsFileUtil.formatFilesize(memory.getTotalMemory() * 1048576, A_CmsUI.getCmsObject().getRequestContext().getLocale()));
    infoMap.put(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_JAVA_HEAP_USED_0), CmsFileUtil.formatFilesize(memory.getUsedMemory() * 1048576, A_CmsUI.getCmsObject().getRequestContext().getLocale()));
    infoMap.put(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_JAVA_HEAP_FREE_0), CmsFileUtil.formatFilesize(memory.getFreeMemory() * 1048576, A_CmsUI.getCmsObject().getRequestContext().getLocale()));
    CmsInfoButton info = new CmsInfoButton(infoMap);
    VerticalLayout prog = new VerticalLayout();
    Label label = new Label();
    label.setContentMode(ContentMode.HTML);
    label.setValue("<p>" + CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEXCACHE_LABEL_MEMORY_BLOCK_0) + "</p>");
    prog.addComponent(label);
    prog.addComponent(getProgressBar((((float) memory.getUsage() / 100))));
    info.addAdditionalElement(prog, 0);
    info.setWindowCaption(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEX_0));
    info.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEX_0));
    return info;
}

12 View Complete Implementation : CmsDeleteSiteDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Creates content of dialog containing CheckBox if resources should be deleted and a messages.<p>
 *
 * @return vertical layout component.
 */
protected VerticalLayout getContent() {
    String message;
    if (m_sitesToDelete.size() == 1) {
        message = CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CONFIRM_DELETE_SITE_1, m_sitesToDelete.get(0).getreplacedle());
    } else {
        message = "";
        for (CmsSite site : m_sitesToDelete) {
            if (message.length() > 0) {
                message += ", ";
            }
            message += site.getreplacedle();
        }
        message = CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CONFIRM_DELETE_SITES_1, message);
    }
    VerticalLayout layout = new VerticalLayout();
    m_deleteResources = new CheckBox();
    m_deleteResources.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_DELETE_RESOURCES_0));
    m_deleteResources.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_DELETE_RESOURCES_HELP_0));
    layout.addComponent(m_deleteResources);
    Label label = new Label();
    label.setContentMode(ContentMode.HTML);
    label.setValue(message);
    layout.addComponent(label);
    return layout;
}

12 View Complete Implementation : CmsDeleteDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Displays the broken links.<p>
 */
void displayBrokenLinks() {
    CmsObject cms = A_CmsUI.getCmsObject();
    m_resourceBox.removeAllComponents();
    m_deleteResource.setValue(CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_DELETE_MULTI_CONFIRMATION_0));
    m_okButton.setVisible(true);
    boolean canIgnoreBrokenLinks = OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations() || OpenCms.getRoleManager().hasRole(cms, CmsRole.VFS_MANAGER);
    try {
        Multimap<CmsResource, CmsResource> brokenLinks = getBrokenLinks(cms, m_context.getResources(), CmsResource.DELETE_REMOVE_SIBLINGS.equals(m_deleteSiblings.getValue()));
        if (brokenLinks.isEmpty()) {
            m_linksLabel.setVisible(false);
            String noLinksBroken = CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_DELETE_RELATIONS_NOT_BROKEN_0);
            m_resourceBox.addComponent(new Label(noLinksBroken));
        } else {
            if (!canIgnoreBrokenLinks) {
                m_deleteResource.setValue(CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_DELETE_RELATIONS_NOT_ALLOWED_0));
                m_okButton.setVisible(false);
            }
            for (CmsResource source : brokenLinks.keySet()) {
                m_resourceBox.addComponent(new CmsResourceInfo(source));
                for (CmsResource target : brokenLinks.get(source)) {
                    m_resourceBox.addComponent(indent(new CmsResourceInfo(target)));
                }
            }
        }
    } catch (CmsException e) {
        m_context.error(e);
        return;
    }
}

12 View Complete Implementation : CmsLoginUI.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Shows the preplacedword reset dialog.<p>
 */
public void showPreplacedwordResetDialog() {
    String caption = CmsVaadinUtils.getMessageText(Messages.GUI_PWCHANGE_FORGOT_PreplacedWORD_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 CmsForgotPreplacedwordDialog forgotPreplacedword = new CmsForgotPreplacedwordDialog();
    window.addCloseListener(new CloseListener() {

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

        public void windowClose(CloseEvent e) {
            forgotPreplacedword.cancel();
        }
    });
    for (Button button : forgotPreplacedword.getButtons()) {
        dialog.addButton(button);
    }
    r.addWindow(window);
    window.center();
    VerticalLayout vl = result;
    vl.addComponent(forgotPreplacedword);
}

12 View Complete Implementation : EditFlowPalette.java
Copyright GNU General Public License v3.0
Author : JumpMind
protected void addItemToFlowPanelSection(String labelName, String componentType, VerticalLayout componentLayout, StreamResource icon, String componentId) {
    FlowPaletteItem paletteItem = new FlowPaletteItem(labelName);
    if (componentId != null) {
        paletteItem.setShared(true);
        paletteItem.setComponentId(componentId);
    } else {
        paletteItem.setComponentType(componentType);
        paletteItem.setShared(false);
    }
    paletteItem.setIcon(icon);
    paletteItem.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
    paletteItem.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    paletteItem.addStyleName("leftAligned");
    paletteItem.setWidth(100, Unit.PERCENTAGE);
    DragAndDropWrapper wrapper = new DragAndDropWrapper(paletteItem);
    wrapper.setSizeUndefined();
    wrapper.setDragStartMode(DragStartMode.WRAPPER);
    componentLayout.addComponent(wrapper);
    componentLayout.setComponentAlignment(wrapper, Alignment.TOP_CENTER);
}

11 View Complete Implementation : CmsCacheAdminApp.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Creates the component to be shown on accessing the app with some statistical information about the caches.<p>
 *
 * @return a vaadin vertical layout component
 */
private Component getStartComponent() {
    VerticalLayout outerouter = new VerticalLayout();
    VerticalLayout outer = new VerticalLayout();
    outer.setSizeUndefined();
    HorizontalLayout layout = new HorizontalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    // Statistic about heap space
    layout.addComponent(getJavaCacheStatsPanel());
    Panel flex = new Panel();
    // flex.setWidth("400px");
    flex.setContent(CmsCacheViewApp.getFlexStatisticButton().getInfoLayout());
    flex.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEX_0));
    HorizontalLayout flush = new HorizontalLayout();
    flush.addComponent(new CmsFlushCache());
    flush.setMargin(true);
    layout.addComponent(flex);
    outer.addComponent(flush);
    outer.addComponent(layout);
    outerouter.addStyleName("o-center");
    outerouter.addComponent(outer);
    return outerouter;
}

11 View Complete Implementation : CmsUpdateStep02DBDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Get panel for given db pool.<p>
 *
 * @param dbBean to get info from
 * @param pool to show panel for
 * @return Panel
 */
private Panel getDBPoolPanel(CmsUpdateDBManager dbBean, String pool) {
    Panel res = new Panel();
    res.setCaption(pool);
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    String widthString = "300px";
    layout.addComponent(getTableLikeLabel("JDBC Driver", dbBean.getDbDriver(pool), widthString));
    layout.addComponent(getTableLikeLabel("JDBC Connection Url", dbBean.getDbUrl(pool), widthString));
    layout.addComponent(getTableLikeLabel("JDBC Connection Url Params", dbBean.getDbParams(pool), widthString));
    layout.addComponent(getTableLikeLabel("Database User", dbBean.getDbUser(pool), widthString));
    res.setContent(layout);
    return res;
}

11 View Complete Implementation : CmsUpdateStep03DBThreadDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Gets the content.<p>
 *
 * @return VerticalLayout
 */
private VerticalLayout getReportContent() {
    VerticalLayout layout = new VerticalLayout();
    layout.setHeight("100%");
    final CmsStreamReportWidget report = new CmsStreamReportWidget();
    report.setWidth("100%");
    report.setHeight("100%");
    enableOK(false);
    Thread thread = new CmsVaadinUpdateDBThread(m_ui.getUpdateBean(), report);
    thread.start();
    try {
        OutputStream logStream = new FileOutputStream(m_ui.getUpdateBean().getLogName());
        report.setDelegateStream(logStream);
        report.addReportFinishedHandler(() -> {
            try {
                logStream.close();
                report.getStream().close();
                enableOK(true);
                m_finished.setVisible(true);
                m_running.setVisible(false);
            } catch (IOException e) {
            // 
            }
        });
    } catch (FileNotFoundException e1) {
    // 
    }
    layout.addComponent(report);
    return layout;
}

10 View Complete Implementation : CmsHistoryDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * 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();
}

10 View Complete Implementation : CmsShowVersionButtons.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @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);
}

10 View Complete Implementation : CmsPermissionViewTable.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Makes item for table.<p>
 *
 * @param cms CmsObject
 * @param entry ACE
 * @param view permission table
 * @param resPath parentResource (or null)
 * @return VerticalLayout
 */
private VerticalLayout getLayoutFromEntry(CmsObject cms, CmsAccessControlEntry entry, final CmsPermissionView view, String resPath) {
    VerticalLayout res = new VerticalLayout();
    res.setSpacing(false);
    I_CmsPrincipal principal = null;
    try {
        principal = CmsPrincipal.readPrincipalIncludingHistory(cms, entry.getPrincipal());
    } catch (CmsException e) {
        principal = new CmsGroup(entry.getPrincipal(), null, "", "", 0);
    }
    if (principal != null) {
        CmsResourceInfo info = CmsAccountsApp.getPrincipalInfo(principal);
        if (view.isEditable()) {
            CssLayout cssl = new CssLayout();
            Button removeButton = new Button(FontOpenCms.TRASH_SMALL);
            removeButton.addStyleName("borderless o-toolbar-button o-resourceinfo-toolbar o-toolbar-icon-visible");
            removeButton.addClickListener(new ClickListener() {

                private static final long serialVersionUID = -6112693137800596485L;

                public void buttonClick(ClickEvent event) {
                    view.deletePermissionSet();
                }
            });
            cssl.addComponent(removeButton);
            info.setButtonWidget(cssl);
        }
        res.addComponent(info);
        if (resPath != null) {
            Label resLabel = new Label(CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_INHERITED_FROM_1, resPath));
            resLabel.addStyleName("o-report");
            res.addComponent(resLabel);
        }
    }
    res.addComponent(view);
    return res;
}

9 View Complete Implementation : CmsCacheViewApp.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Creates in info button for flex cache statistics.<p>
 *
 * @return CmsInfoButton
 */
protected static CmsInfoButton getFlexStatisticButton() {
    Map<String, String> infoMap = new LinkedHashMap<String, String>();
    CmsFlexCache cache = OpenCms.getFlexCache();
    CmsLruCache entryLruCache = cache.getEntryLruCache();
    infoMap.put(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEXCACHE_LABEL_STATS_KEYS_0), String.valueOf(cache.keySize()));
    infoMap.put(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEXCACHE_LABEL_STATS_VARIATIONS_0), String.valueOf(cache.size()));
    infoMap.put(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEXCACHE_LABEL_MEMORY_MAXSIZE_0), CmsFileUtil.formatFilesize(entryLruCache.getMaxCacheCosts(), A_CmsUI.getCmsObject().getRequestContext().getLocale()));
    infoMap.put(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEXCACHE_LABEL_MEMORY_CURSIZE_0), CmsFileUtil.formatFilesize(entryLruCache.getObjectCosts(), A_CmsUI.getCmsObject().getRequestContext().getLocale()));
    CmsInfoButton info = new CmsInfoButton(infoMap);
    VerticalLayout prog = new VerticalLayout();
    Label label = new Label();
    label.setContentMode(ContentMode.HTML);
    label.setValue("<p>" + CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEXCACHE_LABEL_MEMORY_BLOCK_0) + "</p>");
    prog.addComponent(label);
    prog.addComponent(getProgressBar((float) entryLruCache.getObjectCosts() / (float) entryLruCache.getMaxCacheCosts()));
    info.addAdditionalElement(prog, 0);
    info.setWindowCaption(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEX_0));
    info.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_FLEX_0));
    return info;
}

9 View Complete Implementation : CmsModuleInfoDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Fills the widget content.<p>
 *
 * @param module the module
 */
public void initialize(CmsModule module) {
    boolean empty = true;
    Set<String> resTypeNames = Sets.newHashSet();
    for (I_CmsResourceType type : module.getResourceTypes()) {
        m_resourceTypes.addComponent(formatResourceType(type));
        resTypeNames.add(type.getTypeName());
        empty = false;
    }
    if (empty) {
        m_resourceTypes.addComponent(new Label(CmsVaadinUtils.getMessageText(Messages.GUI_MODULES_NO_RESOURCE_TYPES_0)));
    }
    empty = true;
    for (CmsExplorerTypeSettings expType : module.getExplorerTypes()) {
        if (resTypeNames.contains(expType.getName())) {
            continue;
        }
        m_explorerTypes.addComponent(formatExplorerType(expType));
        empty = false;
    }
    if (empty) {
        m_explorerTypesPanel.setVisible(false);
    }
}

9 View Complete Implementation : A_CmsUI.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Replaces the ui content with a single dialog.<p>
 *
 * TODO: In the future this should only handle window creation, refactor dialog contents to CmsBasicDialog
 *
 * @param caption the caption
 * @param component the dialog content
 */
public void setContentToDialog(String caption, Component component) {
    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(false);
    addWindow(window);
    window.center();
    if (component instanceof I_CmsHasButtons) {
        I_CmsHasButtons hasButtons = (I_CmsHasButtons) component;
        for (Button button : hasButtons.getButtons()) {
            dialog.addButton(button);
        }
    }
    result.addComponent(component);
}

9 View Complete Implementation : CmsHistoryDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * 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));
    }
}

9 View Complete Implementation : CmsPermissionDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Adds list of entries to layout.<p>
 *
 * @param entries the ace list
 * @param layout layout
 * @param editable boolean
 * @param inheritedRes boolean
 */
private void addEntryTableToLayout(List<CmsAccessControlEntry> entries, VerticalLayout layout, boolean editable, boolean inheritedRes) {
    final CmsPermissionViewTable table = new CmsPermissionViewTable(m_cms, entries, editable, inheritedRes, m_parents, this);
    HorizontalLayout hl = new HorizontalLayout();
    Label label = new Label(CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_COUNT_1, new Integer(table.getContainerDataSource().size())));
    label.addStyleName("o-report");
    hl.addComponent(label);
    TextField tableFilter = new TextField();
    tableFilter.setIcon(FontOpenCms.FILTER);
    tableFilter.setInputPrompt(CmsVaadinUtils.getMessageText(org.opencms.ui.apps.Messages.GUI_EXPLORER_FILTER_0));
    tableFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    tableFilter.setWidth("200px");
    tableFilter.addTextChangeListener(new TextChangeListener() {

        private static final long serialVersionUID = 1L;

        public void textChange(TextChangeEvent event) {
            table.filterTable(event.getText());
        }
    });
    hl.addComponent(tableFilter);
    hl.setWidth("100%");
    hl.setExpandRatio(label, 1);
    hl.setMargin(true);
    hl.setComponentAlignment(tableFilter, com.vaadin.ui.Alignment.MIDDLE_RIGHT);
    if (table.getContainerDataSource().size() == 0) {
        layout.addComponent(CmsVaadinUtils.getInfoLayout(Messages.GUI_PERMISSION_EMPTY_0));
    } else {
        layout.addComponent(hl);
        layout.addComponent(table);
        CmsVaadinUtils.centerWindow(this);
    }
}

9 View Complete Implementation : CmsUpdateStep02DBDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Gets the content.<p>
 *
 * @param dbBean to create content for
 * @return VerticalLayout
 */
private VerticalLayout getDisplayContent(CmsUpdateDBManager dbBean) {
    VerticalLayout res = new VerticalLayout();
    res.setSpacing(true);
    Label label = new Label();
    label.setContentMode(ContentMode.HTML);
    String html = "";
    html += "<p>Detected Database is: " + dbBean.getDbName() + "</p>";
    html += "<p>Following db pool(s) will be upgraded:</p>";
    label.setValue(html);
    res.addComponent(label);
    Iterator<String> it = dbBean.getPools().iterator();
    while (it.hasNext()) {
        String pool = it.next();
        res.addComponent(getDBPoolPanel(dbBean, pool));
    }
    return res;
}

8 View Complete Implementation : CmsLinkInFolderValidationApp.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @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;
}

8 View Complete Implementation : CmsTextDiff.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @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 {
    CmsResource resource1 = A_CmsAttributeDiff.readResource(cms, v1);
    String encoding = CmsLocaleManager.getResourceEncoding(cms, resource1);
    I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource1);
    if ((type instanceof CmsResourceTypeXmlContent) || (type instanceof CmsResourceTypePlain) || (type instanceof CmsResourceTypeJsp) || (type instanceof CmsResourceTypeXmlPage) || (type instanceof CmsResourceTypePointer) || (type instanceof CmsResourceTypeBinary)) {
        CmsResource resource2 = A_CmsAttributeDiff.readResource(cms, v2);
        String path1 = resource1.getRootPath();
        String path2 = resource2.getRootPath();
        CmsFile file1 = cms.readFile(resource1);
        CmsFile file2 = cms.readFile(resource2);
        byte[] content1 = file1.getContents();
        byte[] content2 = file2.getContents();
        String originalSource = null;
        String copySource = null;
        I_CmsTextExtractor textExtractor = null;
        // only if both files have contents
        if ((content1.length > 0) && (content2.length > 0)) {
            if (path1.endsWith(".pdf") && path2.endsWith(".pdf")) {
                textExtractor = CmsExtractorPdf.getExtractor();
            } else if (path1.endsWith(".doc") && path2.endsWith(".doc")) {
                textExtractor = CmsExtractorMsOfficeOLE2.getExtractor();
            } else if (path1.endsWith(".xls") && path2.endsWith(".xls")) {
                textExtractor = CmsExtractorMsOfficeOLE2.getExtractor();
            } else if (path1.endsWith(".rtf") && path2.endsWith(".rtf")) {
                textExtractor = CmsExtractorRtf.getExtractor();
            } else if (path1.endsWith(".ppt") && path2.endsWith(".ppt")) {
                textExtractor = CmsExtractorMsOfficeOLE2.getExtractor();
            }
        }
        if (textExtractor != null) {
            try {
                // extract the content
                originalSource = textExtractor.extractText(content1).getContent();
                copySource = textExtractor.extractText(content2).getContent();
            } catch (Exception e) {
                // something goes wrong on extracting content
                // set the content to null, so the content dialog will not be shown
                originalSource = null;
                copySource = null;
                LOG.error(e.getMessage(), e);
            }
        } else if ((type instanceof CmsResourceTypePlain) || (type instanceof CmsResourceTypeJsp) || (type instanceof CmsResourceTypePointer)) {
            try {
                originalSource = new String(content1, encoding);
                copySource = new String(content2, encoding);
            } catch (UnsupportedEncodingException e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        if ((copySource == null) || (originalSource == null)) {
            return Optional.absent();
        }
        try {
            CmsTextDiffPanel diffPanel = new CmsTextDiffPanel(originalSource, copySource, false, true);
            diffPanel.setWidth("100%");
            Panel panel = new Panel(CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_TEXT_COMPARISON_CAPTION_0));
            panel.setWidth("100%");
            VerticalLayout vl = new VerticalLayout();
            vl.setMargin(true);
            vl.addComponent(diffPanel);
            panel.setContent(vl);
            return Optional.<Component>fromNullable(panel);
        } catch (Exception e) {
            LOG.error(e.getLocalizedMessage(), e);
            return Optional.absent();
        }
    } else {
        return Optional.absent();
    }
}

7 View Complete Implementation : CmsLinkValidationApp.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * 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;
}

7 View Complete Implementation : CmsSourceSearchApp.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @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;
}

7 View Complete Implementation : ExportDialog.java
Copyright GNU General Public License v3.0
Author : JumpMind
private void addSelectedAndDependentObjects(VerticalLayout layout, Object selected) {
    IConfigurationService configurationService = context.getConfigurationService();
    FlowName selectedFlow = null;
    RelationalModelName selectedModel = null;
    ResourceName selectedResource = null;
    boolean allChecked = false;
    if (selected instanceof ProjectVersion) {
        ProjectVersion project = (ProjectVersion) selected;
        projectVersionId = project.getId();
        allChecked = true;
    } else if (selected instanceof FlowName) {
        selectedFlow = (FlowName) selected;
        projectVersionId = selectedFlow.getProjectVersionId();
    } else if (selected instanceof RelationalModelName) {
        selectedModel = (RelationalModelName) selected;
        projectVersionId = selectedModel.getProjectVersionId();
    } else if (selected instanceof ResourceName) {
        selectedResource = (ResourceName) selected;
        projectVersionId = selectedResource.getProjectVersionId();
    }
    List<FlowName> allFlows = configurationService.findFlowsInProject(projectVersionId, false);
    allFlows.addAll(configurationService.findFlowsInProject(projectVersionId, true));
    AbstractObjectNameBasedSorter.sort(allFlows);
    // flows
    exportFlowGroup = new OptionGroup("Flows");
    exportFlowGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    exportFlowGroup.setMultiSelect(true);
    for (FlowName key : allFlows) {
        exportFlowGroup.addItem(key.getId());
        exportFlowGroup.sereplacedemCaption(key.getId(), key.getName());
        if (allChecked || key.equals(selectedFlow)) {
            exportFlowGroup.select(key.getId());
        }
    }
    exportFlowGroup.addValueChangeListener(selectedItem -> updateAffectedObjects());
    layout.addComponent(exportFlowGroup);
    // models
    List<RelationalModelName> models = configurationService.findRelationalModelsInProject(projectVersionId);
    AbstractObjectNameBasedSorter.sort(models);
    exportModelGroup = new OptionGroup("Models");
    exportModelGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    exportModelGroup.setMultiSelect(true);
    for (RelationalModelName key : models) {
        exportModelGroup.addItem(key.getId());
        exportModelGroup.sereplacedemCaption(key.getId(), key.getName());
        if (allChecked || key.equals(selectedModel)) {
            exportModelGroup.select(key.getId());
        }
    }
    layout.addComponent(exportModelGroup);
    // resources
    List<ResourceName> resources = configurationService.findResourcesInProject(projectVersionId);
    AbstractObjectNameBasedSorter.sort(resources);
    exportResourceGroup = new OptionGroup("Resources");
    exportResourceGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    exportResourceGroup.setMultiSelect(true);
    for (ResourceName key : resources) {
        exportResourceGroup.addItem(key.getId());
        exportResourceGroup.sereplacedemCaption(key.getId(), key.getName());
        if (allChecked || key.equals(selectedResource)) {
            exportResourceGroup.select(key.getId());
        }
    }
    layout.addComponent(exportResourceGroup);
    @SuppressWarnings("unchecked")
    Set<String> flowIds = (Set<String>) exportFlowGroup.getValue();
    for (String flowId : flowIds) {
        addDependentModels(flowId);
        addDependentResources(flowId);
    }
}

5 View Complete Implementation : CmsCacheViewApp.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Creates the view for the image cache.<p>
 *
 * @return a vaadin vertical layout with the information about the image cache
 */
private Component getImageViewComponent() {
    m_siteTableFilter = new TextField();
    HorizontalSplitPanel sp = new HorizontalSplitPanel();
    sp.setSizeFull();
    VerticalLayout intro = CmsVaadinUtils.getInfoLayout(Messages.GUI_CACHE_IMAGE_INTRODUCTION_0);
    VerticalLayout nullResult = CmsVaadinUtils.getInfoLayout(Messages.GUI_CACHE_IMAGE_NO_RESULTS_0);
    final CmsImageCacheTable table = new CmsImageCacheTable(intro, nullResult, m_siteTableFilter);
    sp.setFirstComponent(new CmsImageCacheInput(table));
    VerticalLayout secC = new VerticalLayout();
    secC.setSizeFull();
    secC.addComponent(intro);
    secC.addComponent(nullResult);
    secC.addComponent(table);
    m_siteTableFilter.setIcon(FontOpenCms.FILTER);
    m_siteTableFilter.setInputPrompt(Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_FILTER_0));
    m_siteTableFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    m_siteTableFilter.setWidth("200px");
    m_siteTableFilter.addTextChangeListener(new TextChangeListener() {

        private static final long serialVersionUID = 1L;

        public void textChange(TextChangeEvent event) {
            table.filterTable(event.getText());
        }
    });
    m_infoLayout.addComponent(m_siteTableFilter);
    m_uiContext.addToolbarButton(getImageStatisticButton());
    m_uiContext.addToolbarButton(CmsFlushCache.getFlushToolButton());
    table.setSizeFull();
    sp.setSecondComponent(secC);
    sp.setSplitPosition(CmsFileExplorer.LAYOUT_SPLIT_POSITION, Unit.PIXELS);
    table.setVisible(false);
    nullResult.setVisible(false);
    m_siteTableFilter.setVisible(false);
    return sp;
}

5 View Complete Implementation : CmsUpdateStep02DBDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @see org.opencms.setup.updater.dialogs.A_CmsUpdateDialog#init(org.opencms.setup.CmsUpdateUI)
 */
@Override
public boolean init(CmsUpdateUI ui) {
    CmsVaadinUtils.readAndLocalizeDesign(this, null, null);
    super.init(ui, true, true);
    setCaption("OpenCms Update-Wizard - Database upgrade");
    CmsUpdateBean bean = ui.getUpdateBean();
    bean.updateDBDriverProperties();
    m_dbBean = new CmsUpdateDBManager();
    try {
        m_dbBean.initialize(bean);
    } catch (Exception e) {
    // 
    }
    try {
        bean.setDetectedVersion(m_dbBean.getDetectedVersion());
        if (m_dbBean.needUpdate()) {
            m_icon.setContentMode(ContentMode.HTML);
            m_icon.setValue(FontOpenCms.WARNING.getHtml());
            m_contentLayout.addComponent(getDisplayContent(m_dbBean));
            return true;
        } else {
            ui.displayDialog(new CmsUpdateStep04SettingsDialog());
            return false;
        }
    } catch (NullPointerException en) {
        CmsSetupErrorDialog.showErrorDialog("Database error", "Your database version is not compatible with OpenCms 11.");
        return false;
    }
}

5 View Complete Implementation : EditXsltPanel.java
Copyright GNU General Public License v3.0
Author : JumpMind
protected void buildUI() {
    ButtonBar buttonBar = new ButtonBar();
    addComponent(buttonBar);
    if (!readOnly) {
        Button testButton = buttonBar.addButton("Test", FontAwesome.FILE_CODE_O);
        testButton.addClickListener(new TestClickListener());
    }
    filterField = buttonBar.addFilter();
    filterField.addTextChangeListener(this);
    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
    splitPanel.setSizeFull();
    splitPanel.setSplitPosition(50, Unit.PERCENTAGE);
    VerticalLayout leftLayout = new VerticalLayout();
    editor = new AceEditor();
    editor.setMode(AceMode.xml);
    editor.setSizeFull();
    editor.setHighlightActiveLine(true);
    editor.setShowPrintMargin(false);
    editor.addValueChangeListener(new StylesheetChangeListener());
    editor.setValue(component.findSetting(XsltProcessor.XSLT_PROCESSOR_STYLESHEET).getValue());
    leftLayout.addComponent(new Label("XSLT Stylesheet"));
    leftLayout.addComponent(editor);
    leftLayout.setExpandRatio(editor, 1.0f);
    leftLayout.setSizeFull();
    splitPanel.setFirstComponent(leftLayout);
    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setSizeFull();
    rightLayout.addComponent(new Label("Sample Input XML"));
    textArea = new TextArea();
    textArea.setEnabled(false);
    textArea.setSizeFull();
    textArea.setValue(getSampleXml());
    rightLayout.addComponent(textArea);
    rightLayout.setExpandRatio(textArea, 1.0f);
    splitPanel.setSecondComponent(rightLayout);
    addComponent(splitPanel);
    setExpandRatio(splitPanel, 1.0f);
    textArea.setReadOnly(readOnly);
    editor.setReadOnly(readOnly);
}

4 View Complete Implementation : TagDialog.java
Copyright GNU General Public License v3.0
Author : JumpMind
public void addTagObjects(VerticalLayout tagLayout, Object selected) {
    if (selected instanceof Project) {
        Project project = (Project) selected;
        enreplacedyId = project.getId();
        enreplacedyType = project.getClreplaced().getName();
    }
    List<EnreplacedyTag> enreplacedyTags = configurationService.findEnreplacedyTagsForEnreplacedy(enreplacedyId);
    List<Tag> tags = configurationService.findTags();
    tagGroup = new OptionGroup("Tags");
    tagGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    tagGroup.setMultiSelect(true);
    for (Tag tag : tags) {
        tagGroup.addItem(tag.getId());
        tagGroup.sereplacedemCaption(tag.getId(), tag.getName());
        for (EnreplacedyTag enreplacedyTag : enreplacedyTags) {
            if (tag.getId().equals(enreplacedyTag.getTagId())) {
                tagGroup.select(tag.getId());
                break;
            }
        }
    }
    tagGroup.addValueChangeListener(selectedItem -> updateAffectedObjects());
    tagLayout.addComponent(tagGroup);
}

3 View Complete Implementation : GeneralSettingsPanel.java
Copyright GNU General Public License v3.0
Author : JumpMind
public void init() {
    form = new FormLayout();
    form.addStyleName(ValoTheme.FORMLAYOUT_LIGHT);
    Label section = new Label("Display Settings");
    section.addStyleName(ValoTheme.LABEL_H3);
    section.addStyleName(ValoTheme.LABEL_COLORED);
    form.addComponent(section);
    addSetting("System Text", GlobalSetting.SYSTEM_TEXT, "", "Set HTML content to be displayed in the top bar that can identify a particular environment").focus();
    section = new Label("Auto Backup");
    section.addStyleName(ValoTheme.LABEL_H3);
    section.addStyleName(ValoTheme.LABEL_COLORED);
    form.addComponent(section);
    Label instructions = new Label("A restart is required after changing these settings");
    instructions.addStyleName(ValoTheme.LABEL_LIGHT);
    form.addComponent(instructions);
    addSetting("Enable Backup", GlobalSetting.CONFIG_BACKUP_ENABLED, Boolean.toString(GlobalSetting.DEFAULT_CONFIG_BACKUP_ENABLED), THIS_WILL_TAKE_EFFECT_ON_THE_NEXT_SERVER_RESTART, Boolean.clreplaced);
    addSetting("Backup Cron Expression", GlobalSetting.CONFIG_BACKUP_CRON, GlobalSetting.DEFAULT_CONFIG_BACKUP_CRON, THIS_WILL_TAKE_EFFECT_ON_THE_NEXT_SERVER_RESTART, String.clreplaced);
    addSetting("Retention in Days", GlobalSetting.CONFIG_BACKUP_RETENTION_IN_DAYS, Integer.toString(GlobalSetting.DEFAULT_CONFIG_BACKUP_RETENTION_IN_DAYS), THIS_WILL_TAKE_EFFECT_ON_THE_NEXT_SERVER_RESTART, Integer.clreplaced);
    VerticalLayout paddedLayout = new VerticalLayout();
    paddedLayout.setMargin(true);
    paddedLayout.addComponent(form);
    addComponent(paddedLayout);
}

2 View Complete Implementation : RelationalMappingPanel.java
Copyright GNU General Public License v3.0
Author : JumpMind
protected void buildUI() {
    inputModel = ((RelationalModel) component.getInputModel());
    outputModel = ((RelationalModel) component.getOutputModel());
    ButtonBar buttonBar = new ButtonBar();
    if (!readOnly) {
        addComponent(buttonBar);
        Button autoMapButton = buttonBar.addButton("Auto Map", FontAwesome.FLASH);
        removeButton = buttonBar.addButton("Remove", FontAwesome.TRASH_O);
        removeButton.setEnabled(false);
        autoMapButton.addClickListener(new AutoMapListener());
        removeButton.addClickListener(new RemoveListener());
    }
    buttonBar.addButtonRight("Export", FontAwesome.DOWNLOAD, (e) -> export());
    HorizontalLayout replacedleHeader = new HorizontalLayout();
    replacedleHeader.setSpacing(true);
    replacedleHeader.setMargin(new MarginInfo(false, true, false, true));
    replacedleHeader.setWidth(100f, Unit.PERCENTAGE);
    replacedleHeader.addComponent(new Label("<b>Input Model:</b>  " + (inputModel != null ? inputModel.getName() : "?"), ContentMode.HTML));
    replacedleHeader.addComponent(new Label("<b>Output Model:</b>  " + (outputModel != null ? outputModel.getName() : "?"), ContentMode.HTML));
    addComponent(replacedleHeader);
    HorizontalLayout filterHeader = new HorizontalLayout();
    filterHeader.setSpacing(true);
    filterHeader.setMargin(new MarginInfo(true, true, true, true));
    filterHeader.setWidth(100f, Unit.PERCENTAGE);
    HorizontalLayout srcFilterHeader = new HorizontalLayout();
    srcFilterHeader.setSpacing(true);
    srcFilterHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    filterHeader.addComponent(srcFilterHeader);
    HorizontalLayout dstFilterHeader = new HorizontalLayout();
    dstFilterHeader.setSpacing(true);
    dstFilterHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    filterHeader.addComponent(dstFilterHeader);
    addComponent(filterHeader);
    srcTextFilter = new TextField();
    srcTextFilter.setWidth(20, Unit.EM);
    srcTextFilter.setInputPrompt("Filter");
    srcTextFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    srcTextFilter.setIcon(FontAwesome.SEARCH);
    srcTextFilter.setImmediate(true);
    srcTextFilter.setTextChangeEventMode(TextChangeEventMode.LAZY);
    srcTextFilter.setTextChangeTimeout(200);
    srcTextFilter.addTextChangeListener(new FilterInputTextListener());
    srcFilterHeader.addComponent(srcTextFilter);
    srcMapFilter = new CheckBox("Mapped Only");
    srcMapFilter.addValueChangeListener(new FilterSrcMapListener());
    srcFilterHeader.addComponent(srcMapFilter);
    dstTextFilter = new TextField();
    dstTextFilter.setWidth(20, Unit.EM);
    dstTextFilter.setInputPrompt("Filter");
    dstTextFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    dstTextFilter.setIcon(FontAwesome.SEARCH);
    dstTextFilter.setImmediate(true);
    dstTextFilter.setTextChangeEventMode(TextChangeEventMode.LAZY);
    dstTextFilter.setTextChangeTimeout(200);
    dstTextFilter.addTextChangeListener(new FilterOutputTextListener());
    dstFilterHeader.addComponent(dstTextFilter);
    dstMapFilter = new CheckBox("Mapped Only");
    dstMapFilter.addValueChangeListener(new FilterDstMapListener());
    dstFilterHeader.addComponent(dstMapFilter);
    Panel panel = new Panel();
    VerticalLayout vlay = new VerticalLayout();
    vlay.setSizeFull();
    diagram = new MappingDiagram(context, component, readOnly);
    diagram.setSizeFull();
    vlay.addComponent(diagram);
    panel.setContent(vlay);
    panel.setSizeFull();
    addComponent(panel);
    setExpandRatio(panel, 1.0f);
    diagram.addListener(new EventListener());
}

2 View Complete Implementation : AdminView.java
Copyright GNU General Public License v3.0
Author : JumpMind
@PostConstruct
protected void init() {
    setSizeFull();
    tabbedPanel = new TabbedPanel();
    HorizontalSplitPanel leftSplit = new HorizontalSplitPanel();
    leftSplit.setSizeFull();
    leftSplit.setSplitPosition(UIConstants.DEFAULT_LEFT_SPLIT, Unit.PIXELS);
    VerticalLayout container = new VerticalLayout();
    container.setSizeFull();
    container.addComponent(tabbedPanel);
    leftSplit.setSecondComponent(container);
    table = new TreeTable();
    table.addStyleName(ValoTheme.TREETABLE_NO_HORIZONTAL_LINES);
    table.addStyleName(ValoTheme.TREETABLE_NO_STRIPES);
    table.addStyleName(ValoTheme.TREETABLE_NO_VERTICAL_LINES);
    table.addStyleName(ValoTheme.TREETABLE_BORDERLESS);
    table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN);
    table.setSizeFull();
    table.setCacheRate(100);
    table.setPageLength(100);
    table.setImmediate(true);
    table.setSelectable(true);
    table.addItemClickListener(this);
    table.addStyleName("noselect");
    table.addContainerProperty("id", String.clreplaced, null);
    table.setVisibleColumns(new Object[] { "id" });
    table.setColumnExpandRatio("id", 1);
    for (AdminSideView sideView : sideMenu) {
        AdminMenuLink link = (AdminMenuLink) sideView.getClreplaced().getAnnotation(AdminMenuLink.clreplaced);
        sideView.setAdminView(this);
        if (link != null && link.uiClreplaced().equals(AppUI.clreplaced) && sideView.isAccessible()) {
            addItem(link.id(), link.icon());
            sideMenuById.put(link.id(), sideView.getView());
        }
    }
    VerticalLayout navigator = new VerticalLayout();
    navigator.addStyleName(ValoTheme.MENU_ROOT);
    navigator.setSizeFull();
    leftSplit.setFirstComponent(navigator);
    MenuBar leftMenuBar = new MenuBar();
    leftMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    leftMenuBar.setWidth(100, Unit.PERCENTAGE);
    navigator.addComponent(leftMenuBar);
    navigator.addComponent(table);
    navigator.setExpandRatio(table, 1);
    addComponent(leftSplit);
}

1 View Complete Implementation : CmsValueDiff.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @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(final CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2) throws CmsException {
    CmsResource resource1 = A_CmsAttributeDiff.readResource(cms, v1);
    I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(resource1);
    CmsMacroResolver resolver = new CmsVersionMacroResolver(v1, v2);
    if ((type instanceof CmsResourceTypeXmlContent) || (type instanceof CmsResourceTypeXmlPage)) {
        CmsResource resource2 = A_CmsAttributeDiff.readResource(cms, v2);
        final Panel panel = new Panel(CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_CONTENT_VALUE_TABLE_CAPTION_0));
        final CmsFile file1 = cms.readFile(resource1);
        final CmsFile file2 = cms.readFile(resource2);
        VerticalLayout vl = new VerticalLayout();
        vl.setMargin(true);
        vl.setSpacing(true);
        Table table = buildValueComparisonTable(cms, panel, file1, file2, resolver);
        if (table.getContainerDataSource().size() == 0) {
            return Optional.absent();
        }
        Button fileTextCompareButton = new Button(CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_COMPARE_WHOLE_FILE_0));
        vl.addComponent(fileTextCompareButton);
        vl.setComponentAlignment(fileTextCompareButton, Alignment.MIDDLE_RIGHT);
        fileTextCompareButton.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 1L;

            @SuppressWarnings("synthetic-access")
            public void buttonClick(ClickEvent event) {
                Component diffView = buildWholeFileDiffView(cms, file1, file2);
                CmsHistoryDialog.openChildDialog(panel, diffView, CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_COMPARE_WHOLE_FILE_0));
            }
        });
        vl.addComponent(table);
        panel.setContent(vl);
        Component result = panel;
        return Optional.fromNullable(result);
    } else {
        return Optional.absent();
    }
}

0 View Complete Implementation : A_CmsAttributeDiff.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * @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.clreplaced, 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);
}

0 View Complete Implementation : RelationalHierarchicalMappingPanel.java
Copyright GNU General Public License v3.0
Author : JumpMind
protected void buildUI() {
    this.inputModel = (RelationalModel) component.getInputModel();
    this.outputModel = (HierarchicalModel) component.getOutputModel();
    ButtonBar buttonBar = new ButtonBar();
    if (!readOnly) {
        addComponent(buttonBar);
        Button byQueryMapButton = buttonBar.addButton("By Query Map", FontAwesome.MAP);
        removeButton = buttonBar.addButton("Remove", FontAwesome.TRASH_O);
        removeButton.setEnabled(false);
        byQueryMapButton.addClickListener(new ByQueryMapListener());
        String queryMethod = component.get(RelationalHierarchicalMapping.HIERARCHICAL_QUERY_METHOD, RelationalHierarchicalMapping.QUERY_METHOD_BY_JOIN);
        if (queryMethod.equalsIgnoreCase(RelationalHierarchicalMapping.QUERY_METHOD_BY_JOIN)) {
            byQueryMapButton.setEnabled(false);
        }
        removeButton.addClickListener(new RemoveListener());
    }
    buttonBar.addButtonRight("Export", FontAwesome.DOWNLOAD, (e) -> export());
    HorizontalLayout replacedleHeader = new HorizontalLayout();
    replacedleHeader.setSpacing(true);
    replacedleHeader.setMargin(new MarginInfo(false, true, false, true));
    replacedleHeader.setWidth(100f, Unit.PERCENTAGE);
    replacedleHeader.addComponent(new Label("<b>Input Model:</b>  " + (component.getInputModel() != null ? component.getInputModel().getName() : "?"), ContentMode.HTML));
    replacedleHeader.addComponent(new Label("<b>Output Model:</b>  " + (component.getOutputModel() != null ? component.getOutputModel().getName() : "?"), ContentMode.HTML));
    addComponent(replacedleHeader);
    HorizontalLayout filterHeader = new HorizontalLayout();
    filterHeader.setSpacing(true);
    filterHeader.setMargin(new MarginInfo(true, true, true, true));
    filterHeader.setWidth(100f, Unit.PERCENTAGE);
    HorizontalLayout srcFilterHeader = new HorizontalLayout();
    srcFilterHeader.setSpacing(true);
    srcFilterHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    filterHeader.addComponent(srcFilterHeader);
    HorizontalLayout dstFilterHeader = new HorizontalLayout();
    dstFilterHeader.setSpacing(true);
    dstFilterHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    filterHeader.addComponent(dstFilterHeader);
    addComponent(filterHeader);
    srcTextFilter = new TextField();
    srcTextFilter.setWidth(20, Unit.EM);
    srcTextFilter.setInputPrompt("Filter");
    srcTextFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    srcTextFilter.setIcon(FontAwesome.SEARCH);
    srcTextFilter.setImmediate(true);
    srcTextFilter.setTextChangeEventMode(TextChangeEventMode.LAZY);
    srcTextFilter.setTextChangeTimeout(200);
    srcTextFilter.addTextChangeListener(new FilterInputTextListener());
    srcFilterHeader.addComponent(srcTextFilter);
    srcMapFilter = new CheckBox("Mapped Only");
    srcMapFilter.addValueChangeListener(new FilterSrcMapListener());
    srcFilterHeader.addComponent(srcMapFilter);
    dstTextFilter = new TextField();
    dstTextFilter.setWidth(20, Unit.EM);
    dstTextFilter.setInputPrompt("Filter");
    dstTextFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    dstTextFilter.setIcon(FontAwesome.SEARCH);
    dstTextFilter.setImmediate(true);
    dstTextFilter.setTextChangeEventMode(TextChangeEventMode.LAZY);
    dstTextFilter.setTextChangeTimeout(200);
    dstTextFilter.addTextChangeListener(new FilterOutputTextListener());
    dstFilterHeader.addComponent(dstTextFilter);
    dstMapFilter = new CheckBox("Mapped Only");
    dstMapFilter.addValueChangeListener(new FilterDstMapListener());
    dstFilterHeader.addComponent(dstMapFilter);
    Panel panel = new Panel();
    VerticalLayout vlay = new VerticalLayout();
    vlay.setSizeFull();
    diagram = new MappingDiagram(context, component, readOnly);
    diagram.setSizeFull();
    vlay.addComponent(diagram);
    panel.setContent(vlay);
    panel.setSizeFull();
    addComponent(panel);
    setExpandRatio(panel, 1.0f);
    diagram.addListener(new EventListener());
    buildByQueryMappingWindow();
}

0 View Complete Implementation : CmsFlushCache.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Creates the button layout.<p>
 *
 * @param size number ob buttons per line
 * @param clickedRunnable click runnable
 * @return VerticalLayout
 */
protected static VerticalLayout getButtonLayout(int size, final Runnable clickedRunnable) {
    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    Button clean_flex = getFlushButton(Messages.GUI_CACHE_FLEXCACHE_CLEAN_ADMIN_TOOL_NAME_0, Messages.GUI_CACHE_FLEXCACHE_CLEAN_ADMIN_TOOL_HELP_0, new CmsFlexCacheCleanDialog(), clickedRunnable);
    Button clean_image = getFlushButton(Messages.GUI_CACHE_IMAGECACHE_CLEAN_ADMIN_TOOL_NAME_0, Messages.GUI_CACHE_IMAGECACHE_CLEAN_ADMIN_TOOL_HELP_0, new CmsImageCacheCleanDialog(), clickedRunnable);
    Button clean_core = getFlushButton(Messages.GUI_CACHE_CORECACHE_CLEAN_ADMIN_TOOL_NAME_0, Messages.GUI_CACHE_CORECACHE_CLEAN_ADMIN_TOOL_HELP_0, new CmsConfirmSimpleFlushDialog(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_CORECACHE_CLEAN_ADMIN_TOOL_CONF_0)), new Runnable() {

        public void run() {
            OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_CLEAR_CACHES, null));
            clickedRunnable.run();
        }
    });
    Button clean_repo = getFlushButton(Messages.GUI_CACHE_JSP_REPOSITORY_ADMIN_TOOL_NAME_0, Messages.GUI_CACHE_JSP_REPOSITORY_ADMIN_TOOL_HELP_0, new CmsConfirmSimpleFlushDialog(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_JSP_REPOSITORY_ADMIN_TOOL_CONF_0)), new Runnable() {

        public void run() {
            OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_FLEX_PURGE_JSP_REPOSITORY, Collections.<String, Object>emptyMap()));
            OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR, Collections.<String, Object>singletonMap("action", new Integer(CmsFlexCache.CLEAR_ENTRIES))));
            clickedRunnable.run();
        }
    });
    Button reini = getFlushButton(Messages.GUI_CACHE_REINI_TOOL_NAME_0, Messages.GUI_CACHE_REINI_TOOL_NAME_HELP_0, new CmsConfirmSimpleFlushDialog(CmsVaadinUtils.getMessageText(Messages.GUI_CACHE_REINI_TOOL_CONF_0)), new Runnable() {

        public void run() {
            try {
                // re-initialize the workplace
                OpenCms.getWorkplaceManager().initialize(A_CmsUI.getCmsObject());
                // fire "clear caches" event to reload all cached resource bundles
                OpenCms.fireCmsEvent(I_CmsEventListener.EVENT_CLEAR_CACHES, new HashMap<String, Object>());
                clickedRunnable.run();
            } catch (CmsException e) {
                LOG.error("Unable to reinitialize workspace", e);
            }
        }
    });
    List<Component> elements = new ArrayList<Component>();
    elements.add(clean_core);
    elements.add(clean_flex);
    elements.add(clean_image);
    elements.add(reini);
    elements.add(clean_repo);
    HorizontalLayout row = new HorizontalLayout();
    row.setSpacing(true);
    for (int i = 0; i < elements.size(); i++) {
        if (size > 0) {
            row.addComponent(elements.get(i));
            if (((i % (size - 1)) == 0) & (i > 0)) {
                layout.addComponent(row);
                row = new HorizontalLayout();
                row.setSpacing(true);
            }
        } else {
            layout.addComponent(elements.get(i));
        }
    }
    return layout;
}

0 View Complete Implementation : MailServerPanel.java
Copyright GNU General Public License v3.0
Author : JumpMind
@PostConstruct
@Override
public void init() {
    final GlobalSetting hostNameSetting = getGlobalSetting(MailSession.SETTING_HOST_NAME, "localhost");
    final GlobalSetting transportSetting = getGlobalSetting(MailSession.SETTING_TRANSPORT, "smtp");
    final GlobalSetting portSetting = getGlobalSetting(MailSession.SETTING_PORT_NUMBER, "25");
    final GlobalSetting fromSetting = getGlobalSetting(MailSession.SETTING_FROM, "metl@localhost");
    final GlobalSetting usernameSetting = getGlobalSetting(MailSession.SETTING_USERNAME, "");
    final GlobalSetting preplacedwordSetting = getGlobalSetting(MailSession.SETTING_PreplacedWORD, "");
    final GlobalSetting useTlsSetting = getGlobalSetting(MailSession.SETTING_USE_TLS, "false");
    final GlobalSetting useAuthSetting = getGlobalSetting(MailSession.SETTING_USE_AUTH, "false");
    FormLayout form = new FormLayout();
    form.setSpacing(true);
    ImmediateUpdateTextField hostField = new ImmediateUpdateTextField("Host name") {

        protected void save(String value) {
            saveSetting(hostNameSetting, value);
        }
    };
    hostField.setValue(hostNameSetting.getValue());
    hostField.setWidth(25f, Unit.EM);
    form.addComponent(hostField);
    hostField.focus();
    NativeSelect transportField = new NativeSelect("Transport");
    transportField.addItem("smtp");
    transportField.addItem("smtps");
    transportField.addItem("mock_smtp");
    transportField.select(transportSetting.getValue() == null ? "smtp" : transportSetting.getValue());
    transportField.setNullSelectionAllowed(false);
    transportField.setImmediate(true);
    transportField.setWidth(10f, Unit.EM);
    transportField.addValueChangeListener(new ValueChangeListener() {

        public void valueChange(ValueChangeEvent event) {
            saveSetting(transportSetting, (String) event.getProperty().getValue());
        }
    });
    form.addComponent(transportField);
    ImmediateUpdateTextField portField = new ImmediateUpdateTextField("Port") {

        protected void save(String value) {
            saveSetting(portSetting, value);
        }
    };
    portField.setValue(portSetting.getValue());
    portField.setWidth(25f, Unit.EM);
    form.addComponent(portField);
    ImmediateUpdateTextField fromField = new ImmediateUpdateTextField("From Address") {

        protected void save(String value) {
            saveSetting(fromSetting, value);
        }
    };
    fromField.setValue(fromSetting.getValue());
    fromField.setWidth(25f, Unit.EM);
    form.addComponent(fromField);
    CheckBox tlsField = new CheckBox("Use TLS", Boolean.valueOf(useTlsSetting.getValue()));
    tlsField.setImmediate(true);
    tlsField.addValueChangeListener(new ValueChangeListener() {

        public void valueChange(ValueChangeEvent event) {
            saveSetting(useTlsSetting, ((Boolean) event.getProperty().getValue()).toString());
        }
    });
    form.addComponent(tlsField);
    final ImmediateUpdateTextField userField = new ImmediateUpdateTextField("Username") {

        protected void save(String value) {
            saveSetting(usernameSetting, value);
        }
    };
    userField.setValue(usernameSetting.getValue());
    userField.setWidth(25f, Unit.EM);
    final ImmediateUpdatePreplacedwordField preplacedwordField = new ImmediateUpdatePreplacedwordField("Preplacedword") {

        protected void save(String value) {
            saveSetting(preplacedwordSetting, value);
        }
    };
    preplacedwordField.setValue(preplacedwordSetting.getValue());
    preplacedwordField.setWidth(25f, Unit.EM);
    CheckBox authField = new CheckBox("Use Authentication", Boolean.valueOf(useAuthSetting.getValue()));
    authField.setImmediate(true);
    authField.addValueChangeListener(new ValueChangeListener() {

        public void valueChange(ValueChangeEvent event) {
            Boolean isEnabled = (Boolean) event.getProperty().getValue();
            saveSetting(useAuthSetting, isEnabled.toString());
            userField.setEnabled(isEnabled);
            preplacedwordField.setEnabled(isEnabled);
        }
    });
    form.addComponent(authField);
    userField.setEnabled(authField.getValue());
    form.addComponent(userField);
    preplacedwordField.setEnabled(authField.getValue());
    form.addComponent(preplacedwordField);
    Button testButton = new Button("Test Connection");
    testButton.addClickListener(new TestClickListener());
    form.addComponent(testButton);
    VerticalLayout paddedLayout = new VerticalLayout();
    paddedLayout.setMargin(true);
    paddedLayout.addComponent(form);
    addComponent(paddedLayout);
}