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

Java LayoutEvents类代码示例

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

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



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

示例1: createListItem

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
private ListItem createListItem(boolean single, boolean icon, boolean image, boolean circular, boolean checkBox, ListItem.IconSize iconSize, boolean iconFontColor, boolean iconBackgroundColor, boolean iconSecondary, ListItem.IconSize iconSecondarySize, boolean iconSecondaryFontColor, boolean iconSecondaryBackgroundColor) {
    ListItem item;
    if (single) item = new SingleLineListItem("Single-line item");
    else item = new TwoLineListItem("Two-line item", "Secondary text");

    if (icon) item.setPrimaryIcon(randomEnum(MaterialIcons.class));
    if (image) item.setPrimaryIcon(getRandomImage());
    if (circular) item.setPrimaryIconCircular(circular);
    if (checkBox) item.setPrimaryCheckBox(new MDCheckbox());
    if (iconSize != null) item.setPrimaryIconSize(iconSize);
    if (iconFontColor) item.setPrimaryIconFontColor(randomEnum(MaterialColor.class));
    if (iconBackgroundColor) item.setPrimaryIconBackgroundColor(randomEnum(MaterialColor.class));

    if (iconSecondary) item.setSecondaryIcon(randomEnum(MaterialIcons.class));
    if (iconSecondarySize != null) item.setSecondaryIconSize(iconSecondarySize);
    if (iconSecondaryFontColor) item.setSecondaryIconFontColor(randomEnum(MaterialColor.class));
    if (iconSecondaryBackgroundColor) item.setSecondaryIconBackgroundColor(randomEnum(MaterialColor.class));

    item.addPrimaryActionListener((LayoutEvents.LayoutClickListener) e -> createNotification("Primary action clicked"));
    item.addSecondaryActionListener((LayoutEvents.LayoutClickListener) e -> createNotification("Secondary action clicked"));

    return item;
}
 
开发者ID:vaadin,项目名称:material-theme-fw8,代码行数:24,代码来源:ListsView.java


示例2: createEmptyLayout

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
private Layout createEmptyLayout() {
    Label label = new Label("Add new job...");
    label.setSizeUndefined();
    label.addStyleName(ValoTheme.LABEL_LARGE);
    
    VerticalLayout  emptyLayout = new VerticalLayout(label);
    emptyLayout.addStyleName("dashed-border");
    emptyLayout.setWidth(380, Unit.PIXELS);
    emptyLayout.setHeight(220, Unit.PIXELS);
    emptyLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
    emptyLayout.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            BatchJobConfiguration jobConfig = presenter.createBatchJob();
            BatchJobCard batchJobCard = batchJobCardInstances.get();
            batchJobCard.load(jobConfig);
            batchJobCard.addBatchJobCardListener(BatchJobsLayout.this);
            batchJobLayout.addComponent(batchJobCard, batchJobLayout.getComponentCount()-1);
        }
    });
    return emptyLayout;
}
 
开发者ID:felixhusse,项目名称:bookery,代码行数:24,代码来源:BatchJobsLayout.java


示例3: createUserManagement

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
public HorizontalLayout createUserManagement() {
    userManagementLayout = new HorizontalLayout();
    userManagementLayout.addStyleName("wrapping");
    userManagementLayout.setSpacing(true);
    userManagementLayout.setMargin(true);

    Label label = new Label("Add new user...");
    label.setSizeUndefined();
    label.addStyleName(ValoTheme.LABEL_LARGE);
    VerticalLayout emptyLayout = new VerticalLayout(label);
    emptyLayout.addStyleName("dashed-border");
    emptyLayout.setWidth(380, Unit.PIXELS);
    emptyLayout.setHeight(220, Unit.PIXELS);
    emptyLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
    emptyLayout.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            AppUser appUser = presenter.createNewUser();
            AppUserCard appUserCard = appUserCardInstances.get();
            appUserCard.loadAppUser(appUser);
            appUserCard.addAppUserCardListener(AdminView.this);
            userManagementLayout.addComponent(appUserCard, userManagementLayout.getComponentCount() - 1);
        }
    });
    userManagementLayout.addComponent(emptyLayout);
    return userManagementLayout;
}
 
开发者ID:felixhusse,项目名称:bookery,代码行数:29,代码来源:AdminView.java


示例4: addLayoutClickListener

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Registration addLayoutClickListener(LayoutEvents.LayoutClickListener listener) {
    return addListener(EventId.LAYOUT_CLICK_EVENT_IDENTIFIER,
            LayoutEvents.LayoutClickEvent.class, listener,
            LayoutEvents.LayoutClickListener.clickMethod);
}
 
开发者ID:alump,项目名称:GridStack,代码行数:10,代码来源:GridStackLayout.java


示例5: editableProjectLogoComp

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
public static Component editableProjectLogoComp(String projectShortname, Integer projectId, String projectAvatarId, int size) {
    VerticalLayout wrapper = new VerticalLayout();

    if (CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.PROJECT)) {
        wrapper.addStyleName("cursor_pointer");
        wrapper.setDescription(UserUIContext.getMessage(GenericI18Enum.OPT_CHANGE_IMAGE));
        wrapper.addLayoutClickListener((LayoutEvents.LayoutClickListener) layoutClickEvent ->
                UI.getCurrent().addWindow(new ProjectLogoUploadWindow(projectShortname, projectId, projectAvatarId))
        );
    }

    if (!StringUtils.isBlank(projectAvatarId)) {
        Image image = new Image(null, new ExternalResource(StorageUtils.getResourcePath
                (String.format("%s/%s_%d.png", PathUtils.getProjectLogoPath(AppUI.getAccountId(), projectId),
                        projectAvatarId, size))));
        image.addStyleName(UIConstants.CIRCLE_BOX);
        wrapper.addComponent(image);
    } else {
        ELabel projectIcon = new ELabel(projectShortname).withStyleName(UIConstants.TEXT_ELLIPSIS, ValoTheme.LABEL_LARGE, "center");
        projectIcon.addStyleName(UIConstants.CIRCLE_BOX);
        projectIcon.setWidth(size, Sizeable.Unit.PIXELS);
        projectIcon.setHeight(size, Sizeable.Unit.PIXELS);
        wrapper.addComponent(projectIcon);
        wrapper.setComponentAlignment(projectIcon, Alignment.MIDDLE_CENTER);
    }
    wrapper.setWidth(size, Sizeable.Unit.PIXELS);
    wrapper.setHeight(size, Sizeable.Unit.PIXELS);
    return wrapper;
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:30,代码来源:ProjectAssetsUtil.java


示例6: editableAccountLogoComp

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
public static Component editableAccountLogoComp(SimpleAccount account, int size) {
    VerticalLayout wrapper = new VerticalLayout();

    if (UserUIContext.canWrite(RolePermissionCollections.CRM_ACCOUNT)) {
        wrapper.addStyleName("cursor_pointer");
        wrapper.setDescription(UserUIContext.getMessage(GenericI18Enum.OPT_CHANGE_IMAGE));
        wrapper.addLayoutClickListener((LayoutEvents.LayoutClickListener) layoutClickEvent ->
                UI.getCurrent().addWindow(new AccountLogoUpdateWindow(account)));
    }

    if (!StringUtils.isBlank(account.getAvatarid())) {
        Image image = new Image(null, new ExternalResource(StorageUtils.getEntityLogoPath(AppUI.getAccountId(), account.getAvatarid(), size)));
        image.addStyleName(UIConstants.CIRCLE_BOX);
        wrapper.addComponent(image);
    } else {
        String accountName = account.getAccountname();
        accountName = (accountName.length() > 3) ? accountName.substring(0, 3) : accountName;
        ELabel accountIcon = new ELabel(accountName).withStyleName(UIConstants.TEXT_ELLIPSIS, "center");
        accountIcon.setWidth(size, Sizeable.Unit.PIXELS);
        accountIcon.setHeight(size, Sizeable.Unit.PIXELS);
        accountIcon.addStyleName(UIConstants.CIRCLE_BOX);
        wrapper.addComponent(accountIcon);
        wrapper.setComponentAlignment(accountIcon, Alignment.MIDDLE_CENTER);
    }
    wrapper.setWidth(size, Sizeable.Unit.PIXELS);
    wrapper.setHeight(size, Sizeable.Unit.PIXELS);
    return wrapper;
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:29,代码来源:CrmAssetsUtil.java


示例7: setPrimaryCheckBox

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
public void setPrimaryCheckBox(MDCheckbox checkbox) {
    setPrimaryIconVisible(true);
    iconPrimary.setCheckBox(checkbox);
    addPrimaryActionListener((LayoutEvents.LayoutClickListener) e -> checkbox.setValue(!checkbox.getValue()));
}
 
开发者ID:vaadin,项目名称:material-theme-fw8,代码行数:6,代码来源:ListItem.java


示例8: setSecondaryCheckBox

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
public void setSecondaryCheckBox(MDCheckbox checkbox) {
    setSecondaryIconVisible(true);
    iconSecondary.setCheckBox(checkbox);
    addSecondaryActionListener((LayoutEvents.LayoutClickListener) e -> checkbox.setValue(!checkbox.getValue()));
}
 
开发者ID:vaadin,项目名称:material-theme-fw8,代码行数:6,代码来源:ListItem.java


示例9: addPrimaryActionListener

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
public void addPrimaryActionListener(LayoutEvents.LayoutClickListener listener) {
    addStyleName("clickable");
    actionPrimary.addLayoutClickListener(listener);
}
 
开发者ID:vaadin,项目名称:material-theme-fw8,代码行数:5,代码来源:ListItem.java


示例10: addSecondaryActionListener

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
public void addSecondaryActionListener(LayoutEvents.LayoutClickListener listener) {
    addStyleName("clickable");
    actionSecondary.addLayoutClickListener(listener);
}
 
开发者ID:vaadin,项目名称:material-theme-fw8,代码行数:5,代码来源:ListItem.java


示例11: addLayoutClickListener

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
@Override
public Registration addLayoutClickListener(LayoutEvents.LayoutClickListener listener) {
  Objects.requireNonNull(listener, "listener may not be null");
  return rootLayout.addLayoutClickListener(listener);
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:6,代码来源:StepLabel.java


示例12: removeLayoutClickListener

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
@Deprecated
@Override
public void removeLayoutClickListener(LayoutEvents.LayoutClickListener listener) {
  Objects.requireNonNull(listener, "listener may not be null");
  rootLayout.removeLayoutClickListener(listener);
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:7,代码来源:StepLabel.java


示例13: layoutClick

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
@Override
public void layoutClick(MouseEventDetails mouseEventDetails, Connector connector) {
    fireEvent(LayoutEvents.LayoutClickEvent.createEvent(GridStackLayout.this,
            mouseEventDetails, connector));
}
 
开发者ID:alump,项目名称:GridStack,代码行数:6,代码来源:GridStackLayout.java


示例14: removeLayoutClickListener

import com.vaadin.event.LayoutEvents; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void removeLayoutClickListener(LayoutEvents.LayoutClickListener listener) {
    removeListener(EventId.LAYOUT_CLICK_EVENT_IDENTIFIER,
            LayoutEvents.LayoutClickEvent.class, listener);
}
 
开发者ID:alump,项目名称:GridStack,代码行数:9,代码来源:GridStackLayout.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java PathView类代码示例发布时间:2022-05-23
下一篇:
Java Attachment类代码示例发布时间: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