Package org.jbpm.formbuilder.client

Examples of org.jbpm.formbuilder.client.FormBuilderService


        EasyMock.verify(view, drag);
    }

    @Test
    public void testMenuItemAddedForUser() throws Exception {
        FormBuilderService service = EasyMock.createMock(FormBuilderService.class);
        FormBuilderGlobals.getInstance().registerService(service);
        FBMenuItem menuItem = EasyMock.createMock(FBMenuItem.class);
        String groupName = "group";
        service.getCurrentRoles(EasyMock.isA(FormBuilderService.RolesResponseHandler.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
            @Override
            public Object answer() throws Throwable {
                Object[] params = EasyMock.getCurrentArguments();
                FormBuilderService.RolesResponseHandler handler = (FormBuilderService.RolesResponseHandler) params[0];
View Full Code Here


        EasyMock.verify(service, menuItem, view, drag);
    }
   
    @Test
    public void testMenuItemAddedForDesigner() throws Exception {
        FormBuilderService service = EasyMock.createMock(FormBuilderService.class);
        FormBuilderGlobals.getInstance().registerService(service);
        FBMenuItem menuItem = EasyMock.createMock(FBMenuItem.class);
        String groupName = "group";
        view.addItem(EasyMock.same(groupName), EasyMock.same(menuItem));
        EasyMock.expectLastCall().once();
        service.getCurrentRoles(EasyMock.isA(FormBuilderService.RolesResponseHandler.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
            @Override
            public Object answer() throws Throwable {
                Object[] params = EasyMock.getCurrentArguments();
                FormBuilderService.RolesResponseHandler handler = (FormBuilderService.RolesResponseHandler) params[0];
View Full Code Here

                            AdvancedSearchView.this
                    );
                }
            }
        });
        FormBuilderService server = FormBuilderGlobals.getInstance().getService();
        bus.addHandlerToSource(ExistingTasksResponseEvent.TYPE, server, new ExistingTasksResponseHandler() {
            @Override
            public void onEvent(ExistingTasksResponseEvent event) {
                List<TaskRef> tasks = event.getTasks();
                processes.clear();
View Full Code Here

        EasyMock.verify(menuItem, view, drag);
    }

    @Test
    public void testMenuItemFromServerForUser() throws Exception {
        FormBuilderService service = EasyMock.createMock(FormBuilderService.class);
        FormBuilderGlobals.getInstance().registerService(service);
        FBMenuItem menuItem = EasyMock.createMock(FBMenuItem.class);
        String groupName = "group";
        service.getCurrentRoles(EasyMock.isA(FormBuilderService.RolesResponseHandler.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
            @Override
            public Object answer() throws Throwable {
                Object[] params = EasyMock.getCurrentArguments();
                FormBuilderService.RolesResponseHandler handler = (FormBuilderService.RolesResponseHandler) params[0];
View Full Code Here

        EasyMock.verify(service, menuItem, view, drag);
    }
   
    @Test
    public void testMenuItemFromServerForDesigner() throws Exception {
        FormBuilderService service = EasyMock.createMock(FormBuilderService.class);
        FormBuilderGlobals.getInstance().registerService(service);
        FBMenuItem menuItem = EasyMock.createMock(FBMenuItem.class);
        String groupName = "group";
        view.addItem(EasyMock.same(groupName), EasyMock.same(menuItem));
        EasyMock.expectLastCall().once();
        service.getCurrentRoles(EasyMock.isA(FormBuilderService.RolesResponseHandler.class));
        EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
            @Override
            public Object answer() throws Throwable {
                Object[] params = EasyMock.getCurrentArguments();
                FormBuilderService.RolesResponseHandler handler = (FormBuilderService.RolesResponseHandler) params[0];
View Full Code Here

*/
public class FormDisplayController {

    public FormDisplayController(RootPanel formInfo, final RootPanel formDisplay) {
        EventBus eventBus = CommonGlobals.getInstance().getEventBus();
        FormBuilderService server = FormBuilderGlobals.getInstance().getService();
        FormEncodingFactory.register(FormEncodingClientFactory.getEncoder(), FormEncodingClientFactory.getDecoder());
        try {
            final String innerJson = formInfo.getElement().getInnerHTML();
            formInfo.getElement().setInnerHTML("");
            formInfo.getElement().getStyle().setHeight(1, Unit.PX);
            eventBus.addHandler(RepresentationFactoryPopulatedEvent.TYPE, new RepresentationFactoryPopulatedHandler() {
                @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) {
                        Window.alert("Couldn't populate display: " + e.getMessage());
                        GWT.log("Couldn't populate display", e);
                    }
                }
            });
            server.populateRepresentationFactory();
        } catch (FormBuilderException e) {
            Window.alert("Couldn't populate representation factory: " + e.getMessage());
            GWT.log("Couldn't populate representation factory", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.jbpm.formbuilder.client.FormBuilderService

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.