当前位置: 首页>>代码示例>>Java>>正文


Java ComponentConnector类代码示例

本文整理汇总了Java中com.vaadin.client.ComponentConnector的典型用法代码示例。如果您正苦于以下问题:Java ComponentConnector类的具体用法?Java ComponentConnector怎么用?Java ComponentConnector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ComponentConnector类属于com.vaadin.client包,在下文中一共展示了ComponentConnector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extend

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
protected void extend(ServerConnector serverConnector) {
    serverConnector.addStateChangeHandler(new StateChangeEvent.StateChangeHandler() {
        @Override
        public void onStateChanged(StateChangeEvent stateChangeEvent) {
            Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                @Override
                public void execute() {
                    updateResetButtonVisibility();
                }
            });
        }
    });

    textField = (VTextField) ((ComponentConnector) serverConnector).getWidget();
    textField.addStyleName(CLASSNAME + "-textfield");

    resetButtonElement = DOM.createDiv();
    resetButtonElement.addClassName(CLASSNAME + "-resetbutton");

    textField.addAttachHandler(this);
    textField.addKeyUpHandler(this);
}
 
开发者ID:peholmst,项目名称:vaadin-mockapp,代码行数:24,代码来源:ResetButtonForTextFieldConnector.java

示例2: extend

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
protected void extend(ServerConnector target) {
    final VButton button = (VButton) ((ComponentConnector) target).getWidget();

    button.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (getState().copyTargetSelector != null) {
                boolean success = copyToClipboard(getState().copyTargetSelector.startsWith(".")
                        ? getState().copyTargetSelector
                        : "." + getState().copyTargetSelector);
                getRpcProxy(CubaCopyButtonExtensionServerRpc.class).copied(success);
            }
        }
    });
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:CubaCopyButtonExtensionConnector.java

示例3: render

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
public void render(RendererCellReference rendererCellReference, final ComponentConnector componentConnector,
                   final SimplePanel panel) {
    if (componentConnector != null) {

        // render chart widgets deferred so measurements are correct. Do not render
        // normal component widgets deferred as it causes some flicker when rerendering the grid
        if (componentConnector.getClass().getName().equals("com.vaadin.addon.charts.shared.ChartConnector")) {
            Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                @Override
                public void execute() {
                    panel.setWidget(componentConnector.getWidget());
                }
            });
        } else {
            panel.setWidget(componentConnector.getWidget());
        }
    } else {
        panel.clear();
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:22,代码来源:ComponentRenderer.java

示例4: extend

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
protected void extend(ServerConnector serverConnector) {
    serverConnector
            .addStateChangeHandler(new StateChangeEvent.StateChangeHandler() {
                @Override
                public void onStateChanged(StateChangeEvent stateChangeEvent) {
                    Scheduler.get().scheduleDeferred(
                            new Scheduler.ScheduledCommand() {
                                @Override
                                public void execute() {
                                    updateResetButtonVisibility();
                                }
                            });
                }
            });

    textField = (VTextField) ((ComponentConnector) serverConnector)
            .getWidget();
    textField.addStyleName(CLASSNAME + "-textfield");

    resetButtonElement = DOM.createDiv();
    resetButtonElement.addClassName(CLASSNAME + "-resetbutton");

    textField.addAttachHandler(this);
    textField.addKeyUpHandler(this);
}
 
开发者ID:jvalenciag,项目名称:VaadinSpringShiroMongoDB,代码行数:27,代码来源:ResetButtonForTextFieldConnector.java

示例5: extend

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
protected void extend(final ServerConnector target) {
    textFieldWidget = (VTextField) ((ComponentConnector) target).getWidget();
    textFieldWidget.setImmediate(true);
    textFieldWidget.textChangeEventMode = "EAGER";
    panel.setWidget(select);
    panel.setStyleName("suggestion-popup");
    panel.setOwner(textFieldWidget);

    textFieldWidget.addKeyUpHandler(new KeyUpHandler() {
        @Override
        public void onKeyUp(final KeyUpEvent event) {
            if (panel.isAttached()) {
                handlePanelEventDelegation(event);
            } else if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                rpc.executeQuery(textFieldWidget.getValue(), textFieldWidget.getCursorPos());
            } else {
                doAskForSuggestion();
            }
        }
    });
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:23,代码来源:AutoCompleteTextFieldConnector.java

示例6: render

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
public void render(RendererCellReference rendererCellReference, final ComponentConnector componentConnector,
                   final SimplePanel panel)
{
    if (componentConnector != null) {

        // render chart widgets deferred so measurements are correct. Do not render
        // normal component widgets deferred as it causes some flicker when rerendering the grid
        if (componentConnector.getClass().getName().equals("com.vaadin.addon.charts.shared.ChartConnector")) {
            Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                @Override
                public void execute() {
                    panel.setWidget(componentConnector.getWidget());
                }
            });
        } else {
            panel.setWidget(componentConnector.getWidget());
        }
    } else {
        panel.clear();
    }
}
 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:23,代码来源:ComponentRenderer.java

示例7: attachScrollingEvents

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
protected void attachScrollingEvents(ComponentConnector connector) {
    Widget widget = connector.getWidget();
    if(widget instanceof LazyScrollNotifier) {
        LazyScrollNotifier not = (LazyScrollNotifier) widget;
        scrollingElement = not.getLazyScrollingElement();
        not.addLazyScrollListener(this);
    } else if (widget instanceof VWindow) {
        final VWindow window = (VWindow)widget;
        scrollingElement = window.contentPanel.getElement();
        handlerRegistration = ((VWindow)widget).contentPanel.addScrollHandler(new ScrollHandler() {
            @Override
            public void onScroll(ScrollEvent event) {
                onLazyScroll(window.contentPanel.getElement());
            }
        });
    } else {
        LOGGER.severe("Failed to connect to scrolling events of " + connector.getClass().getName());
    }
}
 
开发者ID:alump,项目名称:LazyLayouts,代码行数:20,代码来源:LazyVerticalLayoutConnector.java

示例8: resolveScrollingParent

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
protected ComponentConnector resolveScrollingParent() {

        if(getState().scrollingParent != null) {
            return (ComponentConnector)getState().scrollingParent;
        }

        ServerConnector connector = getParent();
        if(connector == null) {
            LOGGER.severe("LazyVerticalLayout not in connector hierarchy.");
            return null;
        }

        while(connector != null) {
            if(connector instanceof MayScrollChildren) {
                return (ComponentConnector)connector;
            }
            connector = connector.getParent();
        }

        LOGGER.severe("Failed to resolve scrolling parent for LazyVerticalLayout");
        return null;
    }
 
开发者ID:alump,项目名称:LazyLayouts,代码行数:23,代码来源:LazyVerticalLayoutConnector.java

示例9: onConnectorHierarchyChange

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(
    ConnectorHierarchyChangeEvent connectorHierarchyChangeEvent) {
    Map<Long, Widget> infoWindowContents = new HashMap<>();
    List<ComponentConnector> children = getChildComponents();
    for (ComponentConnector connector : children) {
        for (String style : connector.getState().styles) {
            if (style.startsWith("content-for-infowindow-")) {
                String identifier = style
                    .replace("content-for-infowindow-", "");
                Long id = Long.parseLong(identifier);
                infoWindowContents.put(id, connector.getWidget());
                getWidget().setInfoWindowContents(infoWindowContents);
            }
        }
    }
}
 
开发者ID:tapioaali,项目名称:GoogleMapsVaadin7,代码行数:18,代码来源:GoogleMapConnector.java

示例10: extend

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
protected void extend(ServerConnector target) {
    target.addStateChangeHandler(new StateChangeEvent.StateChangeHandler() {
        private static final long serialVersionUID = -8439729365677484553L;

        @Override
        public void onStateChanged(StateChangeEvent stateChangeEvent) {
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    updateResetButtonVisibility();
                }
            });
        }
    });

    textField = (VTextField) ((ComponentConnector) target).getWidget();
    textField.addStyleName(CLASSNAME + "-textfield");

    resetButtonElement = DOM.createDiv();
    resetButtonElement.addClassName(CLASSNAME + "-resetbutton");

    textField.addAttachHandler(this);
    textField.addKeyUpHandler(this);
}
 
开发者ID:tapioaali,项目名称:ResetButtonForTextField,代码行数:26,代码来源:ResetButtonForTextFieldConnector.java

示例11: updateWidgets

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
private void updateWidgets() {
    if (getParent() == null) {
        // Component is removed, skip stuff to save user from JS exceptions
        // and some milliseconds of lost life
        return;
    }

    Widget current = ((ComponentConnector) getState().getCurrentComponent())
            .getWidget();
    getWidget().setCurrentWidget(current);

    Widget previous = null;
    if (getState().getPreviousComponent() != null) {
        previous = ((ComponentConnector) getState().getPreviousComponent())
                .getWidget();
    }
    Widget next = null;
    if (getState().getNextComponent() != null) {
        next = ((ComponentConnector) getState().getNextComponent())
                .getWidget();
    }
    getWidget().setPreviousWidget(previous);
    getWidget().setNextWidget(next);
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:25,代码来源:NavigationManagerConnector.java

示例12: onStateChanged

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
    super.onStateChanged(stateChangeEvent);

    getWidget().setCaption(getState().caption);

    if (getState().getLeftComponent() != null) {
        Widget leftWidget = ((ComponentConnector) getState()
                .getLeftComponent()).getWidget();
        getWidget().setLeftWidget(leftWidget);
    }
    if (getState().getRightComponent() != null) {
        Widget rightWidget = ((ComponentConnector) getState()
                .getRightComponent()).getWidget();
        getWidget().setRightWidget(rightWidget);
    }
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:18,代码来源:NavigationBarConnector.java

示例13: onConnectorHierarchyChange

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(
        ConnectorHierarchyChangeEvent event) {
    if (getParent() == null) {
        // Component is removed, skip stuff to save user from JS exceptions
        // and some milliseconds of lost life
        return;
    }

    List<ComponentConnector> oldChildren = event.getOldChildren();

    List<ComponentConnector> children = getChildComponents();
    for (int i = 0; i < children.size(); ++i) {
        ComponentConnector connector = children.get(i);
        Widget widget = connector.getWidget();
        getWidget().addOrMove(widget, i);
        oldChildren.remove(connector);
    }

    for (ComponentConnector oldChild : event.getOldChildren()) {
        if (oldChild.getParent() != this) {
            getWidget().remove(oldChild.getWidget());
        }
    }
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:26,代码来源:VerticalComponentGroupConnector.java

示例14: updateCaption

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
public void updateCaption(ComponentConnector connector) {
    URLReference urlReference = connector.getState().resources
            .get(ComponentConstants.ICON_RESOURCE);
    Icon icon = null;
    if (urlReference != null) {
        icon = getConnection().getIcon(urlReference.getURL());
    }
    Widget child = connector.getWidget();
    String style = "v-caption";
    if (ComponentStateUtil.hasStyles(connector.getState())) {
        for (String customStyle : connector.getState().styles) {
            style += " " + "v-caption-" + customStyle;
        }
    }
    if (connector instanceof AbstractFieldConnector) {
        AbstractFieldConnector field = (AbstractFieldConnector) connector;
        if (field.isRequiredIndicatorVisible()) {
            style += " v-caption-required";
        }
    }
    getWidget().updateCaption(child, connector.getState().caption, icon,
            connector.getState().width, style);
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:25,代码来源:VerticalComponentGroupConnector.java

示例15: onConnectorHierarchyChange

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
    if (getParent() == null) {
        // Component is removed, skip stuff to save user from JS exceptions
        // and some milliseconds of lost life
        return;
    }

    List<ComponentConnector> children = getChildComponents();
    HorizontalButtonGroupWidget widget = (HorizontalButtonGroupWidget) getWidget();
    widget.clear();
    for (ComponentConnector connector : children) {
        // TODO #13688
        ((HorizontalButtonGroupWidget) getWidget()).add(connector
                .getWidget());
    }
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:18,代码来源:HorizontalButtonGroupConnector.java


注:本文中的com.vaadin.client.ComponentConnector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。