Package com.vaadin.client

Examples of com.vaadin.client.ComponentConnector


        if (dragStartMode == WRAPPER || dragStartMode == COMPONENT
                || dragStartMode == COMPONENT_OTHER) {
            VTransferable transferable = new VTransferable();
            transferable.setDragSource(getConnector());

            ComponentConnector paintable = Util.findPaintable(client,
                    Element.as(event.getEventTarget()));
            Widget widget = paintable.getWidget();
            transferable.setData("component", paintable);
            VDragEvent dragEvent = VDragAndDropManager.get().startDrag(
                    transferable, event, true);

            transferable.setData("mouseDown", MouseEventDetailsBuilder
View Full Code Here


            Profiler.leave("LayoutDependency.markSizeAsChanged phase 1");

            Profiler.enter("LayoutDependency.markSizeAsChanged scrollbars");
            // Should also go through the hierarchy to discover appeared or
            // disappeared scrollbars
            ComponentConnector scrollingBoundary = getScrollingBoundary(connector);
            if (scrollingBoundary != null) {
                getDependency(scrollingBoundary.getConnectorId(),
                        getOppositeDirection()).setNeedsMeasure(true);
            }
            Profiler.leave("LayoutDependency.markSizeAsChanged scrollbars");

        }
View Full Code Here

         * scrollbars to appear or disappear.
         *
         * @return
         */
        private LayoutDependency findPotentiallyChangedScrollbar() {
            ComponentConnector currentConnector = connector;
            while (true) {
                ServerConnector parent = currentConnector.getParent();
                if (!(parent instanceof ComponentConnector)) {
                    return null;
                }
                if (parent instanceof MayScrollChildren) {
                    return getDependency(currentConnector.getConnectorId(),
                            getOppositeDirection());
                }
                currentConnector = (ComponentConnector) parent;
            }
        }
View Full Code Here

    @Override
    public void layout() {
        LayoutManager lm = getLayoutManager();
        VWindow window = getWidget();
        ComponentConnector content = getContent();
        boolean hasContent = (content != null);
        Element contentElement = window.contentPanel.getElement();

        Style contentStyle = window.contents.getStyle();

        int headerHeight = lm.getOuterHeight(window.header);
        contentStyle.setPaddingTop(headerHeight, Unit.PX);
        contentStyle.setMarginTop(-headerHeight, Unit.PX);

        int footerHeight = lm.getOuterHeight(window.footer);
        contentStyle.setPaddingBottom(footerHeight, Unit.PX);
        contentStyle.setMarginBottom(-footerHeight, Unit.PX);

        int minWidth = lm.getOuterWidth(window.header)
                - lm.getInnerWidth(window.header);
        int minHeight = footerHeight + headerHeight;

        getWidget().getElement().getStyle().setPropertyPx("minWidth", minWidth);
        getWidget().getElement().getStyle()
                .setPropertyPx("minHeight", minHeight);

        /*
         * Must set absolute position if the child has relative height and
         * there's a chance of horizontal scrolling as some browsers will
         * otherwise not take the scrollbar into account when calculating the
         * height.
         */
        if (hasContent) {
            Element layoutElement = content.getWidget().getElement();
            Style childStyle = layoutElement.getStyle();

            // IE8 needs some hackery to measure its content correctly
            Util.forceIE8Redraw(layoutElement);

            if (content.isRelativeHeight() && !BrowserInfo.get().isIE9()) {
                childStyle.setPosition(Position.ABSOLUTE);

                Style wrapperStyle = contentElement.getStyle();
                if (window.getElement().getStyle().getWidth().length() == 0
                        && !content.isRelativeWidth()) {
                    /*
                     * Need to lock width to make undefined width work even with
                     * absolute positioning
                     */
                    int contentWidth = lm.getOuterWidth(layoutElement);
View Full Code Here

    @Override
    public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
        VCustomComponent customComponent = getWidget();
        if (getChildComponents().size() == 1) {
            ComponentConnector newChild = getChildComponents().get(0);
            customComponent.setWidget(newChild.getWidget());
        } else {
            customComponent.setWidget(null);
        }

    }
View Full Code Here

         * still a hierarchy change -> verify that the child from the state is
         * still our child before attaching the widget. See #10150.
         */

        Widget newFirstChildWidget = null;
        ComponentConnector firstChild = getFirstChild();
        if (firstChild != null && firstChild.getParent() == this) {
            newFirstChildWidget = firstChild.getWidget();
        }
        getWidget().setFirstWidget(newFirstChildWidget);

        Widget newSecondChildWidget = null;
        ComponentConnector secondChild = getSecondChild();
        if (secondChild != null && secondChild.getParent() == this) {
            newSecondChildWidget = secondChild.getWidget();
        }
        getWidget().setSecondWidget(newSecondChildWidget);
    }
View Full Code Here

                    .getIntAttribute(DragAndDropWrapperConstants.DRAG_START_MODE);

            String dragImageComponentConnectorId = uidl
                    .getStringAttribute(DragAndDropWrapperConstants.DRAG_START_COMPONENT_ATTRIBUTE);

            ComponentConnector connector = null;
            if (dragImageComponentConnectorId != null) {
                connector = (ComponentConnector) ConnectorMap.get(client)
                        .getConnector(dragImageComponentConnectorId);

                if (connector == null) {
                    getLogger().log(
                            Level.WARNING,
                            "DragAndDropWrapper drag image component"
                                    + " connector now found. Make sure the"
                                    + " component is attached.");
                } else {
                    getWidget().setDragAndDropWidget(connector.getWidget());
                }
            }
            getWidget().initDragStartMode();
            getWidget().html5DataFlavors = uidl
                    .getMapAttribute(DragAndDropWrapperConstants.HTML5_DATA_FLAVORS);
View Full Code Here

     */
    protected ApplicationConnection getApplicationConnection() {
        if (ac != null) {
            return ac;
        } else if (owner != null) {
            ComponentConnector c = Util.findConnectorFor(owner);
            if (c != null) {
                ac = c.getConnection();
            }
            return ac;
        } else {
            return null;
        }
View Full Code Here

        initSize();

        for (Entry<Connector, ChildComponentData> entry : getState().childData
                .entrySet()) {
            ComponentConnector child = (ComponentConnector) entry.getKey();

            Cell cell = getCell(child);

            ChildComponentData childComponentData = entry.getValue();
            cell.updateCell(childComponentData);
View Full Code Here

        getWidget().setRotate(
                getState().rotateTransition != RotateDirection.NONE,
                getState().rotateTransition == RotateDirection.HORIZONTAL);
        getWidget().setFadeOutListener(fancyRemover);

        ComponentConnector currentConnector = (ComponentConnector) getState().currentComponent;
        if (currentConnector != null
                && getWidget().hasWidget(currentConnector.getWidget())) {
            getWidget().setContent(currentConnector.getWidget());
        }

    }
View Full Code Here

TOP

Related Classes of com.vaadin.client.ComponentConnector

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.