Package org.jbpm.formbuilder.client.bus.ui

Examples of org.jbpm.formbuilder.client.bus.ui.FormItemAddedEvent


        for (FormItemRepresentation itemRep : rep.getFormItems()) {
            FBFormItem item = FBFormItem.createItem(itemRep);
            item.populate(itemRep);
            add(item);
            ensureMinimumSize(item);
            bus.fireEvent(new FormItemAddedEvent(item, this));
        }
        for (FBValidation validationRep : rep.getFormValidations()) {
            FBValidationItem validation = FBValidationItem.createValidation(validationRep);
            addValidation(validation);
        }
View Full Code Here


                        } else if (itemToHold instanceof HasWidgets) {
                            HasWidgets parentPanel = (HasWidgets) itemToHold;
                            parentPanel.add(itemToPaste);
                        }
                    }
                    bus.fireEvent(new FormItemAddedEvent(itemToPaste, itemToHold == null ? getFormDisplay() : itemToHold));
                }
            }
            @Override
            public void onEvent(UndoableEvent event) { }
            @Override
View Full Code Here

        FBFormItem formItem = EasyMock.createMock(FBFormItem.class);
        view.addFormItem(EasyMock.same(formItem), EasyMock.same(parentItem));
        EasyMock.expectLastCall().once();
        EasyMock.replay(view, parentItem, formItem);
        new TreePresenter(view);
        bus.fireEvent(new FormItemAddedEvent(formItem, parentItem));
        EasyMock.verify(view, parentItem, formItem);
    }
View Full Code Here

        EasyMock.expectLastCall().once();
        view.addFormItem(EasyMock.same(formItem), EasyMock.isNull(FBCompositeItem.class));
        EasyMock.expectLastCall().once();
        EasyMock.replay(view, rootItem, parentItem, formItem);
        new TreePresenter(view);
        bus.fireEvent(new FormItemAddedEvent(parentItem, rootItem));
        bus.fireEvent(new FormItemAddedEvent(formItem, null));
        EasyMock.verify(view, rootItem, parentItem, formItem);
    }
View Full Code Here

            @Override
            public void undoAction(UndoableEvent event) {
                Panel panel = (Panel) event.getData("itemParent");
                FBFormItem item = (FBFormItem) event.getData("item");
                panel.add(item);
                bus.fireEvent(new FormItemAddedEvent(item, panel));
            }
            @Override
            public void doAction(UndoableEvent event) {
                FBFormItem item = (FBFormItem) event.getData("item");
                item.removeFromParent();
View Full Code Here

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

                bus.fireEvent(new FormItemRemovedEvent(formItem));
                Integer oldX = (Integer) event.getData("oldMovableX");
                Integer oldY = (Integer) event.getData("oldMovableY");
                HasWidgets panel2 = layoutView.getUnderlyingLayout(oldX, oldY);
                panel2.add(formItem);
                bus.fireEvent(new FormItemAddedEvent(formItem, (Widget) panel2));
            }
            @Override
            public void doAction(UndoableEvent event) {
                FBFormItem formItem = (FBFormItem) event.getData("formItem");
                MovablePanel movable = (MovablePanel) event.getData("movable");
                Integer x = (Integer) event.getData("x");
                Integer y = (Integer) event.getData("y");
                if (formItem != null) {
                    bus.fireEvent(new FormItemRemovedEvent(formItem));
                    HasWidgets dropContainer = layoutView.getUnderlyingLayout(x, y);
                    Widget previousContainer = formItem.getParent();
                    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

                    oldParentPanel.add(item);
                } else if (oldParent instanceof HasOneWidget) {
                    HasOneWidget oldParentPanel = (HasOneWidget) oldParent;
                    oldParentPanel.setWidget(item);
                }
                bus.fireEvent(new FormItemAddedEvent(item, oldParent));
            }
            @Override
            public void onEvent(UndoableEvent event) { }
        });
    }
View Full Code Here

TOP

Related Classes of org.jbpm.formbuilder.client.bus.ui.FormItemAddedEvent

Copyright © 2018 www.massapicom. 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.