Package org.jbpm.formbuilder.client.form

Examples of org.jbpm.formbuilder.client.form.FBForm


        EasyMock.verify(view, formItem);
    }
   
    @Test
    public void testFormItemAddedOnRoot() throws Exception {
        FBForm parentItem = EasyMock.createMock(FBForm.class);
        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);
View Full Code Here


        EasyMock.verify(view, parentItem, formItem);
    }
   
    @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);
View Full Code Here

        EasyMock.verify(view, drag, layout);
    }
   
    @Test
    public void testGetFormRepresentation() throws Exception {
        FBForm mockForm = EasyMock.createMock(FBForm.class);
        EasyMock.expect(view.getFormDisplay()).andReturn(mockForm);
        final FormRepresentation formRep = new FormRepresentation();
        final String saveType = "ANYTHING";
        EasyMock.expect(mockForm.createRepresentation()).andReturn(formRep);
        EasyMock.replay(view, drag, mockForm);
        bus.addHandler(GetFormRepresentationResponseEvent.TYPE, new GetFormRepresentationResponseHandler() {
            @Override
            public void onEvent(GetFormRepresentationResponseEvent event) {
                assertEquals("both forms should be the same", event.getRepresentation(), formRep);
View Full Code Here

        EasyMock.verify(view, drag, mockForm);
    }
   
    @Test
    public void testGetFormDisplay() throws Exception {
        FBForm mockForm = EasyMock.createMock(FBForm.class);
        EasyMock.expect(view.getFormDisplay()).andReturn(mockForm);
        EasyMock.replay(view, drag, mockForm);
        new LayoutPresenter(view);
        GetFormDisplayEvent event = new GetFormDisplayEvent();
        bus.fireEvent(event);
View Full Code Here

   
    @Test
    public void testFormDataPopulated() throws Exception {
        final String name = "name", action = "action", method = "method",   
            taskId = "taskId", processId = "processId", enctype = "enctype";
        FBForm mockForm = EasyMock.createMock(FBForm.class);
        EasyMock.expect(mockForm.getName()).andReturn(name);
        EasyMock.expect(mockForm.getAction()).andReturn(action);
        EasyMock.expect(mockForm.getProcessId()).andReturn(processId);
        EasyMock.expect(mockForm.getTaskId()).andReturn(taskId);
        EasyMock.expect(mockForm.getMethod()).andReturn(method);
        EasyMock.expect(mockForm.getEnctype()).andReturn(enctype);
       
        mockForm.setName(EasyMock.eq(name));
        EasyMock.expectLastCall().once();
        mockForm.setAction(EasyMock.eq(action));
        EasyMock.expectLastCall().once();
        mockForm.setMethod(EasyMock.eq(method));
        EasyMock.expectLastCall().once();
        mockForm.setTaskId(EasyMock.eq(taskId));
        EasyMock.expectLastCall().once();
        mockForm.setProcessId(EasyMock.eq(processId));
        EasyMock.expectLastCall().once();
        mockForm.setEnctype(EasyMock.eq(enctype));
        EasyMock.expectLastCall().once();
       
        EasyMock.expect(view.getFormDisplay()).andReturn(mockForm).anyTimes();
        EasyMock.replay(view, drag, mockForm);
        bus.addHandler(UndoableEvent.TYPE, new UndoableHandler() {
View Full Code Here

        TaskRef ioRef = new TaskRef();
        ioRef.setTaskId(taskId);
        ioRef.setProcessId(processId);
        ioRef.setInputs(new ArrayList<TaskPropertyRef>());
        ioRef.setOutputs(new ArrayList<TaskPropertyRef>());
        FBForm mockForm = EasyMock.createMock(FBForm.class);
        EasyMock.expect(mockForm.getTaskId()).andReturn(taskId).once();
        EasyMock.expect(mockForm.getProcessId()).andReturn(processId).once();
        EasyMock.expect(mockForm.getInputs()).andReturn(new HashMap<String, InputData>()).once();
        EasyMock.expect(mockForm.getOutputs()).andReturn(new HashMap<String, OutputData>()).once();
        mockForm.setTaskId(EasyMock.eq(taskId));
        EasyMock.expectLastCall().once();
        mockForm.setProcessId(EasyMock.eq(processId));
        EasyMock.expectLastCall().once();
        mockForm.setInputs(EasyMock.anyObject(Map.class));
        EasyMock.expectLastCall().once();
        mockForm.setOutputs(EasyMock.anyObject(Map.class));
        EasyMock.expectLastCall().once();
        EasyMock.expect(view.getFormDisplay()).andReturn(mockForm).anyTimes();
       
        bus.addHandler(UndoableEvent.TYPE, new UndoableHandler() {
            @Override
View Full Code Here

        EasyMock.verify(view, drag, mockForm);
    }
   
    @Test
    public void testFormSaved() throws Exception {
        FBForm mockForm = EasyMock.createMock(FBForm.class);
        EasyMock.expect(view.getFormDisplay()).andReturn(mockForm).once();
        mockForm.setSaved(EasyMock.eq(true));
        EasyMock.expectLastCall().once();
        FormRepresentation formRep = new FormRepresentation();
       
        EasyMock.replay(view, drag, mockForm);
        new LayoutPresenter(view);
View Full Code Here

    }

    @Test
    public void testUpdateFormView() throws Exception {
        final FormRepresentation formRep = new FormRepresentation();
        FBForm mockForm = EasyMock.createMock(FBForm.class);
        EasyMock.expect(view.getFormDisplay()).andReturn(mockForm).anyTimes();
        EasyMock.expect(mockForm.createRepresentation()).andReturn(formRep);
        mockForm.populate(formRep);
        EasyMock.expectLastCall().once();
       
        bus.addHandler(UndoableEvent.TYPE, new UndoableHandler() {
            @Override
            public void undoAction(UndoableEvent event) { }
View Full Code Here

                @Override
                public void onEvent(RepresentationFactoryPopulatedEvent event) {
                    try {
                        JsonLoadInput input = JsonLoadInput.parse(innerJson);
                        if (input != null && input.getForm() != null) {
                            FBForm formUI = new FBForm();
                            formUI.populate(input.getForm());
                            formDisplay.add(formUI.asFormPanel(input.getFormData()));
                        }
                    } catch (FormEncodingException e) {
                        Window.alert("Couldn't interpretate form: " + e.getMessage());
                        GWT.log("Couldn't interpretate form", e);
                    } catch (FormBuilderException e) {
View Full Code Here

                Integer x = (Integer) event.getData("x");
                Integer y = (Integer) event.getData("y");
                if (formItem != null) {
                    HasWidgets panel = layoutView.getUnderlyingLayout(x, y);
                    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);
                    }
View Full Code Here

TOP

Related Classes of org.jbpm.formbuilder.client.form.FBForm

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.