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


Java Component.getId方法代码示例

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


在下文中一共展示了Component.getId方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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");
    }

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

    if (childComponent.getId() != null) {
        component.addComponent(vComponent, childComponent.getId());
    } else {
        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,代码行数:28,代码来源:WebHtmlBoxLayout.java

示例3: remove

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void remove(Component childComponent) {
    if (childComponent.getId() != null) {
        component.removeComponent(childComponent.getId());
    } else {
        component.removeComponent(WebComponentsHelper.getComposition(childComponent));
    }
    ownComponents.remove(childComponent);

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

示例4: remove

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void remove(Component component) {
    if (wrappers.containsKey(component)) {
        getContainer().remove(wrappers.get(component).getFirst());
        wrappers.remove(component);
    } else {
        getContainer().remove(DesktopComponentsHelper.getComposition(component));
    }
    getContainer().validate();
    if (captions.containsKey(component)) {
        getContainer().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 && !isEnabled()) {
        ((DesktopAbstractComponent) component).setParentEnabled(true);
    }

    if (expandedComponent == component) {
        expandedComponent = null;
    }

    component.setParent(null);

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

示例5: remove

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void remove(Component component) {
    JComponent composition = DesktopComponentsHelper.getComposition(component);
    if (wrappers.containsKey(component)) {
        impl.remove(wrappers.get(component).getFirst());
        wrappers.remove(component);
    } else {
        impl.remove(composition);
    }
    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 (expandedComponent == component) {
        expandedComponent = null;
    }

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

    component.setParent(null);

    requestContainerUpdate();

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

示例6: add

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

    // captions not added here
    final JComponent composition = DesktopComponentsHelper.getComposition(component);
    impl.add(composition, layoutAdapter.getConstraints(component));

    if (component.getId() != null) {
        componentByIds.put(component.getId(), component);
    }

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

    ownComponents.add(component);

    DesktopContainerHelper.assignContainer(component, this);

    if (component instanceof DesktopAbstractComponent && !isEnabledWithParent()) {
        ((DesktopAbstractComponent) component).setParentEnabled(false);
    }
    component.setParent(this);

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

示例7: 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

示例8: add

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void add(Component component) {
    JComponent jComponent = DesktopComponentsHelper.getComposition(component);
    jComponent.setMinimumSize(new Dimension());
    if (ownComponents.isEmpty()) {
        impl.setLeftComponent(jComponent);
    } else {
        impl.setRightComponent(jComponent);
    }

    if (component.getId() != null) {
        componentByIds.put(component.getId(), component);
    }

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

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

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

示例9: remove

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

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

    if (component.getId() != null) {
        componentByIds.remove(component.getId());
    }
    ownComponents.remove(component);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:15,代码来源:DesktopSplitPanel.java

示例10: registerComponent

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void registerComponent(Component component) {
    if (component.getId() != null) {
        allComponents.put(component.getId(), component);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:7,代码来源:WebWindow.java

示例11: unregisterComponent

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void unregisterComponent(Component component) {
    if (component.getId() != null) {
        allComponents.remove(component.getId());
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:7,代码来源:WebWindow.java

示例12: add

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

    if (ownComponents.contains(component)) {
        int existingIndex = new ArrayList<>(ownComponents).indexOf(component);
        if (index > existingIndex) {
            index--;
        }

        remove(component);
    }

    JComponent composition = DesktopComponentsHelper.getComposition(component);
    boolean hasExternalCaption = DesktopContainerHelper.hasExternalCaption(component);
    if (hasExternalCaption
            || DesktopContainerHelper.hasExternalContextHelp(component)) {
        ComponentCaption caption = new ComponentCaption(component);
        captions.put(component, caption);

        JPanel wrapper = new JPanel();
        BoxLayoutAdapter adapter = BoxLayoutAdapter.create(wrapper);
        adapter.setExpandLayout(true);
        adapter.setSpacing(false);
        adapter.setMargin(false);
        wrapper.add(composition);

        if (hasExternalCaption) {
            adapter.setFlowDirection(BoxLayoutAdapter.FlowDirection.Y);
            wrapper.add(caption, 0);
        } else {
            wrapper.add(caption, new CC().alignY("top"));
        }

        getContainer().add(wrapper, layoutAdapter.getConstraints(component), index);
        wrappers.put(component, new Pair<>(wrapper, adapter));
    } else {
        getContainer().add(composition, layoutAdapter.getConstraints(component), index);
    }

    if (component.getId() != null) {
        componentByIds.put(component.getId(), component);
    }

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

    if (index == ownComponents.size()) {
        ownComponents.add(component);
    } else {
        List<Component> componentsTempList = new ArrayList<>(ownComponents);
        componentsTempList.add(index, component);

        ownComponents.clear();
        ownComponents.addAll(componentsTempList);
    }

    DesktopContainerHelper.assignContainer(component, this);

    if (component instanceof DesktopAbstractComponent && !isEnabled()) {
        ((DesktopAbstractComponent) component).setParentEnabled(false);
    }

    component.setParent(this);

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

示例13: add

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

    if (ownComponents.contains(component)) {
        int existingIndex = new ArrayList<>(ownComponents).indexOf(component);
        if (index > existingIndex) {
            index--;
        }

        remove(component);
    }

    JComponent composition = DesktopComponentsHelper.getComposition(component);
    boolean hasExternalCaption = DesktopContainerHelper.hasExternalCaption(component);
    if (hasExternalCaption
            || DesktopContainerHelper.hasExternalContextHelp(component)) {
        ComponentCaption caption  = new ComponentCaption(component);
        captions.put(component, caption);

        JPanel wrapper = new LayoutSlot();
        BoxLayoutAdapter adapter = BoxLayoutAdapter.create(wrapper);
        adapter.setExpandLayout(true);
        adapter.setSpacing(false);
        adapter.setMargin(false);
        wrapper.add(composition);

        if (hasExternalCaption) {
            adapter.setFlowDirection(BoxLayoutAdapter.FlowDirection.Y);
            wrapper.add(caption, 0);
        } else {
            wrapper.add(caption, new CC().alignY("top"));
        }

        impl.add(wrapper, layoutAdapter.getConstraints(component), index);
        wrappers.put(component, new Pair<>(wrapper, adapter));
    } else {
        impl.add(composition, layoutAdapter.getConstraints(component), index);
    }

    if (component.getId() != null) {
        componentByIds.put(component.getId(), component);
    }

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

    if (index == ownComponents.size()) {
        ownComponents.add(component);
    } else {
        List<Component> componentsTempList = new ArrayList<>(ownComponents);
        componentsTempList.add(index, component);

        ownComponents.clear();
        ownComponents.addAll(componentsTempList);
    }

    DesktopContainerHelper.assignContainer(component, this);

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

    component.setParent(this);

    requestContainerUpdate();

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


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