Package com.vaadin.ui

Examples of com.vaadin.ui.AbstractComponent$ComponentErrorHandler


                    IndexedContainer container = new IndexedContainer();
                    container.addContainerProperty("caption", String.class, "");
                    Iterator<Component> componentIterator = l
                            .getComponentIterator();
                    while (componentIterator.hasNext()) {
                        AbstractComponent next = (AbstractComponent) componentIterator
                                .next();
                        Item item = container.addItem(next);

                        String caption = next.getClass().getSimpleName();

                        caption += "; cap: " + next.getCaption() + "; debugid"
                                + getId();

                        if (next instanceof Property) {
                            caption += " value:"
                                    + ((Property<?>) next).getValue();
View Full Code Here


    }

    private Component newTestComponent() {
        Class<?> componentClass = (Class<?>) ns2.getValue();
        AbstractComponent newInstance = null;
        try {
            newInstance = (AbstractComponent) componentClass.newInstance();
        } catch (InstantiationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if (componentClass == Label.class) {
            ((Label) newInstance).setValue("Test l " + (i++));
            ((Label) newInstance).setSizeUndefined();
        } else {
            newInstance.setCaption("Test l " + (i++));
        }
        return newInstance;
    }
View Full Code Here

    protected void getLayoutForLayoutSizing(final String compType) {

        l2.setSpacing(false);
        l2.setMargin(false);

        final AbstractComponent c1 = getTestTable();
        c1.setSizeFull();
        final AbstractComponent c2 = getTestTable();
        c2.setSizeFull();

        class SetSizeButton extends Button {
            SetSizeButton(final String size) {
                super();
                setCaption("Set size " + size);
                addClickListener(new ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        if (compType == "layout") {
                            l2.setHeight(size);
                            l2.setWidth(size);
                        } else if (compType == "component") {
                            c2.setHeight(size);
                            c2.setWidth(size);
                        } else {
                        }

                    }
                });
View Full Code Here

            e1.printStackTrace();
        }
        final Component[] components = new Component[CAPTIONS.length];

        for (int i = 0; i < components.length; i++) {
            AbstractComponent comp = null;
            try {
                comp = compType.newInstance();
            } catch (InstantiationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            components[i] = comp;
            comp.setCaption(CAPTIONS[i]);
            if (useIcon) {
                comp.setIcon(ICONS[i]);
            }
            if (ErrorMessage != null) {
                if (ErrorMessage.length() == 0) {
                    comp.setComponentError(new UserError(null));
                } else {
                    comp.setComponentError(new UserError(ErrorMessage));
                }
            }
            // if component is a tab sheet add two tabs for it
            if (comp instanceof TabSheet) {
                comp.setSizeUndefined();
                TabSheet tab = (TabSheet) comp;
                tab.addTab(new UndefWideLabel("TAB1"), "TAB1",
                        new ThemeResource(GLOBE_16_PNG));
                tab.addTab(new UndefWideLabel("TAB2"), "TAB2", null);
            }
View Full Code Here

        }

        t = findRelevantThrowable(t);

        // 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);
    }
View Full Code Here

        Window parent = getParent();
        if (parent != null) {
            parent.removeWindow(this);
        }

        AbstractComponent comp = (AbstractComponent) event.getComponent();
        m_callback.onDialogResult((String) comp.getData());
    }
View Full Code Here

        StringBuilder sb = new StringBuilder();
        sb.append("*** Debug details of a component:  *** \n");
        sb.append("Type: ");
        sb.append(highLightedPaintable2.getClass().getName());
        if (highLightedPaintable2 instanceof AbstractComponent) {
            AbstractComponent component = (AbstractComponent) highLightedPaintable2;
            sb.append("\nId:");
            sb.append(paintableIdMap.get(component));
            if (component.getCaption() != null) {
                sb.append("\nCaption:");
                sb.append(component.getCaption());
            }

            printHighlightedComponentHierarchy(sb, component);
        }
        getLogger().info(sb.toString());
View Full Code Here

        if (parent != null) {
            parent.removeWindow(this);
            parent.focus();
        }

        AbstractComponent comp = (AbstractComponent) event.getComponent();
        m_callback.onDialogResult((String) comp.getData());
    }
View Full Code Here

        StringBuilder sb = new StringBuilder();
        sb.append("*** Debug details of a component:  *** \n");
        sb.append("Type: ");
        sb.append(highLightedPaintable2.getClass().getName());
        if (highLightedPaintable2 instanceof AbstractComponent) {
            AbstractComponent component = (AbstractComponent) highLightedPaintable2;
            sb.append("\nId:");
            sb.append(paintableIdMap.get(component));
            if (component.getCaption() != null) {
                sb.append("\nCaption:");
                sb.append(component.getCaption());
            }

            printHighlightedComponentHierarchy(sb, component);
        }
        logger.info(sb.toString());
View Full Code Here

        StringBuilder sb = new StringBuilder();
        sb.append("*** Debug details of a component:  *** \n");
        sb.append("Type: ");
        sb.append(highLightedPaintable2.getClass().getName());
        if (highLightedPaintable2 instanceof AbstractComponent) {
            AbstractComponent component = (AbstractComponent) highLightedPaintable2;
            sb.append("\nId:");
            sb.append(paintableIdMap.get(component));
            if (component.getCaption() != null) {
                sb.append("\nCaption:");
                sb.append(component.getCaption());
            }

            printHighlightedComponentHierarchy(sb, component);
        }
        logger.info(sb.toString());
View Full Code Here

TOP

Related Classes of com.vaadin.ui.AbstractComponent$ComponentErrorHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.