本文整理汇总了Java中com.vaadin.client.ConnectorHierarchyChangeEvent类的典型用法代码示例。如果您正苦于以下问题:Java ConnectorHierarchyChangeEvent类的具体用法?Java ConnectorHierarchyChangeEvent怎么用?Java ConnectorHierarchyChangeEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConnectorHierarchyChangeEvent类属于com.vaadin.client包,在下文中一共展示了ConnectorHierarchyChangeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的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);
}
}
}
}
示例2: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的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());
}
}
}
示例3: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的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());
}
}
示例4: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的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);
}
}
示例5: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
// construct component cells with known caption alignment
getWidget().useInlineCaption = getState().useInlineCaption;
super.onConnectorHierarchyChange(event);
if (getState().useInlineCaption && initialStateChangePerformed) {
updateCaptionSizes();
// always relayout after caption changes
getLayoutManager().setNeedsLayout(this);
}
}
示例6: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent connectorHierarchyChangeEvent) {
getWidget().clear();
List<ComponentConnector> childComponents = getChildComponents();
for (int i = 0; i < childComponents.size(); i++) {
ComponentConnector connector = childComponents.get(i);
DockLayoutState.Constraint constraint = getState().myConstraints.get(i);
Widget widget = GwtUIUtil.fillAndReturn(connector.getWidget());
GwtDockLayoutImpl dockLayout = getWidget();
switch (constraint) {
case TOP:
dockLayout.add(widget, GwtDockLayoutImpl.NORTH);
break;
case BOTTOM:
dockLayout.add(widget, GwtDockLayoutImpl.SOUTH);
break;
case LEFT:
dockLayout.add(widget, GwtDockLayoutImpl.WEST);
break;
case RIGHT:
dockLayout.add(widget, GwtDockLayoutImpl.EAST);
break;
case CENTER:
dockLayout.add(widget, GwtDockLayoutImpl.CENTER);
dockLayout.setCellHeight(widget, "100%");
dockLayout.setCellWidth(widget, "100%");
break;
}
}
}
示例7: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent connectorHierarchyChangeEvent) {
getWidget().removeAll();
List<Widget> widgets = GwtUIUtil.remapWidgets(this);
for (Widget widget : widgets) {
getWidget().addButton((GwtToolWindowStripeButton)widget);
}
}
示例8: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent connectorHierarchyChangeEvent) {
Map<TabbedLayoutState.TabState, Widget> map = new LinkedHashMap<>();
List<Widget> widgets = GwtUIUtil.remapWidgets(this);
for (int i = 0; i < widgets.size(); i++) {
map.put(getState().myTabStates.get(i), widgets.get(i));
}
getWidget().setTabs(getState().mySelected, map);
}
示例9: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的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();
navigationBar = (NavigationBarConnector) children.get(0);
getWidget().setNavigationBar(navigationBar.getWidget());
getWidget().setContent(children.get(1).getWidget());
getWidget().setToolbar(
children.size() < 3 ? null : children.get(2).getWidget());
}
示例10: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的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();
getWidget().setToolbar(children.get(0).getWidget());
getWidget().setContent(
children.size() > 1 ? children.get(1).getWidget() : null);
}
示例11: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(final ConnectorHierarchyChangeEvent event) {
getWidget().setWidget(getContentWidget());
}
示例12: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(final ConnectorHierarchyChangeEvent event) {
// We always have 1 child, unless the child is hidden
getWidget().setWidget(getContentWidget());
}
示例13: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
getWidget().updateChildComponents(getChildComponents());
}
示例14: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
if(getParent() != null) {
if (scrollerFollowed == null) {
scrollerFollowed = resolveScrollingParent();
if (scrollerFollowed != null) {
attachScrollingEvents(scrollerFollowed);
} else {
LOGGER.severe("Failed to resolve scrolling parent!");
}
}
} else {
removeScrollingHandlers();
}
waitingResponse = false;
super.onConnectorHierarchyChange(event);
if(getParent() != null) {
Widget indicator = getLazyLoadingIndicator();
if(indicator != null) {
indicator.getElement().getStyle().setOpacity(0.5);
}
// Verify that we do not need to continue loading after hierarchy change
if(scrollingElement != null) {
Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() {
@Override
public boolean execute() {
if (!waitingResponse) {
if (checkIfLazyRequestRequired(scrollingElement)) {
sendLazyLoadRequest();
}
}
return false;
}
}, DELAYED_CHECK_AFTER_CHANGE_MS);
}
}
}
示例15: onConnectorHierarchyChange
import com.vaadin.client.ConnectorHierarchyChangeEvent; //导入依赖的package包/类
@Override
public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent connectorHierarchyChangeEvent) {
if (getState().component != null) {
getWidget().deferredUpdatePosition();
}
}