Package com.vaadin.terminal

Examples of com.vaadin.terminal.Paintable$RepaintRequestListener


        for (Iterator<?> it = value.keySet().iterator(); it.hasNext();) {
            Object key = it.next();
            Object mapValue = value.get(key);
            sb.append("\"");
            if (key instanceof Paintable) {
                Paintable paintable = (Paintable) key;
                sb.append(getPaintIdentifier(paintable));
            } else {
                sb.append(escapeJSON(key.toString()));
            }
            sb.append("\":");
View Full Code Here


                    }
                });

                for (final Iterator<Paintable> i = paintables.iterator(); i
                        .hasNext();) {
                    final Paintable p = i.next();

                    // TODO CLEAN
                    if (p instanceof Window) {
                        final Window w = (Window) p;
                        if (w.getTerminal() == null) {
                            w.setTerminal(application.getMainWindow()
                                    .getTerminal());
                        }
                    }
                    /*
                     * This does not seem to happen in tk5, but remember this
                     * case: else if (p instanceof Component) { if (((Component)
                     * p).getParent() == null || ((Component)
                     * p).getApplication() == null) { // Component requested
                     * repaint, but is no // longer attached: skip
                     * paintablePainted(p); continue; } }
                     */

                    // TODO we may still get changes that have been
                    // rendered already (changes with only cached flag)
                    if (paintTarget.needsToBePainted(p)) {
                        paintTarget.startTag("change");
                        paintTarget.addAttribute("format", "uidl");
                        final String pid = getPaintableId(p);
                        paintTarget.addAttribute("pid", pid);

                        p.paint(paintTarget);

                        paintTarget.endTag("change");
                    }
                    paintablePainted(p);

View Full Code Here

            if (id == null) {
                id = "PID" + Integer.toString(idSequence++);
            } else {
                id = "PID_S" + id;
            }
            Paintable old = idPaintableMap.put(id, paintable);
            if (old != null && old != paintable) {
                /*
                 * Two paintables have the same id. We still make sure the old
                 * one is a component which is still attached to the
                 * application. This is just a precaution and should not be
                 * absolutely necessary.
                 */

                if (old instanceof Component
                        && ((Component) old).getApplication() != null) {
                    throw new IllegalStateException("Two paintables ("
                            + paintable.getClass().getSimpleName() + ","
                            + old.getClass().getSimpleName()
                            + ") have been assigned the same id: "
                            + paintable.getDebugId());
                }
            }
            paintableIdMap.put(paintable, id);
View Full Code Here

        // list. The result is that each component should be painted exactly
        // once and any unmodified components will be painted as "cached=true".

        for (final Iterator<Paintable> i = dirtyPaintables.iterator(); i
                .hasNext();) {
            final Paintable p = i.next();
            if (p instanceof Component) {
                final Component component = (Component) p;
                if (component.getApplication() == null) {
                    // component is detached after requestRepaint is called
                    resultset.remove(p);
View Full Code Here

    /**
     * @see com.vaadin.terminal.Paintable.RepaintRequestListener#repaintRequested(com.vaadin.terminal.Paintable.RepaintRequestEvent)
     */
    public void repaintRequested(RepaintRequestEvent event) {
        final Paintable p = event.getPaintable();
        if (!dirtyPaintables.contains(p)) {
            dirtyPaintables.add(p);
        }
    }
View Full Code Here

        for (Iterator<?> it = value.keySet().iterator(); it.hasNext();) {
            Object key = it.next();
            Object mapValue = value.get(key);
            sb.append("\"");
            if (key instanceof Paintable) {
                Paintable paintable = (Paintable) key;
                sb.append(getPaintIdentifier(paintable));
            } else {
                sb.append(escapeJSON(key.toString()));
            }
            sb.append("\":");
View Full Code Here

                }
            });

            for (final Iterator<Paintable> i = paintables.iterator(); i
                    .hasNext();) {
                final Paintable p = i.next();

                // TODO CLEAN
                if (p instanceof Window) {
                    final Window w = (Window) p;
                    if (w.getTerminal() == null) {
                        w.setTerminal(application.getMainWindow().getTerminal());
                    }
                }
                /*
                 * This does not seem to happen in tk5, but remember this case:
                 * else if (p instanceof Component) { if (((Component)
                 * p).getParent() == null || ((Component) p).getApplication() ==
                 * null) { // Component requested repaint, but is no // longer
                 * attached: skip paintablePainted(p); continue; } }
                 */

                // TODO we may still get changes that have been
                // rendered already (changes with only cached flag)
                if (paintTarget.needsToBePainted(p)) {
                    paintTarget.startTag("change");
                    paintTarget.addAttribute("format", "uidl");
                    final String pid = getPaintableId(p);
                    paintTarget.addAttribute("pid", pid);

                    p.paint(paintTarget);

                    paintTarget.endTag("change");
                }
                paintablePainted(p);

View Full Code Here

                for (int seq = 0;; ++seq) {
                    // In case of a duplicate debug id, uniquify the PID by
                    // inserting a sequential integer. Try successive numbers
                    // until finding a PID that is either not used at all or
                    // used by a detached component. See #5109.
                    Paintable old = idPaintableMap.get(id);
                    if (old == null
                            || (old instanceof Component && ((Component) old)
                                    .getApplication() == null)) {
                        break;
                    }
View Full Code Here

        // list. The result is that each component should be painted exactly
        // once and any unmodified components will be painted as "cached=true".

        for (final Iterator<Paintable> i = dirtyPaintables.iterator(); i
                .hasNext();) {
            final Paintable p = i.next();
            if (p instanceof Component) {
                final Component component = (Component) p;
                if (component.getApplication() == null) {
                    // component is detached after requestRepaint is called
                    resultset.remove(p);
View Full Code Here

    /**
     * @see com.vaadin.terminal.Paintable.RepaintRequestListener#repaintRequested(com.vaadin.terminal.Paintable.RepaintRequestEvent)
     */
    public void repaintRequested(RepaintRequestEvent event) {
        final Paintable p = event.getPaintable();
        if (!dirtyPaintables.contains(p)) {
            dirtyPaintables.add(p);
        }
    }
View Full Code Here

TOP

Related Classes of com.vaadin.terminal.Paintable$RepaintRequestListener

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.