Package org.jbpm.formbuilder.client.command

Examples of org.jbpm.formbuilder.client.command.BaseCommand


    }

    public void testEmbededIOReferenceItemsOneElem() throws Exception {
        ArrayList<MenuItem> items = new ArrayList<MenuItem>();
        MenuItem mockItem1 = EasyMock.createMock(MenuItem.class);
        BaseCommand mockCommand1 = EasyMock.createMock(BaseCommand.class);
        EasyMock.expect(mockItem1.getCommand()).andReturn(mockCommand1);
        items.add(mockItem1);
        mockCommand1.setEmbeded(EasyMock.eq("jbpm"));
        EasyMock.expectLastCall().once();
       
        EasyMock.expect(view.getItems()).andReturn(items);
        EasyMock.replay(view, mockItem1, mockCommand1);
        new OptionsPresenter(view);
View Full Code Here


   
    public void testEmbededIOReferenceItemsManyElems() throws Exception {
        ArrayList<MenuItem> items = new ArrayList<MenuItem>();
        MenuItem mockItem1 = EasyMock.createMock(MenuItem.class);
        MenuItem mockItem2 = EasyMock.createMock(MenuItem.class);
        BaseCommand mockCommand1 = EasyMock.createMock(BaseCommand.class);
        BaseCommand mockCommand2 = EasyMock.createMock(BaseCommand.class);
        EasyMock.expect(mockItem1.getCommand()).andReturn(mockCommand1);
        EasyMock.expect(mockItem2.getCommand()).andReturn(mockCommand2);
        mockCommand1.setEmbeded(EasyMock.eq("jbpm"));
        EasyMock.expectLastCall().once();
        mockCommand2.setEmbeded(EasyMock.eq("jbpm"));
        EasyMock.expectLastCall().once();
       
        items.add(mockItem1);
        items.add(mockItem2);
       
View Full Code Here

            public void onEvent(EmbededIOReferenceEvent event) {
                List<MenuItem> items = view.getItems();
                for (MenuItem item : items) {
                    Command cmd = item.getCommand();
                    if (cmd != null && cmd instanceof BaseCommand) {
                        BaseCommand baseCmd = (BaseCommand) cmd;
                        baseCmd.setEmbeded(event.getProfileName());
                    }
                }
            }
        });
    }
View Full Code Here

        return popup;
    }
   
    protected void toMenuBar(MenuBar popup, MainMenuOption option) {
        String html = option.getHtml();
        BaseCommand cmd = option.getCommand();
        List<MainMenuOption> subMenu = option.getSubMenu();
        MenuItem item = null;
        if (cmd == null && subMenu != null && !subMenu.isEmpty()) {
            item = popup.addItem(new SafeHtmlBuilder().appendHtmlConstant(html).toSafeHtml(), toMenuBar(new MenuBar(true), subMenu));
        } else if (cmd != null && (subMenu == null || subMenu.isEmpty())) {
            item = popup.addItem(new SafeHtmlBuilder().appendHtmlConstant(html).toSafeHtml(), cmd);
            cmd.setItem(item);
        }
        if (item != null) {
            this.items.add(item);
            if (!option.isEnabled()) {
                item.setEnabled(false);
View Full Code Here

TOP

Related Classes of org.jbpm.formbuilder.client.command.BaseCommand

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.