• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ComponentConnector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: setFor

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
void setFor(ComponentConnector forId) {
    Widget widget = forId.getWidget();

    // VNativeSelect need binding of Caption on the ListBox to get :focus
    if (widget instanceof VNativeSelect) {
        AriaHelper.bindCaption(((VNativeSelect) widget).getListBox(), label);
        return;
    }

    AriaHelper.bindCaption(widget, label);
}
 
开发者ID:knoobie,项目名称:bootstrap-formgroup,代码行数:12,代码来源:ClientSideFormGroup.java


示例17: onConnectorHierarchyChange

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
    ClientSideFormGroup customComponent = getWidget();
    if (getChildComponents().size() == 1) {
        ComponentConnector connector = getChildComponents().get(0);
        customComponent.setWidget(connector.getWidget(), connector.delegateCaptionHandling());
    } else {
        customComponent.setWidget(null, false);
    }
}
 
开发者ID:knoobie,项目名称:bootstrap-formgroup,代码行数:11,代码来源:FormGroupConnector.java


示例18: extend

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
protected void extend(ServerConnector target)
{
	// Get the extended widget
	final Widget widget = ((ComponentConnector)target).getWidget();
	widget.getElement().appendChild(overlayElement);
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:8,代码来源:TextOverlayConnector.java


示例19: updateCaption

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

    if (getState().useInlineCaption && initialStateChangePerformed) {
        updateCaptionSizes();

        // always relayout after caption changes
        getLayoutManager().setNeedsLayout(this);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:12,代码来源:CubaFieldGroupLayoutConnector.java


示例20: onBrowserEvent

import com.vaadin.client.ComponentConnector; //导入依赖的package包/类
@Override
public void onBrowserEvent(Event event) {
    if (DOM.eventGetType(event) == Event.ONCLICK) {
        Element target = Element.as(event.getEventTarget());
        ComponentConnector componentConnector = Util.findConnectorFor(getWidget());
        if (target == contextHelpIndicatorElement
                && componentConnector instanceof HasContextHelpConnector) {
            HasContextHelpConnector connector = (HasContextHelpConnector) componentConnector;
            if (hasContextHelpIconListeners(componentConnector.getState())) {
                connector.contextHelpIconClick(event);
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:15,代码来源:CubaFieldGroupLayoutComponentSlot.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Value类代码示例发布时间:2022-05-21
下一篇:
Java CDATA类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap