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


Java Component.setParent方法代码示例

本文整理汇总了Java中com.haulmont.cuba.gui.components.Component.setParent方法的典型用法代码示例。如果您正苦于以下问题:Java Component.setParent方法的具体用法?Java Component.setParent怎么用?Java Component.setParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.haulmont.cuba.gui.components.Component的用法示例。


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

示例1: removeAll

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void removeAll() {
    getContainer().removeAllComponents();
    for (Component childComponent : ownComponents) {
        if (childComponent.getId() != null) {
            allComponents.remove(childComponent.getId());
        }
    }

    Component[] childComponents = ownComponents.toArray(new Component[ownComponents.size()]);
    ownComponents.clear();

    for (Component ownComponent : childComponents) {
        ownComponent.setParent(null);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:WebWindow.java

示例2: removeAllTabs

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void removeAllTabs() {
    impl.removeAll();

    List<Component> innerComponents = new ArrayList<>(components.keySet());
    components.clear();

    for (Component component : innerComponents) {
        DesktopContainerHelper.assignContainer(component, null);
        if (component instanceof DesktopAbstractComponent && !isEnabledWithParent()) {
            ((DesktopAbstractComponent) component).setParentEnabled(true);
        }

        component.setParent(null);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:DesktopTabSheet.java

示例3: removeAll

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void removeAll() {
    impl.removeAll();
    componentByIds.clear();

    List<Component> components = new ArrayList<>(ownComponents);
    ownComponents.clear();

    for (Component component : components) {
        if (component instanceof DesktopAbstractComponent && !isEnabledWithParent()) {
            ((DesktopAbstractComponent) component).setParentEnabled(true);
        }

        component.setParent(null);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:DesktopSplitPanel.java

示例4: add

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@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 {
            frame.registerComponent(childComponent);
        }
    }

    ownComponents.add(childComponent);

    childComponent.setParent(this);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:25,代码来源:WebGridLayout.java

示例5: add

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void add(Component childComponent, int index) {
    if (childComponent.getParent() != null && childComponent.getParent() != this) {
        throw new IllegalStateException("Component already has parent");
    }

    if (ownComponents.contains(childComponent)) {
        com.vaadin.ui.Component composition = WebComponentsHelper.getComposition(childComponent);
        int existingIndex = ((AbstractOrderedLayout)getContainer()).getComponentIndex(composition);
        if (index > existingIndex) {
            index--;
        }

        remove(childComponent);
    }

    ComponentContainer container = getContainer();
    com.vaadin.ui.Component vComponent = WebComponentsHelper.getComposition(childComponent);
    ((AbstractOrderedLayout)container).addComponent(vComponent, index);

    com.vaadin.ui.Alignment alignment = WebWrapperUtils.toVaadinAlignment(childComponent.getAlignment());
    ((AbstractOrderedLayout) container).setComponentAlignment(vComponent, alignment);

    if (childComponent instanceof BelongToFrame
            && ((BelongToFrame) childComponent).getFrame() == null) {
        ((BelongToFrame) childComponent).setFrame(this);
    } else {
        registerComponent(childComponent);
    }

    if (index == ownComponents.size()) {
        ownComponents.add(childComponent);
    } else {
        ownComponents.add(index, childComponent);
    }

    childComponent.setParent(this);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:39,代码来源:WebWindow.java

示例6: remove

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void remove(Component component) {
    if (wrappers.containsKey(component)) {
        impl.remove(wrappers.get(component).getFirst());
        wrappers.remove(component);
    } else {
        impl.remove(DesktopComponentsHelper.getComposition(component));
    }
    if (captions.containsKey(component)) {
        impl.remove(captions.get(component));
        captions.remove(component);

    }
    if (component.getId() != null) {
        componentByIds.remove(component.getId());
    }
    ownComponents.remove(component);

    DesktopContainerHelper.assignContainer(component, null);

    if (component instanceof DesktopAbstractComponent && !isEnabledWithParent()) {
        ((DesktopAbstractComponent) component).setParentEnabled(true);
    }
    component.setParent(null);

    requestRepaint();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:28,代码来源:DesktopGridLayout.java

示例7: removeAll

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void removeAll() {
    getContent().removeAllComponents();

    Component[] components = ownComponents.toArray(new Component[ownComponents.size()]);
    ownComponents.clear();

    for (Component childComponent : components) {
        childComponent.setParent(null);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:12,代码来源:WebScrollBoxLayout.java

示例8: setPopupContent

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void setPopupContent(Component popupContent) {
    if (this.popupContent != null) {
        if (this.popupContent instanceof BelongToFrame) {
            ((BelongToFrame) this.popupContent).setFrame(null);
        } else {
            detachFromFrame(this.popupContent);
        }
        this.popupContent.setParent(null);
    }

    this.popupContent = popupContent;

    if (popupContent != null) {
        component.setContent(new PopupContent());

        if (frame != null) {
            if (popupContent instanceof BelongToFrame
                    && ((BelongToFrame) popupContent).getFrame() == null) {
                ((BelongToFrame) popupContent).setFrame(frame);
            } else {
                attachToFrame(popupContent);
            }
        }
        popupContent.setParent(this);
    } else {
        component.setContent(new EmptyContent());
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:30,代码来源:WebPopupView.java

示例9: add

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void add(Component childComponent) {
    if (childComponent.getParent() != null && childComponent.getParent() != this) {
        throw new IllegalStateException("Component already has parent");
    }

    if (component == null) {
        createComponentImpl();
    }
    if (getId() != null) {
        component.setCubaId(getId());
    } else {
        component.setCubaId(getAlternativeDebugId());
    }

    final com.vaadin.ui.Component vComponent = WebComponentsHelper.getComposition(childComponent);

    component.addComponent(vComponent);

    if (frame != null) {
        if (childComponent instanceof BelongToFrame
                && ((BelongToFrame) childComponent).getFrame() == null) {
            ((BelongToFrame) childComponent).setFrame(frame);
        } else {
            frame.registerComponent(childComponent);
        }
    }

    ownComponents.add(childComponent);

    childComponent.setParent(this);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:33,代码来源:WebSplitPanel.java

示例10: removeAll

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void removeAll() {
    component.removeAllComponents();

    Component[] components = ownComponents.toArray(new Component[ownComponents.size()]);
    ownComponents.clear();

    for (Component childComponent : components) {
        childComponent.setParent(null);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:12,代码来源:WebAbstractBox.java

示例11: removeTab

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void removeTab(String name) {
    TabImpl tab = getTabImpl(name);
    Component component = tab.getComponent();
    components.remove(component);
    impl.remove(DesktopComponentsHelper.getComposition(component));

    DesktopContainerHelper.assignContainer(component, null);
    if (component instanceof DesktopAbstractComponent && !isEnabledWithParent()) {
        ((DesktopAbstractComponent) component).setParentEnabled(true);
    }

    component.setParent(null);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:15,代码来源:DesktopTabSheet.java

示例12: addTab

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public Accordion.Tab addTab(String name, Component childComponent) {
    if (childComponent.getParent() != null && childComponent.getParent() != this) {
        throw new IllegalStateException("Component already has parent");
    }

    final Tab tab = new Tab(name, childComponent);

    this.tabs.put(name, tab);

    final com.vaadin.ui.Component tabComponent = WebComponentsHelper.getComposition(childComponent);
    tabComponent.setSizeFull();

    tabMapping.put(tabComponent, new ComponentDescriptor(name, childComponent));
    com.vaadin.ui.Accordion.Tab tabControl = this.component.addTab(tabComponent);

    if (getDebugId() != null) {
        this.component.setTestId(tabControl,
                AppUI.getCurrent().getTestIdManager().getTestId(getDebugId() + "." + name));
    }
    if (AppUI.getCurrent().isTestMode()) {
        this.component.setCubaId(tabControl, name);
    }

    if (frame != null) {
        if (childComponent instanceof BelongToFrame
                && ((BelongToFrame) childComponent).getFrame() == null) {
            ((BelongToFrame) childComponent).setFrame(frame);
        } else {
            frame.registerComponent(childComponent);
        }
    }

    childComponent.setParent(this);

    return tab;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:38,代码来源:WebAccordion.java

示例13: remove

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void remove(Component childComponent) {
    component.removeComponent(childComponent.unwrapComposition(com.vaadin.ui.Component.class));
    ownComponents.remove(childComponent);

    childComponent.setParent(null);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:8,代码来源:WebGridLayout.java

示例14: add

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void add(Component childComponent, int index) {
    if (childComponent.getParent() != null && childComponent.getParent() != this) {
        throw new IllegalStateException("Component already has parent");
    }

    if (ownComponents.contains(childComponent)) {
        int existingIndex = component.getComponentIndex(WebComponentsHelper.getComposition(childComponent));
        if (index > existingIndex) {
            index--;
        }

        remove(childComponent);
    }

    com.vaadin.ui.Component vComponent = WebComponentsHelper.getComposition(childComponent);
    component.addComponent(vComponent, index);

    if (frame != null) {
        if (childComponent instanceof BelongToFrame
                && ((BelongToFrame) childComponent).getFrame() == null) {
            ((BelongToFrame) childComponent).setFrame(frame);
        } else {
            frame.registerComponent(childComponent);
        }
    }

    if (index == ownComponents.size()) {
        ownComponents.add(childComponent);
    } else {
        ownComponents.add(index, childComponent);
    }

    childComponent.setParent(this);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:36,代码来源:WebAbstractOrderedLayout.java

示例15: remove

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void remove(Component component) {
    components.remove(component);
    content.remove(component);

    if (component instanceof DesktopAbstractComponent && !isEnabledWithParent()) {
        ((DesktopAbstractComponent) component).setParentEnabled(true);
    }

    component.setParent(null);

    adjustViewPreferredSize();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:DesktopScrollBoxLayout.java


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