Examples of LayoutFormItem


Examples of org.jbpm.formapi.client.form.LayoutFormItem

                    itemToPaste = itemToPaste.cloneItem();
                    if (itemToHold == null) {
                        getFormDisplay().add(itemToPaste);
                    } else {
                        if (itemToHold instanceof LayoutFormItem) {
                            LayoutFormItem parentPanel = (LayoutFormItem) itemToHold;
                            parentPanel.add(itemToPaste);
                        } else if (itemToHold instanceof HasOneWidget) {
                            HasOneWidget parentPanel = (HasOneWidget) itemToHold;
                            parentPanel.setWidget(itemToPaste);
                        } else if (itemToHold instanceof HasWidgets) {
                            HasWidgets parentPanel = (HasWidgets) itemToHold;
                            parentPanel.add(itemToPaste);
                        }
                    }
                    bus.fireEvent(new FormItemAddedEvent(itemToPaste, itemToHold == null ? getFormDisplay() : itemToHold));
                }
            }
View Full Code Here

Examples of org.jbpm.formapi.client.form.LayoutFormItem

    }
   
    @Test
    public void testFormItemAddedOnLeaf() throws Exception {
        FBForm rootItem = EasyMock.createMock(FBForm.class);
        LayoutFormItem parentItem = EasyMock.createMock(LayoutFormItem.class);
        FBFormItem formItem = EasyMock.createMock(FBFormItem.class);
        //EasyMock.expect(formItem.getParent()).andReturn(parentItem).once();
        List<FBFormItem> items = new ArrayList<FBFormItem>();
        items.add(formItem);
        EasyMock.expect(parentItem.getItems()).andReturn(items).atLeastOnce();
        view.addFormItem(EasyMock.same(parentItem), EasyMock.same(rootItem));
        EasyMock.expectLastCall().once();
        view.addFormItem(EasyMock.same(formItem), EasyMock.same(parentItem));
        EasyMock.expectLastCall().once();
        view.addFormItem(EasyMock.same(formItem), EasyMock.isNull(FBCompositeItem.class));
View Full Code Here

Examples of org.jbpm.formapi.client.form.LayoutFormItem

        EasyMock.verify(view, drag);
    }
   
    @Test
    public void testRegisterLayout() throws Exception {
        LayoutFormItem layout = EasyMock.createMock(LayoutFormItem.class);
        view.startDropController(EasyMock.same(drag), EasyMock.same(layout));
        EasyMock.expectLastCall().once();
        EasyMock.replay(view, drag, layout);
        new LayoutPresenter(view);
        bus.fireEvent(new RegisterLayoutEvent(layout));
View Full Code Here

Examples of org.jbpm.formapi.client.form.LayoutFormItem

                    if (panel instanceof FBForm) {
                        FBForm formDisplay = (FBForm) panel;
                        formDisplay.remove(menuItem);
                        formDisplay.replacePhantom(formItem);
                    } else {
                        LayoutFormItem layoutItem = (LayoutFormItem) ((Widget) panel).getParent();
                        layoutItem.remove(menuItem);
                        layoutItem.replacePhantom(formItem);
                    }
                    bus.fireEvent(new FormItemAddedEvent(formItem, (Widget) panel));
                }
            }
        }));
View Full Code Here

Examples of org.jbpm.formapi.client.form.LayoutFormItem

                    if (previousContainer instanceof FBForm) {
                        FBForm formDisplay = (FBForm) previousContainer;
                        formDisplay.remove(movable);
                        formDisplay.remove(formItem);
                    } else {
                        LayoutFormItem layoutItem = (LayoutFormItem) ((Widget) previousContainer).getParent();
                        layoutItem.remove(movable);
                        layoutItem.remove(formItem);
                    }
                    if (dropContainer instanceof FBForm) {
                        FBForm formDisplay = (FBForm) dropContainer;
                        formDisplay.replacePhantom(formItem);
                    } else {
                        LayoutFormItem layoutItem = (LayoutFormItem) ((Widget) dropContainer).getParent();
                        layoutItem.replacePhantom(formItem);
                    }
                    bus.fireEvent(new FormItemAddedEvent(formItem, (Widget) dropContainer));
                }
            }
        }));
View Full Code Here

Examples of org.jbpm.formapi.client.form.LayoutFormItem

        this.layoutView.startDropController(dragController, layoutView);
       
        this.bus.addHandler(RegisterLayoutEvent.TYPE, new RegisterLayoutHandler() {
            @Override
            public void onEvent(RegisterLayoutEvent event) {
                LayoutFormItem item = event.getLayout();
                layoutView.startDropController(dragController, item);
            }
        });
       
        this.bus.addHandler(GetFormRepresentationEvent.TYPE, new GetFormRepresentationHandler() {
View Full Code Here

Examples of org.jbpm.formapi.client.form.LayoutFormItem

   
    @Override
    public HasWidgets getUnderlyingLayout(Integer x, Integer y) {
        for (Widget widget : formDisplay) {
            if (widget instanceof LayoutFormItem) {
                LayoutFormItem item = (LayoutFormItem) widget;
                HasWidgets newLayout = item.getUnderlyingLayout(x, y);
                if (newLayout != null) {
                    return newLayout;
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.