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

Java Component类代码示例

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

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



Component类属于com.haulmont.cuba.gui.components包,在下文中一共展示了Component类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: removeAll

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

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

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

        component.setParent(null);
    }

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


示例2: initPermissionColoredColumns

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
@Override
public void initPermissionColoredColumns(TreeTable specificPermissionsTree) {
    specificPermissionsTree.addGeneratedColumn("permissionVariant", new Table.ColumnGenerator<BasicPermissionTarget>() {
        @Override
        public Component generateCell(BasicPermissionTarget entity) {
            Label label = AppConfig.getFactory().createComponent(Label.class);
            JLabel jLabel = (JLabel) DesktopComponentsHelper.unwrap(label);

            StringBuilder builder = new StringBuilder();

            PermissionVariant permissionVariant = entity.getPermissionVariant();

            if (permissionVariant != PermissionVariant.NOTSET) {
                builder.append("<html>");
                builder.append("<font color=\"").append(permissionVariant.getColor()).append("\">")
                        .append(messages.getMessage(permissionVariant)).append("</font>");

                builder.append("</html>");
            }

            jLabel.setText(builder.toString());

            return label;
        }
    }, Label.class);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:27,代码来源:SpecificPermissionsFrameCompanion.java


示例3: DesktopFieldGroup

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
public DesktopFieldGroup() {
    LC lc = new LC();
    lc.hideMode(3); // Invisible components will not participate in the layout at all and it will for instance not take up a grid cell.
    lc.insets("0 0 0 0");
    if (LayoutAdapter.isDebug()) {
        lc.debug(1000);
    }

    layout = new MigLayout(lc);
    impl = new JPanel(layout);
    assignClassDebugProperty(impl);
    collapsiblePanel = new CollapsiblePanel(super.getComposition());
    assignClassDebugProperty(collapsiblePanel);
    collapsiblePanel.setBorderVisible(false);

    setWidth(Component.AUTO_SIZE);

    fieldFactory = AppBeans.get(FieldGroupFieldFactory.NAME);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:20,代码来源:DesktopFieldGroup.java


示例4: PresentationEditor

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
public PresentationEditor(Presentation presentation, Component.HasPresentations component) {
    this.presentation = presentation;
    this.component = component;

    messages = AppBeans.get(Messages.NAME);
    sessionSource = AppBeans.get(UserSessionSource.NAME);

    isNew = PersistenceHelper.isNew(presentation);
    allowGlobalPresentations = sessionSource.getUserSession()
            .isSpecificPermitted("cuba.gui.presentations.global");

    initLayout();

    setWidthUndefined();

    String titleMessageKey = isNew ? "PresentationsEditor.new" : "PresentationsEditor.edit";
    setCaption(getMessage(titleMessageKey));

    setModal(true);
    setResizable(false);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:22,代码来源:PresentationEditor.java


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


示例6: actionPerform

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
@Override
public void actionPerform(Component component) {
    if (!isEnabled())
        return;

    if (beforeActionPerformedHandler != null) {
        if (!beforeActionPerformedHandler.beforeActionPerformed())
            return;
    }

    @SuppressWarnings("unchecked")
    Set<Entity> selected = target.getSelected();
    if (!selected.isEmpty()) {
        if (confirm) {
            confirmAndRemove(selected);
        } else {
            doRemove(selected, autocommit);
            afterRemove(selected);

            if (afterRemoveHandler != null) {
                afterRemoveHandler.handle(selected);
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:26,代码来源:ExcludeAction.java


示例7: testValueChangeListener

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
@Test
public void testValueChangeListener() {
    SearchField searchField = factory.createComponent(SearchField.class);

    CollectionDatasource<Group, UUID> groupsDs = getTestCollectionDatasource();
    searchField.setOptionsDatasource(groupsDs);
    List<Group> groups = new ArrayList<>(groupsDs.getItems());

    Datasource<User> userDs = getTestUserDatasource();
    User user = userDs.getItem();
    user.setGroup(groups.get(0));

    boolean[] valueWasChanged = {false};
    Component.ValueChangeListener listener = e -> valueWasChanged[0] = true;
    searchField.addValueChangeListener(listener);

    searchField.setDatasource(userDs, "group");
    assertEquals(true, valueWasChanged[0]);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:20,代码来源:SearchFieldDsTest.java


示例8: createComponent

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
@Override
protected Component createComponent() {
    componentsFactory = AppBeans.get(ComponentsFactory.class);
    popupButton = componentsFactory.createComponent(PopupButton.class);

    OpManager opManager = AppBeans.get(OpManager.class);
    for (Op op : opManager.availableOps(condition.getJavaClass())) {
        OperatorChangeAction operatorChangeAction = new OperatorChangeAction(op);
        popupButton.addAction(operatorChangeAction);
    }

    popupButton.setCaption(condition.getOperator().getLocCaption());
    popupButton.setStyleName("condition-operation-button");

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


示例9: testUnsubscribeComponentListener

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
@Test
public void testUnsubscribeComponentListener() {
    DateField dateField = (DateField) factory.createComponent(DateField.NAME);

    Datasource<User> userDs = getTestUserDatasource();
    User user = userDs.getItem();

    Date updateTs = new Date();
    user.setUpdateTs(updateTs);
    dateField.setDatasource(userDs, "updateTs");
    dateField.setResolution(DateField.Resolution.SEC);

    // unbind
    dateField.setDatasource(null, null);

    Component.ValueChangeListener valueChangeListener = e -> {
        throw new RuntimeException("Value was changed externally");
    };
    dateField.addValueChangeListener(valueChangeListener);

    user.setUpdateTs(new Date());
    assertEquals(updateTs, dateField.getValue());
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:24,代码来源:DateFieldDsTest.java


示例10: showFrame

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
@Override
protected void showFrame(Component parent, Frame frame) {
    // the same as web window manager does
    if (parent instanceof Component.Container) {
        Component.Container container = (Component.Container) parent;
        for (Component c : container.getComponents()) {
            if (c instanceof Component.Disposable) {
                Component.Disposable disposable =
                        (Component.Disposable) c;
                if (!disposable.isDisposed()) {
                    disposable.dispose();
                }
            }
            container.remove(c);
        }
        container.add(frame);
    } else {
        throw new IllegalStateException(
                "Parent component must be com.haulmont.cuba.gui.components.Component.Container"
        );
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:23,代码来源:DesktopWindowManager.java


示例11: onBtnSetNewStatusClick

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
public void onBtnSetNewStatusClick(Component source) {
    Order o = ordersDs.getItem();
    if (o != null) {
        o.setStatus(OrderStatus.NEW);
        ordersDs.commit();
    }
}
 
开发者ID:cuba-platform,项目名称:sample-workshop,代码行数:8,代码来源:OrderBrowse.java


示例12: onBtnSetReadyStatusClick

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
public void onBtnSetReadyStatusClick(Component source) {
    Order o = ordersDs.getItem();
    if (o != null) {
        o.setStatus(OrderStatus.READY);
        ordersDs.commit();
    }
}
 
开发者ID:cuba-platform,项目名称:sample-workshop,代码行数:8,代码来源:OrderBrowse.java


示例13: onBtnSetInProgressStatusClick

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
public void onBtnSetInProgressStatusClick(Component source) {
    Order o = ordersDs.getItem();
    if (o != null) {
        o.setStatus(OrderStatus.IN_PROGRESS);
        ordersDs.commit();
    }
}
 
开发者ID:cuba-platform,项目名称:sample-workshop,代码行数:8,代码来源:OrderBrowse.java


示例14: initShowCommandLineAction

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
protected void initShowCommandLineAction() {
    AbstractAction action = new AbstractAction("showCommandLine") {
        @Override
        public String getCaption() {
            return "";
        }

        @Override
        public void actionPerform(Component component) {
            commandLineHBox.setVisible(!commandLineHBox.isVisible());
        }
    };
    action.setShortcut("CTRL-ALT-Q");
    addAction(action);
}
 
开发者ID:cuba-platform,项目名称:sample-timesheets,代码行数:16,代码来源:CalendarScreen.java


示例15: adjustTabSize

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
protected void adjustTabSize(Component tabComponent) {
    if (getWidth() >= 0) {
        tabComponent.setWidth("100%");
    } else {
        tabComponent.setWidth(Component.AUTO_SIZE);
    }

    if (getHeight() >= 0) {
        tabComponent.setHeight("100%");
    } else {
        tabComponent.setHeight(Component.AUTO_SIZE);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:DesktopTabSheet.java


示例16: updateEnabled

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
@Override
public void updateEnabled() {
    super.updateEnabled();

    boolean resultEnabled = isEnabledWithParent();
    for (Component component : ownComponents) {
        if (component instanceof DesktopAbstractComponent) {
            ((DesktopAbstractComponent) component).setParentEnabled(resultEnabled);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:12,代码来源:DesktopGridLayout.java


示例17: setFrame

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
@Override
public void setFrame(Frame frame) {
    super.setFrame(frame);

    if (frame != null) {
        for (Component childComponent : components.keySet()) {
            if (childComponent instanceof BelongToFrame
                    && ((BelongToFrame) childComponent).getFrame() == null) {
                ((BelongToFrame) childComponent).setFrame(frame);
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:DesktopTabSheet.java


示例18: createEditor

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
protected PresentationEditor createEditor(Presentation presentation) {
    Class<? extends PresentationEditor> windowClass = getPresentationEditorClass();
    PresentationEditor window;
    try {
        Constructor<? extends PresentationEditor> windowConstructor = windowClass
                .getConstructor(Presentation.class, Component.HasPresentations.class);
        window = windowConstructor.newInstance(presentation, table);
    } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
        throw new DevelopmentException("Invalid presentation's screen");
    }
    return window;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:13,代码来源:AbstractEditPresentationAction.java


示例19: setFrame

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
@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);
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:WebAbstractBox.java


示例20: findChildComponent

import com.haulmont.cuba.gui.components.Component; //导入依赖的package包/类
protected Component findChildComponent(com.vaadin.ui.Component vComponent) {
    for (Component component : getComponents()) {
        if (component.unwrapComposition(com.vaadin.ui.Component.class) == vComponent) {
            return component;
        }
    }
    return null;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:9,代码来源:WebGridLayout.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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