protected void checkActionsHolder(ActionsHolder holder) { if (holder instanceof Frame) { frame = (Frame) holder; } else if (holder instanceof Component.BelongToFrame) { frame = ((Component.BelongToFrame) holder).getFrame(); } else { throw new IllegalStateException(String.format("Component %s can't contain DeclarativeAction", holder)); } }
protected void checkActionsHolder(ActionsHolder holder) { if (holder instanceof Frame) { frame = (Frame) holder; } else if (holder instanceof Component.BelongToFrame) { frame = ((Component.BelongToFrame) holder).getFrame(); } else { throw new IllegalStateException(String.format("Component %s can't contain DeclarativeAction", holder)); } }
public static String getComponentPath(Component c) { StringBuilder sb = new StringBuilder(c.getId() == null ? "" : c.getId()); if (c instanceof Component.BelongToFrame) { Frame frame = ((Component.BelongToFrame) c).getFrame(); while (frame != null) { sb.insert(0, "."); String s = frame.getId(); if (s.contains(".")) { s = "[" + s + "]"; } sb.insert(0, s); if (frame instanceof Window) { break; } frame = frame.getFrame(); } } return sb.toString(); }
/** * Get the topmost window for the specified component. * * @param component component instance * @return topmost window in the hierarchy of frames for this component. * <br>Can be null only if the component wasn't properly initialized. */ @Nullable public static Window getWindow(Component.BelongToFrame component) { Frame frame = component.getFrame(); while (frame != null) { if (frame instanceof Window && frame.getFrame() == frame) { return (Window) frame; } frame = frame.getFrame(); } return null; }
@Override public void add(Component childComponent) { if (childComponent.getParent() != null && childComponent.getParent() != this) { throw new IllegalStateException("Component already has parent"); } final com.vaadin.ui.Component vComponent = WebComponentsHelper.getComposition(childComponent); component.addComponent(vComponent); component.setComponentAlignment(vComponent, WebWrapperUtils.toVaadinAlignment(childComponent.getAlignment())); if (frame != null) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } else if (frame instanceof FrameImplementation) { ((FrameImplementation) frame).registerComponent(childComponent); } } ownComponents.add(childComponent); childComponent.setParent(this); }
@Override public void add(Component childComponent) { if (childComponent.getParent() != null && childComponent.getParent() != this) { throw new IllegalStateException("Component already has parent"); } com.vaadin.ui.Component vComponent = childComponent.unwrapComposition(com.vaadin.ui.Component.class); component.addComponent(vComponent); component.setComponentAlignment(vComponent, toVaadinAlignment(childComponent.getAlignment())); if (frame != null) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } else { ((FrameImplementation) frame).registerComponent(childComponent); } } ownComponents.add(childComponent); childComponent.setParent(this); }
@Override public void add(Component childComponent, int col, int row, int col2, int row2) { if (childComponent.getParent() != null && childComponent.getParent() != this) { throw new IllegalStateException("Component already has parent"); } com.vaadin.ui.Component vComponent = childComponent.unwrapComposition(com.vaadin.ui.Component.class); component.addComponent(vComponent, col, row, col2, row2); component.setComponentAlignment(vComponent, toVaadinAlignment(childComponent.getAlignment())); if (frame != null) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } else { ((FrameImplementation) frame).registerComponent(childComponent); } } ownComponents.add(childComponent); childComponent.setParent(this); }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (ComponentDescriptor descriptor : tabMapping.values()) { Component childComponent = descriptor.getComponent(); if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (ComponentDescriptor descriptor : tabMapping.values()) { Component childComponent = descriptor.getComponent(); if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (popupContent != null && frame != null) { if (popupContent instanceof BelongToFrame && ((BelongToFrame) popupContent).getFrame() == null) { ((BelongToFrame) popupContent).setFrame(frame); } else { attachToFrame(popupContent); } } }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (Component childComponent : ownComponents) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }
protected void assignTypicalAttributes(Component c) { if (getFrame() != null && c instanceof BelongToFrame) { BelongToFrame belongToFrame = (BelongToFrame) c; if (belongToFrame.getFrame() == null) { belongToFrame.setFrame(getFrame()); } } c.setParent(this); }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (Component childComponent : ownComponents) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (Component childComponent : ownComponents) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (Component childComponent : ownComponents) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (Component childComponent : ownComponents) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (Component childComponent : ownComponents) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }
protected void assignTypicalAttributes(Component component) { if (getFrame() != null && component instanceof BelongToFrame) { BelongToFrame belongToFrame = (BelongToFrame) component; if (belongToFrame.getFrame() == null) { belongToFrame.setFrame(getFrame()); } } component.setParent(this); }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (Component childComponent : ownComponents) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }
@Override public void setFrame(Frame frame) { super.setFrame(frame); if (frame != null) { for (Component childComponent : ownComponents) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } } } }