Examples of FBFormItem


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

        EasyMock.verify(view, formItem);
    }
   
    @Test
    public void testFormItemSelectionDeselected() throws Exception {
        FBFormItem formItem = EasyMock.createMock(FBFormItem.class);
        EasyMock.replay(view, formItem);
        new EditionPresenter(view);
        bus.fireEvent(new FormItemSelectionEvent(formItem, false));
        EasyMock.verify(view, formItem);
    }
View Full Code Here

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

        EasyMock.verify(view, formItem);
    }
   
    @Test
    public void testOnSaveChanges() throws Exception {
        final FBFormItem formItem = EasyMock.createMock(FBFormItem.class);
        final Map<String, Object> oldProps = new HashMap<String, Object>();
        final Map<String, Object> newProps = new HashMap<String, Object>();
       
        UndoableHandler handler = EasyMock.createMock(UndoableHandler.class);
        handler.onEvent(EasyMock.isA(UndoableEvent.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                Object[] params = EasyMock.getCurrentArguments();
                UndoableEvent event = (UndoableEvent) params[0];
                assertNotNull("oldItems shouldn't be null", event.getData("oldItems"));
                assertNotNull("newItems shouldn't be null", event.getData("newItems"));
                assertNotNull("itemSelected shouldn't be null", event.getData("itemSelected"));
                assertSame("oldProps and oldItems should be the same", oldProps, event.getData("oldItems"));
                assertSame("newProps and newItems should be the same", newProps, event.getData("newItems"));
                assertSame("formItem and itemSelected should be the same", formItem, event.getData("itemSelected"));
                return null;
            }
        }).once();
        bus.addHandler(UndoableEvent.TYPE, handler);
        formItem.saveValues(EasyMock.same(newProps));
        EasyMock.expectLastCall().once();
        EasyMock.replay(view, formItem);
        EditionPresenter presenter = new EditionPresenter(view);
        presenter.onSaveChanges(oldProps, newProps, formItem);
        EasyMock.verify(view, formItem);
View Full Code Here

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

        EasyMock.verify(view, formItem);
    }
   
    @Test
    public void testOnResetChanges() throws Exception {
        final FBFormItem formItem = EasyMock.createMock(FBFormItem.class);
        final Map<String, Object> newProps = new HashMap<String, Object>();
        UndoableHandler handler = EasyMock.createMock(UndoableHandler.class);
        handler.onEvent(EasyMock.isA(UndoableEvent.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
View Full Code Here

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

            @SuppressWarnings("unchecked")
            public void undoAction(UndoableEvent event) {
                FBScript script = (FBScript) event.getData("oldScript");
                String eventName = (String) event.getData("eventName");
                Map<String, FBScript> eventActions = (Map<String, FBScript>) event.getData("eventActions");
                FBFormItem item = (FBFormItem) event.getData("item");
                eventActions.put(eventName, script);
                item.setEventActions(eventActions);
            }
            @Override
            public void onEvent(UndoableEvent event) { }
            @Override
            @SuppressWarnings("unchecked")
            public void doAction(UndoableEvent event) {
                FBScript script = (FBScript) event.getData("newScript");
                String eventName = (String) event.getData("eventName");
                Map<String, FBScript> eventActions = (Map<String, FBScript>) event.getData("eventActions");
                FBFormItem item = (FBFormItem) event.getData("item");
                eventActions.put(eventName, script);
                item.setEventActions(eventActions);
            }
        }));
    }
View Full Code Here

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

        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override @SuppressWarnings("unchecked")
            public void undoAction(UndoableEvent event) {
                FBScript script = (FBScript) event.getData("oldScript");
                String eventName = (String) event.getData("eventName");
                FBFormItem item = (FBFormItem) event.getData("item");
                Map<String, FBScript> eventActions = (Map<String, FBScript>) event.getData("eventActions");
                eventActions.put(eventName, script);
                item.setEventActions(eventActions);
            }
            @Override
            public void onEvent(UndoableEvent event) { }
            @Override @SuppressWarnings("unchecked")
            public void doAction(UndoableEvent event) {
                FBScript script = (FBScript) event.getData("newScript");
                String eventName = (String) event.getData("eventName");
                FBFormItem item = (FBFormItem) event.getData("item");
                Map<String, FBScript> eventActions = (Map<String, FBScript>) event.getData("eventActions");
                eventActions.put(eventName, script);
                item.setEventActions(eventActions);
            }
        }));
    }
View Full Code Here

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

            @Override
            public void onEvent(UndoableEvent event) {  }
            @Override
            @SuppressWarnings("unchecked")
            public void undoAction(UndoableEvent event) {
                FBFormItem itemSelected = (FBFormItem) event.getData("itemSelected");
                itemSelected.saveValues((Map<String, Object>) event.getData("oldItems"));
            }
            @Override
            @SuppressWarnings("unchecked")
            public void doAction(UndoableEvent event) {
                FBFormItem itemSelected = (FBFormItem) event.getData("itemSelected");
                itemSelected.saveValues((Map<String, Object>) event.getData("newItems"));
            }
        }));
    }
View Full Code Here

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

            @Override
            public void onEvent(UndoableEvent event) {  }
            @Override
            @SuppressWarnings("unchecked")
            public void undoAction(UndoableEvent event) {
                FBFormItem itemSelected = (FBFormItem) event.getData("fakeItemSelected");
                itemSelected.saveValues((Map<String, Object>) event.getData("newItems"));
                editView.populate(itemSelected);
            }
            @Override
            public void doAction(UndoableEvent event) {
                FBFormItem itemSelected = (FBFormItem) event.getData("fakeItemSelected");
                editView.populate(itemSelected);
            }
        }));
    }
View Full Code Here

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

            @Override
            public void onEvent(UndoableEvent event) {  }
            @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();
                bus.fireEvent(new FormItemRemovedEvent(item));
            }
        }));
    }
View Full Code Here

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

            for (int c = 0; c < table.getCellCount(r); c++) {
                Widget widget = table.getWidget(r, c);
                int colspan = table.getFlexCellFormatter().getColSpan(r, c);
                int rowspan = table.getFlexCellFormatter().getRowSpan(r, c);
                if (widget != null && widget instanceof FBFormItem) {
                    FBFormItem item = (FBFormItem) widget;
                    FormItemRepresentation subRep = item.getRepresentation();
                    rep.setElement(r, c, subRep, colspan, rowspan);
                }
            }
        }
        return rep;
View Full Code Here

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

            for (int rowindex = 0; rowindex < mprep.getElements().size(); rowindex++) {
                List<FormItemRepresentation> row = mprep.getElements().get(rowindex);
                if(row != null) {
                    for (int cellindex = 0; cellindex < row.size(); cellindex++) {
                        FormItemRepresentation cell = row.get(cellindex);
                        FBFormItem subItem = super.createItem(cell);
                        this.table.setWidget(rowindex, cellindex, subItem);
                        int colspan = mprep.getColspan(rowindex, cellindex);
                        int rowspan = mprep.getRowspan(rowindex, cellindex);
                        if (colspan > 1) {
                            this.table.getFlexCellFormatter().setColSpan(rowindex, cellindex, colspan);
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.