com.vaadin.ui.AbstractComponent - java examples

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

40 Examples 7

19 View Complete Implementation : VaadinIndication.java
Copyright Apache License 2.0
Author : BrunoEberhard
public static void setValidationMessages(List<String> validationMessages, AbstractComponent component) {
    if (validationMessages.isEmpty()) {
        component.setComponentError(null);
    } else if (validationMessages.size() == 1) {
        component.setComponentError(new UserError(validationMessages.get(0)));
    } else {
        ErrorMessage[] errorMessages = new ErrorMessage[validationMessages.size()];
        for (int i = 0; i < validationMessages.size(); i++) {
            errorMessages[i] = new UserError(validationMessages.get(i));
        }
        CompositeErrorMessage compositeErrorMessage = new CompositeErrorMessage(errorMessages);
        component.setComponentError(compositeErrorMessage);
    }
}

19 View Complete Implementation : Vaadin.java
Copyright Apache License 2.0
Author : BrunoEberhard
public static ContextMenu createMenu(AbstractComponent parentComponent, List<Action> actions) {
    if (actions != null && actions.size() > 0) {
        ContextMenu menu = new ContextMenu(parentComponent, true);
        addActions(menu, actions);
        return menu;
    }
    return null;
}

19 View Complete Implementation : InvalidValueExceptionHandler.java
Copyright Apache License 2.0
Author : cuba-platform
@Override
public boolean handle(ErrorEvent event, App app) {
    boolean handled = super.handle(event, app);
    if (handled && event.getThrowable() != null) {
        // Finds the original source of the error/exception
        AbstractComponent component = DefaultErrorHandler.findAbstractComponent(event);
        if (component != null) {
            component.markAsDirty();
        }
        if (component instanceof Component.Focusable) {
            ((Component.Focusable) component).focus();
        }
    }
    return handled;
}

19 View Complete Implementation : WebAbstractComponent.java
Copyright Apache License 2.0
Author : cuba-platform
protected boolean hasValidationError() {
    if (getComposition() instanceof AbstractComponent) {
        AbstractComponent composition = (AbstractComponent) getComposition();
        return composition.getComponentError() instanceof UserError;
    }
    return false;
}

19 View Complete Implementation : CubaHistoryControl.java
Copyright Apache License 2.0
Author : cuba-platform
public void extend(AbstractComponent target, HistoryBackHandler handler) {
    super.extend(target);
    this.handler = handler;
}

19 View Complete Implementation : CubaTimer.java
Copyright Apache License 2.0
Author : cuba-platform
public void extend(AbstractComponent component) {
    super.extend(component);
}

19 View Complete Implementation : EditableTicketRowRenderer.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private AbstractComponent wrapListenerComponent(AbstractComponent component) {
    if (component instanceof LazyPopupView) {
        ((LazyPopupView) component).addPropertyChangeListener(this);
    }
    return component;
}

19 View Complete Implementation : DrillDownReportSplitPanel.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@Override
public void setFirstComponent(AbstractComponent optionsPanel) {
    top.removeAllComponents();
    top.addComponent(optionsPanel);
}

19 View Complete Implementation : DrillDownReportSplitPanel.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@Override
public void setSecondComponent(AbstractComponent splash) {
    bottom.removeAllComponents();
    bottom.addComponent(splash);
}

19 View Complete Implementation : MainReportResizableSplitPanel.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@Override
public void setSecondComponent(AbstractComponent splash) {
    super.setSecondComponent(splash);
}

19 View Complete Implementation : MainReportResizableSplitPanel.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@Override
public void setFirstComponent(AbstractComponent optionsPanel) {
    super.setFirstComponent(optionsPanel);
}

19 View Complete Implementation : MainReportSplitPanel.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@Override
public void setSecondComponent(AbstractComponent splash) {
    panelb.removeAllComponents();
    panelb.addComponent(splash);
}

19 View Complete Implementation : MainReportSplitPanel.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@Override
public void setFirstComponent(AbstractComponent optionsPanel) {
    panela.removeAllComponents();
    panela.addComponent(optionsPanel);
}

19 View Complete Implementation : MBeanFieldGroup.java
Copyright Apache License 2.0
Author : viritin
/**
 * Sets the "validation error target", the component on which validation
 * errors are shown, for given validator type.
 *
 * @param validatorType the clreplaced of the validator whose errors should be
 *                      targeted
 * @param component     the component on which the errors should be displayed on
 * @return the MBeanFieldGroup instance
 */
public MBeanFieldGroup<T> setValidationErrorTarget(Clreplaced validatorType, AbstractComponent component) {
    validatorToErrorTarget.put(validatorType, component);
    return this;
}

19 View Complete Implementation : MBeanFieldGroup.java
Copyright Apache License 2.0
Author : viritin
private void clearMValidationErrors() {
    for (AbstractComponent value : mValidationErrors.values()) {
        if (value != null) {
            value.setComponentError(null);
        }
    }
    mValidationErrors.clear();
    for (AbstractComponent ac : validatorToErrorTarget.values()) {
        ac.setComponentError(null);
    }
}

18 View Complete Implementation : CmsMaxHeightExtension.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Allows the use of max height in combination with vaadin layout components.<p>
 */
public clreplaced CmsMaxHeightExtension extends AbstractExtension implements I_CmsMaxHeightServerRpc {

    /**
     * Callback interfaces for height change notifications.<p>
     */
    public interface I_HeightChangeHandler {

        /**
         * Called when the fixHeight RPC call is received.<p>
         *
         * @param height the height from the RPC call
         */
        void onChangeHeight(int height);
    }

    /**
     * The serial version id.
     */
    private static final long serialVersionUID = 3978957151754705873L;

    /**
     * The extended component.
     */
    private AbstractComponent m_component;

    /**
     * The list of height change handlers.
     */
    private List<I_HeightChangeHandler> m_heightChangeHandlers = Lists.newArrayList();

    /**
     * Constructor.<p>
     *
     * @param component the component to extend
     * @param maxHeight the max height
     */
    public CmsMaxHeightExtension(AbstractComponent component, int maxHeight) {
        m_component = component;
        extend(component);
        registerRpc(this);
        getState().setMaxHeight(maxHeight);
    }

    /**
     * Adds an action to execute when the height is changed.<p>
     *
     * @param action the action
     */
    public void addHeightChangeHandler(I_HeightChangeHandler action) {
        m_heightChangeHandlers.add(action);
    }

    /**
     * @see org.opencms.ui.shared.rpc.I_CmsMaxHeightServerRpc#fixHeight(int)
     */
    public void fixHeight(int height) {
        if (height < 1) {
            m_component.setHeightUndefined();
        } else {
            m_component.setHeight(height, Unit.PIXELS);
        }
        for (I_HeightChangeHandler handler : m_heightChangeHandlers) {
            handler.onChangeHeight(height);
        }
    }

    /**
     * Removes a height change handler.<p>
     *
     * @param action the handler to remove
     */
    public void removeHeightChangeHandler(Runnable action) {
        m_heightChangeHandlers.remove(action);
    }

    /**
     * Updates the maximum height.<p>
     *
     * @param maxHeight the new value for the maximum height
     */
    public void updateMaxHeight(int maxHeight) {
        getState().setMaxHeight(maxHeight);
    }

    /**
     * @see com.vaadin.server.AbstractClientConnector#getState()
     */
    @Override
    protected CmsMaxHeightState getState() {
        return (CmsMaxHeightState) super.getState();
    }
}

18 View Complete Implementation : VaadinGridFormLayout.java
Copyright Apache License 2.0
Author : BrunoEberhard
@Override
public void setValidationMessages(IComponent component, List<String> validationMessages) {
    AbstractComponent vaadinComponent = (AbstractComponent) component;
    VaadinIndication.setValidationMessages(validationMessages, vaadinComponent);
}

18 View Complete Implementation : WebAbstractComponent.java
Copyright Apache License 2.0
Author : cuba-platform
protected void setValidationError(String errorMessage) {
    if (getComposition() instanceof AbstractComponent) {
        AbstractComponent composition = (AbstractComponent) getComposition();
        if (errorMessage == null) {
            composition.setComponentError(null);
        } else {
            composition.setComponentError(new UserError(errorMessage));
        }
    }
}

18 View Complete Implementation : WebDateField.java
Copyright Apache License 2.0
Author : cuba-platform
protected void setupComponentErrorProvider(boolean required, AbstractComponent component) {
    if (required) {
        component.setComponentErrorProvider(this::getErrorMessage);
    } else {
        component.setComponentErrorProvider(null);
    }
}

18 View Complete Implementation : WebV8AbstractField.java
Copyright Apache License 2.0
Author : cuba-platform
protected void setupComponentErrorProvider(boolean required, T component) {
    AbstractComponent abstractComponent = (AbstractComponent) component;
    if (required) {
        abstractComponent.setComponentErrorProvider(this::getErrorMessage);
    } else {
        abstractComponent.setComponentErrorProvider(null);
    }
}

18 View Complete Implementation : AbstractForm.java
Copyright Apache License 2.0
Author : viritin
public void setValidationErrorTarget(Clreplaced<?> aClreplaced, AbstractComponent errorTarget) {
    validatorToErrorTarget.put(aClreplaced, errorTarget);
    if (getFieldGroup() != null) {
        getFieldGroup().setValidationErrorTarget(aClreplaced, errorTarget);
    }
}

18 View Complete Implementation : MBeanFieldGroup.java
Copyright Apache License 2.0
Author : viritin
/**
 * EXPERIMENTAL: The cross field validation support is still experimental
 * and its API is likely to change.
 *
 * @param validator a validator that validates the whole bean making cross
 *                  field validation much simpler
 * @param fields    the ui fields that this validator affects and on which a
 *                  possible error message is shown.
 * @return this FieldGroup
 */
public MBeanFieldGroup<T> addValidator(MValidator<T> validator, AbstractComponent... fields) {
    mValidators.put(validator, Arrays.asList(fields));
    return this;
}

17 View Complete Implementation : A_CmsAttributeAwareApp.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Gets the attributes from a given component.<p>
 *
 * @param component to read attributes from
 * @return map of attributes
 */
protected Map<String, Object> getAttributesForComponent(Component component) {
    Map<String, Object> result = Maps.newHashMap();
    if (component instanceof AbstractComponent) {
        AbstractComponent abstractComp = (AbstractComponent) component;
        if (abstractComp.getData() instanceof Map) {
            Map<?, ?> map = (Map<?, ?>) abstractComp.getData();
            for (Map.Entry<?, ?> entry : map.entrySet()) {
                if (entry.getKey() instanceof String) {
                    result.put((String) (entry.getKey()), entry.getValue());
                }
            }
        }
    }
    return result;
}

17 View Complete Implementation : CmsAppWorkplaceUi.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Initializes client polling to avoid session expiration.<p>
 *
 * @param component the view component
 */
@SuppressWarnings("unused")
private void initializeClientPolling(Component component) {
    if (component instanceof AbstractComponent) {
        AbstractComponent acomp = (AbstractComponent) component;
        for (Extension extension : acomp.getExtensions()) {
            if (extension instanceof CmsPollServerExtension) {
                return;
            }
        }
        new CmsPollServerExtension((AbstractComponent) component);
    }
}

17 View Complete Implementation : Vaadin.java
Copyright Apache License 2.0
Author : BrunoEberhard
private void show(Page page, Boolean replaceState) {
    String pageId = pageStore.put(page);
    components.clear();
    AbstractComponent component = (AbstractComponent) PageAccess.getContent(page);
    if (component != null) {
        component.setData(page);
        components.add(component);
    }
    String route = Routing.getRouteSafe(page);
    if (route == null) {
        route = "/";
    }
    route = route + "#" + pageId;
    if (replaceState != null && replaceState) {
        com.vaadin.server.Page.getCurrent().replaceState(route);
    } else if (replaceState != null && !replaceState) {
        com.vaadin.server.Page.getCurrent().pushState(route);
    }
    com.vaadin.server.Page.getCurrent().setreplacedle(page.getreplacedle());
    updateContent();
}

17 View Complete Implementation : AttributesLocationCompanion.java
Copyright Apache License 2.0
Author : cuba-platform
protected void removeFromSourceGrid(Grid currentSourceGrid, boolean isAttributesSourceGrid, AbstractComponent dropComponent, int dropIndex) {
    if (!droppedSuccessful || draggedItem == null) {
        return;
    }
    // noinspection unchecked
    List<CategoryAttribute> items = (List<CategoryAttribute>) ((ListDataProvider) currentSourceGrid.getDataProvider()).gereplacedems();
    if (currentSourceGrid.equals(dropComponent) && dropIndex >= 0) {
        int removeIndex = items.indexOf(draggedItem) == dropIndex ? items.lastIndexOf(draggedItem) : items.indexOf(draggedItem);
        if (removeIndex >= 0 && removeIndex != dropIndex) {
            items.remove(removeIndex);
        }
    } else {
        items.remove(draggedItem);
    }
    if (isAttributesSourceGrid && AttributesLocationFrame.EMPTY_ATTRIBUTE_NAME.equals(draggedItem.getName())) {
        attributesSourceDataContainer.add(createEmptyAttribute());
    }
    currentSourceGrid.getDataProvider().refreshAll();
}

17 View Complete Implementation : ElementIntegration.java
Copyright Apache License 2.0
Author : vaadin
public static Root getRoot(AbstractComponent target) {
    Optional<Extension> existing = target.getExtensions().stream().filter(e -> e.getClreplaced() == ElementIntegration.clreplaced).findFirst();
    ElementIntegration integration = existing.isPresent() ? (ElementIntegration) existing.get() : new ElementIntegration(target);
    return integration.root;
}

17 View Complete Implementation : AbstractForm.java
Copyright Apache License 2.0
Author : viritin
/**
 * EXPERIMENTAL: The cross field validation support is still experimental
 * and its API is likely to change.
 *
 * @param validator a validator that validates the whole bean making cross
 * field validation much simpler
 * @param fields the ui fields that this validator affects and on which a
 * possible error message is shown.
 * @return this FieldGroup
 */
public AbstractForm<T> addValidator(MBeanFieldGroup.MValidator<T> validator, AbstractComponent... fields) {
    mValidators.put(validator, Arrays.asList(fields));
    if (getFieldGroup() != null) {
        getFieldGroup().addValidator(validator, fields);
    }
    return this;
}

16 View Complete Implementation : Vaadin.java
Copyright Apache License 2.0
Author : BrunoEberhard
@Override
public void showDetail(Page mainPage, Page detail) {
    int pos = indexOfDetail(mainPage);
    for (int j = components.size() - 1; j > pos; j--) {
        components.remove(j);
    }
    pageStore.put(detail);
    AbstractComponent component = (AbstractComponent) PageAccess.getContent(detail);
    component.setData(detail);
    components.add(component);
    updateContent();
}

16 View Complete Implementation : MBeanFieldGroup.java
Copyright Apache License 2.0
Author : viritin
private boolean isValidLegacy() {
    // clear all MValidation errors
    clearMValidationErrors();
    jsr303beanLevelViolations = null;
    beanLevelViolations = null;
    // first check standard property level validators
    final boolean propertiesValid = super.isValid();
    // then crossfield(/bean level) validators, execute them all although
    // with per field validation Vaadin checks only until the first failed one
    if (propertiesValid) {
        boolean ok = true;
        for (MValidator<T> v : mValidators.keySet()) {
            try {
                v.validate(gereplacedemDataSource().getBean());
            } catch (Validator.InvalidValueException e) {
                Collection<AbstractComponent> properties = mValidators.get(v);
                if (!properties.isEmpty()) {
                    for (AbstractComponent field : properties) {
                        final ErrorMessage em = AbstractErrorMessage.getErrorMessageForException(e);
                        mValidationErrors.put(em, field);
                        field.setComponentError(em);
                    }
                } else {
                    final ErrorMessage em = AbstractErrorMessage.getErrorMessageForException(e);
                    AbstractComponent target = validatorToErrorTarget.get(v.getClreplaced());
                    if (target != null) {
                        target.setComponentError(em);
                    } else {
                        // no specific "target component" for validation error
                        // leave as bean level error
                        if (beanLevelViolations == null) {
                            beanLevelViolations = new HashSet<>();
                        }
                        beanLevelViolations.add(e);
                        mValidationErrors.put(em, null);
                    }
                }
                ok = false;
            }
        }
        return jsr303ValidateBean(gereplacedemDataSource().getBean()) && ok;
    }
    return false;
}

15 View Complete Implementation : PluginsPanelAddDialog.java
Copyright GNU General Public License v3.0
Author : JumpMind
protected HorizontalLayout buildButtonFooter(AbstractComponent... toTheRightButtons) {
    HorizontalLayout footer = new HorizontalLayout();
    footer.setWidth("100%");
    footer.setSpacing(true);
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    Label footerText = new Label("");
    footerText.setSizeUndefined();
    footer.addComponents(footerText);
    footer.setExpandRatio(footerText, 1);
    if (toTheRightButtons != null) {
        footer.addComponents(toTheRightButtons);
    }
    return footer;
}

15 View Complete Implementation : ResultViewPanel.java
Copyright Apache License 2.0
Author : korpling
private void addQueryResult(PagedResultQuery q, List<SaltProject> subgraphList) {
    if (q == null) {
        return;
    }
    List<AbstractComponent> newPanels = new LinkedList<>();
    try {
        if (subgraphList == null || subgraphList.isEmpty()) {
            Notification.show("Could not get subgraphs", Notification.Type.TRAY_NOTIFICATION);
        } else {
            for (SaltProject p : subgraphList) {
                updateVariables(p);
                newPanels = createPanels(p, currentResults, q.getOffset() + currentResults);
                currentResults += newPanels.size();
                String strResults = numberOfResults > 1 ? "results" : "result";
                sui.getSearchView().getControlPanel().getQueryPanel().setStatus(sui.getSearchView().getControlPanel().getQueryPanel().getLastPublicStatus(), " (showing " + currentResults + "/" + numberOfResults + " " + strResults + ")");
                if (currentResults == numberOfResults) {
                    resetQueryResultQueue();
                }
                for (AbstractComponent panel : newPanels) {
                    resultPanelList.add(panel);
                    resultLayout.addComponent(panel);
                    if (panel instanceof SingleResultPanel) {
                        ((SingleResultPanel) panel).setSegmentationLayer(sui.getQueryState().getVisibleBaseText().getValue());
                    }
                }
            }
            if (currentResults == numberOfResults) {
                showFinishedSubgraphSearch();
                if (!initialQuery.getSelectedMatches().isEmpty()) {
                    // scroll to the first selected match
                    JavaScript.eval("$(\".v-panel-content-result-view-panel\").animate({scrollTop: $(\".selected-match\").offset().top - $(\".result-view-panel\").offset().top}, 1000);");
                }
            }
            if (projectQueue != null && !newPanels.isEmpty() && currentResults < numberOfResults) {
                log.debug("adding callback for result " + currentResults);
                // add a callback so we can load the next single result
                OnLoadCallbackExtension ext = new OnLoadCallbackExtension(this, 250);
                ext.extend(newPanels.get(newPanels.size() - 1));
            }
        }
    } catch (Throwable ex) {
        log.error(null, ex);
    }
}

14 View Complete Implementation : SpringSecurityErrorHandler.java
Copyright Apache License 2.0
Author : markoradinovic
public static void doDefault(ErrorEvent event) {
    Throwable t = event.getThrowable();
    if (t instanceof SocketException) {
        // Most likely client browser closed socket
        getLogger().info("SocketException in CommunicationManager." + " Most likely client (browser) closed socket.");
        return;
    }
    t = findRelevantThrowable(t);
    /*
         * Handle SpringSecurity 
         */
    if (t instanceof AccessDeniedException) {
        EventBus eventBus = SpringApplicationContext.getEventBus();
        eventBus.publish(EventScope.UI, eventBus, new AccessDeniedEvent(t));
        getLogger().log(Level.FINE, "Access is denied", t);
        return;
    }
    // Finds the original source of the error/exception
    AbstractComponent component = findAbstractComponent(event);
    if (component != null) {
        // Shows the error in AbstractComponent
        ErrorMessage errorMessage = AbstractErrorMessage.getErrorMessageForException(t);
        component.setComponentError(errorMessage);
    }
    // also print the error on console
    getLogger().log(Level.SEVERE, "", t);
}

14 View Complete Implementation : MBeanFieldGroup.java
Copyright Apache License 2.0
Author : viritin
private boolean isValidAllProperties() {
    // clear all MValidation errors
    clearMValidationErrors();
    jsr303beanLevelViolations = null;
    beanLevelViolations = null;
    // first check standard property level validators, but unlike in Vaadin
    // core, check them all, don't stop for first error
    boolean propertiesValid = true;
    try {
        for (Field<?> field : getFields()) {
            field.validate();
        }
    } catch (Validator.InvalidValueException e) {
        propertiesValid = false;
    }
    // then crossfield(/bean level) validators, execute them all although
    // with per field validation Vaadin checks only until the first failed one
    boolean ok = true;
    for (MValidator<T> v : mValidators.keySet()) {
        try {
            v.validate(gereplacedemDataSource().getBean());
        } catch (Validator.InvalidValueException e) {
            Collection<AbstractComponent> properties = mValidators.get(v);
            if (!properties.isEmpty()) {
                for (AbstractComponent field : properties) {
                    final ErrorMessage em = AbstractErrorMessage.getErrorMessageForException(e);
                    mValidationErrors.put(em, field);
                    field.setComponentError(em);
                }
            } else {
                final ErrorMessage em = AbstractErrorMessage.getErrorMessageForException(e);
                AbstractComponent target = validatorToErrorTarget.get(v.getClreplaced());
                if (target != null) {
                    target.setComponentError(em);
                } else {
                    // no specific "target component" for validation error
                    // leave as bean level error
                    if (beanLevelViolations == null) {
                        beanLevelViolations = new HashSet<>();
                    }
                    beanLevelViolations.add(e);
                    mValidationErrors.put(em, null);
                }
            }
            ok = false;
        }
    }
    return jsr303ValidateBean(gereplacedemDataSource().getBean()) && ok && propertiesValid;
}

14 View Complete Implementation : MBeanFieldGroup.java
Copyright Apache License 2.0
Author : viritin
protected boolean jsr303ValidateBean(T bean) {
    try {
        if (javaxBeanValidator == null) {
            javaxBeanValidator = getJavaxBeanValidatorFactory().getValidator();
        }
    } catch (Throwable t) {
        // This may happen without JSR303 validation framework
        Logger.getLogger(getClreplaced().getName()).fine("JSR303 validation failed");
        return true;
    }
    boolean containsAtLeastOneBoundComponentWithError = false;
    Set<ConstraintViolation<T>> constraintViolations = new HashSet<>(javaxBeanValidator.validate(bean, getValidationGroups()));
    if (constraintViolations.isEmpty()) {
        return true;
    }
    Iterator<ConstraintViolation<T>> iterator = constraintViolations.iterator();
    while (iterator.hasNext()) {
        ConstraintViolation<T> constraintViolation = iterator.next();
        Clreplaced<? extends Annotation> annotationType = constraintViolation.getConstraintDescriptor().getAnnotation().annotationType();
        AbstractComponent errortarget = validatorToErrorTarget.get(annotationType);
        if (errortarget != null) {
            // user has declared a target component for this constraint
            errortarget.setComponentError(new UserError(constraintViolation.getMessage()));
            iterator.remove();
            containsAtLeastOneBoundComponentWithError = true;
        }
    // else leave as "bean level error"
    }
    this.jsr303beanLevelViolations = constraintViolations;
    if (!containsAtLeastOneBoundComponentWithError && isValidateOnlyBoundFields()) {
        return true;
    }
    return false;
}

12 View Complete Implementation : Vaadin.java
Copyright Apache License 2.0
Author : BrunoEberhard
private void updateContent() {
    if (components.size() == 1) {
        AbstractComponent content = components.get(0);
        Page page = (Page) content.getData();
        if (content instanceof VaadinGridFormLayout) {
            content = new Panel(content);
        }
        content.setSizeFull();
        createMenu((AbstractComponent) content, PageAccess.getActions(page));
        VaadinDecoration decoratedContent = new VaadinDecoration(page.getreplacedle(), content, SwingDecoration.SHOW_MINIMIZE, event -> hideDetail(page));
        decoratedContent.setSizeFull();
        splitPanel.setSecondComponent(decoratedContent);
    } else if (components.size() > 1) {
        VerticalLayout verticalLayout = new VerticalLayout();
        verticalLayout.setMargin(false);
        verticalLayout.setSpacing(false);
        verticalLayout.setWidth("100%");
        for (AbstractComponent content : components) {
            Page page = (Page) content.getData();
            createMenu((AbstractComponent) content, PageAccess.getActions(page));
            VaadinDecoration decoratedContent = new VaadinDecoration(page.getreplacedle(), content, SwingDecoration.SHOW_MINIMIZE, event -> hideDetail(page));
            verticalLayout.addComponent(decoratedContent);
        }
        splitPanel.setSecondComponent(verticalLayout);
        UI.getCurrent().scrollIntoView(components.get(components.size() - 1));
    } else {
        splitPanel.setSecondComponent(null);
    }
}

12 View Complete Implementation : MenuBuilder.java
Copyright Apache License 2.0
Author : cuba-platform
protected void replacedignShortcut(Window webWindow, AppMenu.MenuItem menuItem, MenuItem item) {
    KeyCombination itemShortcut = item.getShortcut();
    if (itemShortcut != null) {
        ShortcutListener shortcut = new MenuShortcutAction(menuItem, "shortcut_" + item.getId(), item.getShortcut());
        AbstractComponent windowImpl = webWindow.unwrap(AbstractComponent.clreplaced);
        windowImpl.addShortcutListener(shortcut);
        appMenu.setMenuItemShortcutCaption(menuItem, itemShortcut.format());
    }
}

12 View Complete Implementation : SideMenuBuilder.java
Copyright Apache License 2.0
Author : cuba-platform
protected void replacedignShortcut(Window webWindow, SideMenu.MenuItem menuItem, MenuItem item) {
    KeyCombination itemShortcut = item.getShortcut();
    if (itemShortcut != null) {
        ShortcutListener shortcut = new SideMenuShortcutListener(menuItem, item);
        AbstractComponent windowImpl = webWindow.unwrap(AbstractComponent.clreplaced);
        windowImpl.addShortcutListener(shortcut);
        if (Strings.isNullOrEmpty(menuItem.getBadgeText())) {
            menuItem.setDescription(itemShortcut.format());
        }
    }
}

12 View Complete Implementation : ResultViewPanel.java
Copyright Apache License 2.0
Author : korpling
private List<AbstractComponent> createPanels(SaltProject p, int localMatchIndex, long globalOffset) {
    List<AbstractComponent> resultPanels = new LinkedList<>();
    int i = 0;
    for (SCorpusGraph corpusGraph : p.getCorpusGraphs()) {
        Match m = new Match();
        if (allMatches != null && localMatchIndex >= 0 && localMatchIndex < allMatches.size()) {
            m = allMatches.get(localMatchIndex);
        }
        AbstractComponent panel;
        if (corpusGraph.getDoreplacedents().isEmpty()) {
            Set<SCorpus> matchedCorpora = new LinkedHashSet<>();
            for (URI id : m.getSaltIDs()) {
                SNode n = corpusGraph.getNode(id.toASCIIString());
                if (n instanceof SCorpus) {
                    matchedCorpora.add((SCorpus) n);
                }
            }
            panel = new SingleCorpusResultPanel(matchedCorpora, m, i + globalOffset, ps, sui, initialQuery);
        } else {
            SDoreplacedent doc = corpusGraph.getDoreplacedents().get(0);
            panel = new SingleResultPanel(doc, m, i + globalOffset, new ResolverProviderImpl(cacheResolver), ps, sui, getVisibleTokenAnnos(), segmentationName, controller, instanceConfig, initialQuery);
        }
        i++;
        panel.setWidth("100%");
        panel.setHeight("-1px");
        resultPanels.add(panel);
    }
    return resultPanels;
}

10 View Complete Implementation : AppLog.java
Copyright Apache License 2.0
Author : cuba-platform
public void log(ErrorEvent event) {
    Throwable t = event.getThrowable();
    if (t instanceof SilentException)
        return;
    if (t instanceof Validator.InvalidValueException)
        return;
    if (t instanceof SocketException || ExceptionUtils.getRootCause(t) instanceof SocketException) {
        // Most likely client browser closed socket
        LogItem item = new LogItem(timeSource.currentTimestamp(), LogLevel.WARNING, "SocketException in CommunicationManager. Most likely client (browser) closed socket.", null);
        log(item);
        return;
    }
    // Support Tomcat 8 ClientAbortException
    if (StringUtils.contains(ExceptionUtils.getMessage(t), "ClientAbortException")) {
        // Most likely client browser closed socket
        LogItem item = new LogItem(timeSource.currentTimestamp(), LogLevel.WARNING, "ClientAbortException on write response to client. Most likely client (browser) closed socket.", null);
        log(item);
        return;
    }
    // if it is UberJar or deployed to Jetty
    if (ExceptionUtils.getThrowableList(t).stream().anyMatch(o -> o.getClreplaced().getName().equals("org.eclipse.jetty.io.EofException"))) {
        // Most likely client browser closed socket
        LogItem item = new LogItem(timeSource.currentTimestamp(), LogLevel.WARNING, "org.eclipse.jetty.io.EofException on write response to client. Most likely client (browser) closed socket.", null);
        log(item);
        return;
    }
    Throwable rootCause = ExceptionUtils.getRootCause(t);
    if (rootCause == null) {
        rootCause = t;
    }
    Logging annotation = rootCause.getClreplaced().getAnnotation(Logging.clreplaced);
    Logging.Type loggingType = annotation == null ? Logging.Type.FULL : annotation.value();
    if (loggingType == Logging.Type.NONE) {
        return;
    }
    // Finds the original source of the error/exception
    AbstractComponent component = DefaultErrorHandler.findAbstractComponent(event);
    StringBuilder msg = new StringBuilder();
    msg.append("Exception");
    if (component != null) {
        msg.append(" in ").append(component.getClreplaced().getName());
    }
    msg.append(": ");
    if (loggingType == Logging.Type.BRIEF) {
        error(msg + rootCause.toString());
    } else {
        LogItem item = new LogItem(timeSource.currentTimestamp(), LogLevel.ERROR, msg.toString(), t);
        log(item);
    }
}