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

Java DragAndDropWrapper类代码示例

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

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



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

示例1: createDragAndDropWrapper

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private DragAndDropWrapper createDragAndDropWrapper(final Button tagButton, final String name, final Long id) {
    final DragAndDropWrapper bsmBtnWrapper = new DragAndDropWrapper(tagButton);
    bsmBtnWrapper.addStyleName(ValoTheme.DRAG_AND_DROP_WRAPPER_NO_VERTICAL_DRAG_HINTS);
    bsmBtnWrapper.addStyleName(ValoTheme.DRAG_AND_DROP_WRAPPER_NO_HORIZONTAL_DRAG_HINTS);
    bsmBtnWrapper.addStyleName(SPUIStyleDefinitions.FILTER_BUTTON_WRAPPER);
    if (getButtonWrapperData() != null) {
        if (id == null) {
            bsmBtnWrapper.setData(getButtonWrapperData());
        } else {
            bsmBtnWrapper.setData(getButtonWrapperData().concat("" + id));
        }
    }
    bsmBtnWrapper.setId(getButttonWrapperIdPrefix().concat(name));
    bsmBtnWrapper.setDragStartMode(DragStartMode.WRAPPER);
    bsmBtnWrapper.setDropHandler(getFilterButtonDropHandler());
    return bsmBtnWrapper;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:18,代码来源:AbstractFilterButtons.java


示例2: buildPalette

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private Component buildPalette() {
    HorizontalLayout paletteLayout = new HorizontalLayout();
    paletteLayout.setSpacing(true);
    paletteLayout.setWidthUndefined();
    paletteLayout.addStyleName("palette");

    paletteLayout.addComponent(buildPaletteItem(PaletteItemType.TEXT));
    paletteLayout.addComponent(buildPaletteItem(PaletteItemType.TABLE));
    paletteLayout.addComponent(buildPaletteItem(PaletteItemType.CHART));

    paletteLayout.addLayoutClickListener(new LayoutClickListener() {
        @Override
        public void layoutClick(final LayoutClickEvent event) {
            if (event.getChildComponent() != null) {
                PaletteItemType data = (PaletteItemType) ((DragAndDropWrapper) event
                        .getChildComponent()).getData();
                addWidget(data, null);
            }
        }
    });

    return paletteLayout;
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:24,代码来源:ReportEditor.java


示例3: prepareModeler

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private void prepareModeler() {

        processModelLayout.setProcessEditor(this);
        final DragAndDropWrapper pane = new DragAndDropWrapper(processModelLayout);
        pane.setDragStartMode(DragAndDropWrapper.DragStartMode.NONE);
        pane.setDropHandler(processModelLayout.dropHandler);
        processModelLayout.setProcessModel(processModel);
        processModelLayout.initUI();

        cssLayout.addComponent(pane);
        cssLayout.addStyleName("process-editor");
        cssLayout.setSizeFull();

        editorBackground.setSizeFull();
        editorBackground.setMargin(false);
        editorBackground.setSpacing(false);
        editorBackground.addComponent(cssLayout);

        mainPanel.setContent(editorBackground);
    }
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:21,代码来源:ProcessEditor.java


示例4: validateDragAndDropWrapper

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
@Override
protected boolean validateDragAndDropWrapper(final DragAndDropWrapper wrapperSource) {
    final String tagName = HawkbitCommonUtil.removePrefix(wrapperSource.getId(),
            SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
    if (wrapperSource.getId().startsWith(SPUIDefinitions.TARGET_TAG_ID_PREFIXS)) {
        if ("NO TAG".equals(tagName)) {
            notification.displayValidationError(i18n.getMessage(ACTION_NOT_ALLOWED_MSG));
            return false;
        }
    } else {
        notification.displayValidationError(i18n.getMessage(ACTION_NOT_ALLOWED_MSG));
        return false;
    }

    return true;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:17,代码来源:TargetTable.java


示例5: deleteDistributionTag

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private void deleteDistributionTag(final Component source) {
    final String tagName = HawkbitCommonUtil.removePrefix(source.getId(),
            SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS);
    if (managementUIState.getDistributionTableFilters().getDistSetTags().contains(tagName)) {
        notification.displayValidationError(i18n.getMessage("message.tag.delete", new Object[] { tagName }));
    } else {
        distributionSetTagManagement.delete(tagName);

        if (source instanceof DragAndDropWrapper) {
            final Long id = DeleteActionsLayoutHelper.getDistributionTagId((DragAndDropWrapper) source);
            eventBus.publish(this,
                    new DistributionSetTagTableEvent(BaseEntityEventType.REMOVE_ENTITY, Arrays.asList(id)));
        }

        notification.displaySuccess(i18n.getMessage("message.delete.success", new Object[] { tagName }));
    }
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:18,代码来源:DeleteActionsLayout.java


示例6: addGeneratedCell

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private DragAndDropWrapper addGeneratedCell(final Object itemId) {

        final Item item = getItem(itemId);
        final Long id = (Long) item.getItemProperty(SPUILabelDefinitions.VAR_ID).getValue();
        final String name = (String) item.getItemProperty(SPUILabelDefinitions.VAR_NAME).getValue();
        final String desc = HawkbitCommonUtil
                .trimAndNullIfEmpty((String) item.getItemProperty(SPUILabelDefinitions.VAR_DESC).getValue()) != null
                        ? item.getItemProperty(SPUILabelDefinitions.VAR_DESC).getValue().toString() : null;
        final String color = HawkbitCommonUtil
                .trimAndNullIfEmpty((String) item.getItemProperty(SPUILabelDefinitions.VAR_COLOR).getValue()) != null
                        ? item.getItemProperty(SPUILabelDefinitions.VAR_COLOR).getValue().toString() : DEFAULT_GREEN;
        final Button typeButton = createFilterButton(id, name, desc, color, itemId);
        typeButton.addClickListener(event -> filterButtonClickBehaviour.processFilterButtonClick(event));

        if ((NO_TAG_BUTTON_ID.equals(typeButton.getData()) && isNoTagStateSelected())
                || (id != null && isClickedByDefault(name))) {

            filterButtonClickBehaviour.setDefaultClickedButton(typeButton);
        }

        return createDragAndDropWrapper(typeButton, name, id);
    }
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:23,代码来源:AbstractFilterButtons.java


示例7: getTableDropHandler

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private DropHandler getTableDropHandler() {
    return new DropHandler() {
        private static final long serialVersionUID = 1L;

        @Override
        public AcceptCriterion getAcceptCriterion() {
            return getDropAcceptCriterion();
        }

        @Override
        public void drop(final DragAndDropEvent event) {
            if (!isDropValid(event)) {
                return;
            }
            if (event.getTransferable().getSourceComponent() instanceof Table) {
                onDropEventFromTable(event);
            } else if (event.getTransferable().getSourceComponent() instanceof DragAndDropWrapper) {
                onDropEventFromWrapper(event);
            }
        }
    };
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:23,代码来源:AbstractTable.java


示例8: isDropValid

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
protected boolean isDropValid(final DragAndDropEvent dragEvent) {
    final Transferable transferable = dragEvent.getTransferable();
    final Component compsource = transferable.getSourceComponent();

    if (!hasDropPermission()) {
        notification.displayValidationError(i18n.getMessage("message.permission.insufficient"));
        return false;
    }

    if (compsource instanceof Table) {
        return validateTable((Table) compsource)
                && validateDropList(getDraggedTargetList((TableTransferable) transferable, (Table) compsource));
    }

    if (compsource instanceof DragAndDropWrapper) {
        return validateDragAndDropWrapper((DragAndDropWrapper) compsource)
                && validateDropList(getDraggedTargetList(dragEvent));
    }
    notification.displayValidationError(i18n.getMessage(ACTION_NOT_ALLOWED_MSG));
    return false;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:22,代码来源:AbstractTable.java


示例9: createDeleteWrapperLayout

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private DragAndDropWrapper createDeleteWrapperLayout() {
    final Button dropToDelete = new Button(i18n.getMessage("label.components.drop.area"));
    dropToDelete.setCaptionAsHtml(true);
    dropToDelete.setIcon(FontAwesome.TRASH_O);
    dropToDelete.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    dropToDelete.addStyleName("drop-to-delete-button");
    dropToDelete.addStyleName(SPUIStyleDefinitions.ACTION_BUTTON);
    dropToDelete.addStyleName(SPUIStyleDefinitions.DEL_ACTION_BUTTON);
    dropToDelete.addStyleName("delete-icon");

    final DragAndDropWrapper wrapper = new DragAndDropWrapper(dropToDelete);
    wrapper.setStyleName(ValoTheme.BUTTON_PRIMARY);
    wrapper.setId(getDeleteAreaId());
    wrapper.setDropHandler(this);
    wrapper.addStyleName("delete-button-border");
    return wrapper;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:18,代码来源:AbstractDeleteActionsLayout.java


示例10: addItemToFlowPanelSection

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
protected void addItemToFlowPanelSection(String labelName, String componentType, VerticalLayout componentLayout, StreamResource icon,
        String componentId) {

    FlowPaletteItem paletteItem = new FlowPaletteItem(labelName);
    if (componentId != null) {
        paletteItem.setShared(true);
        paletteItem.setComponentId(componentId);
    } else {
        paletteItem.setComponentType(componentType);
        paletteItem.setShared(false);
    }
    paletteItem.setIcon(icon);
    paletteItem.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
    paletteItem.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    paletteItem.addStyleName("leftAligned");
    paletteItem.setWidth(100, Unit.PERCENTAGE);
    DragAndDropWrapper wrapper = new DragAndDropWrapper(paletteItem);
    wrapper.setSizeUndefined();
    wrapper.setDragStartMode(DragStartMode.WRAPPER);
    componentLayout.addComponent(wrapper);
    componentLayout.setComponentAlignment(wrapper, Alignment.TOP_CENTER);

}
 
开发者ID:JumpMind,项目名称:metl,代码行数:24,代码来源:EditFlowPalette.java


示例11: buildPaletteItem

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private Component buildPaletteItem(final PaletteItemType type) {
    Label caption = new Label(type.getIcon().getHtml() + type.getTitle(),
            ContentMode.HTML);
    caption.setSizeUndefined();

    DragAndDropWrapper ddWrap = new DragAndDropWrapper(caption);
    ddWrap.setSizeUndefined();
    ddWrap.setDragStartMode(DragStartMode.WRAPPER);
    ddWrap.setData(type);
    return ddWrap;
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:12,代码来源:ReportEditor.java


示例12: ElementModelLayout

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
public ElementModelLayout(TaskModel taskModel, ProcessModelLayout processModelLayout) {
    super(null);
    setCompositionRoot(button);
    setSizeUndefined();
    setDragStartMode(DragAndDropWrapper.DragStartMode.WRAPPER);
    this.taskModel = taskModel;
    this.processModelLayout = processModelLayout;
    button.setCaption(taskModel.getTitle());
    button.setWidth(taskModel.getWidth(), Unit.PIXELS);
    button.setHeight(taskModel.getHeight(), Unit.PIXELS);
    button.addStyleName("process-element");
    setStyleSelected(false);
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:14,代码来源:ElementModelLayout.java


示例13: buildLayout

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private void buildLayout() {

        final Upload upload = new Upload();
        final UploadHandler uploadHandler = new UploadHandler(null, 0, this, multipartConfigElement.getMaxFileSize(),
                upload, null, null, softwareModuleManagement);
        upload.setButtonCaption(i18n.getMessage("upload.file"));
        upload.setImmediate(true);
        upload.setReceiver(uploadHandler);
        upload.addSucceededListener(uploadHandler);
        upload.addFailedListener(uploadHandler);
        upload.addFinishedListener(uploadHandler);
        upload.addProgressListener(uploadHandler);
        upload.addStartedListener(uploadHandler);
        upload.addStyleName(SPUIStyleDefinitions.ACTION_BUTTON);
        upload.addStyleName("no-border");

        fileUploadLayout = new HorizontalLayout();
        fileUploadLayout.setSpacing(true);
        fileUploadLayout.addStyleName(SPUIStyleDefinitions.FOOTER_LAYOUT);
        fileUploadLayout.addComponent(upload);
        fileUploadLayout.setComponentAlignment(upload, Alignment.MIDDLE_LEFT);
        fileUploadLayout.addComponent(processBtn);
        fileUploadLayout.setComponentAlignment(processBtn, Alignment.MIDDLE_RIGHT);
        fileUploadLayout.addComponent(discardBtn);
        fileUploadLayout.setComponentAlignment(discardBtn, Alignment.MIDDLE_RIGHT);
        fileUploadLayout.addComponent(uploadStatusButton);
        fileUploadLayout.setComponentAlignment(uploadStatusButton, Alignment.MIDDLE_RIGHT);
        setMargin(false);

        /* create drag-drop wrapper for drop area */
        dropAreaWrapper = new DragAndDropWrapper(createDropAreaLayout());
        dropAreaWrapper.setDropHandler(new DropAreahandler());
        setSizeFull();
        setSpacing(true);
    }
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:36,代码来源:UploadLayout.java


示例14: validateDragAndDropWrapper

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
@Override
protected boolean validateDragAndDropWrapper(final DragAndDropWrapper wrapperSource) {
    final String tagData = wrapperSource.getData().toString();
    if (wrapperSource.getId().startsWith(SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS)) {
        return !isNoTagButton(tagData, SPUIDefinitions.DISTRIBUTION_TAG_BUTTON);
    } else if (wrapperSource.getId().startsWith(SPUIDefinitions.TARGET_TAG_ID_PREFIXS)) {
        return !isNoTagButton(tagData, SPUIDefinitions.TARGET_TAG_BUTTON);
    }
    notification.displayValidationError(notAllowedMsg);
    return false;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:12,代码来源:DistributionTable.java


示例15: isNoTagAssigned

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private Boolean isNoTagAssigned(final DragAndDropEvent event) {
    final String tagName = ((DragAndDropWrapper) (event.getTargetDetails().getTarget())).getData().toString();
    if (tagName.equals(SPUIDefinitions.TARGET_TAG_BUTTON)) {
        notification.displayValidationError(i18n.getMessage("message.tag.cannot.be.assigned",
                new Object[] { i18n.getMessage("label.no.tag.assigned") }));
        return false;
    }
    return true;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:10,代码来源:TargetTagFilterButtons.java


示例16: isNoTagAssigned

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private Boolean isNoTagAssigned(final DragAndDropEvent event) {
    final String tagName = ((DragAndDropWrapper) (event.getTransferable().getSourceComponent())).getData()
            .toString();
    if (tagName.equals(SPUIDefinitions.TARGET_TAG_BUTTON)) {
        notification.displayValidationError(i18n.getMessage("message.tag.cannot.be.assigned",
                new Object[] { i18n.getMessage("label.no.tag.assigned") }));
        return false;
    }
    return true;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:11,代码来源:TargetTable.java


示例17: isNoTagAssigned

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private Boolean isNoTagAssigned(final DragAndDropEvent event) {
    final String tagName = ((DragAndDropWrapper) (event.getTargetDetails().getTarget())).getData().toString();
    if (tagName.equals(SPUIDefinitions.DISTRIBUTION_TAG_BUTTON)) {
        notification.displayValidationError(i18n.getMessage("message.tag.cannot.be.assigned",
                new Object[] { i18n.getMessage("label.no.tag.assigned") }));
        return false;
    }
    return true;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:10,代码来源:DistributionTagDropEvent.java


示例18: isTargetTag

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
static boolean isTargetTag(final Component source) {
    if (source instanceof DragAndDropWrapper) {
        final String wrapperData = ((DragAndDropWrapper) source).getData().toString();
        final String id = wrapperData.replace(SPUIDefinitions.TARGET_TAG_BUTTON, "");
        if (wrapperData.contains(SPUIDefinitions.TARGET_TAG_BUTTON) && !id.trim().isEmpty()) {
            return true;
        }
    }
    return false;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:11,代码来源:DeleteActionsLayoutHelper.java


示例19: isDistributionTag

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
static boolean isDistributionTag(final Component source) {
    if (source instanceof DragAndDropWrapper) {
        final String wrapperData = ((DragAndDropWrapper) source).getData().toString();
        final String id = wrapperData.replace(SPUIDefinitions.DISTRIBUTION_TAG_BUTTON, "");
        return wrapperData.contains(SPUIDefinitions.DISTRIBUTION_TAG_BUTTON) && !id.trim().isEmpty();
    }
    return false;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:9,代码来源:DeleteActionsLayoutHelper.java


示例20: deleteTargetTag

import com.vaadin.ui.DragAndDropWrapper; //导入依赖的package包/类
private void deleteTargetTag(final Component source) {
    final String tagName = HawkbitCommonUtil.removePrefix(source.getId(), SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
    if (managementUIState.getTargetTableFilters().getClickedTargetTags().contains(tagName)) {
        notification.displayValidationError(i18n.getMessage("message.tag.delete", new Object[] { tagName }));
    } else {
        targetTagManagement.delete(tagName);

        if (source instanceof DragAndDropWrapper) {
            final Long id = DeleteActionsLayoutHelper.getTargetTagId((DragAndDropWrapper) source);
            eventBus.publish(this, new TargetTagTableEvent(BaseEntityEventType.REMOVE_ENTITY, Arrays.asList(id)));
        }

        notification.displaySuccess(i18n.getMessage("message.delete.success", new Object[] { tagName }));
    }
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:16,代码来源:DeleteActionsLayout.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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