Package org.jbpm.formbuilder.client.bus

Examples of org.jbpm.formbuilder.client.bus.UndoableEvent


            dataSnapshot.put("newOutput", null);
        }
        dataSnapshot.put("oldOutput", effect.getOutput());
        dataSnapshot.put("newExtData", externalDataPanel.getData());
        dataSnapshot.put("oldExtData", effect.getExtData());
        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            public void onEvent(UndoableEvent event) { }
            @Override
            public void undoAction(UndoableEvent event) {
                effect.setInput((TaskPropertyRef) event.getData("oldInput"));
View Full Code Here


    private void undoableEffect(final PopupPanel panel, final String label) {
        Map<String, Object> dataSnapshot = new HashMap<String, Object>();
        dataSnapshot.put("deletedLabel", label);
        dataSnapshot.put("deletedValue", getValue(label));
        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            public void onEvent(UndoableEvent event) {  }
            @Override
            public void undoAction(UndoableEvent event) {
                String label = (String) event.getData("deletedLabel");
View Full Code Here

        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));
View Full Code Here

        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("newItems shouldn't be null", event.getData("newItems"));
                assertNotNull("fakeItemSelected shouldn't be null", event.getData("fakeItemSelected"));
                assertSame("newProps and newItems should be the same", newProps, event.getData("newItems"));
                assertSame("formItem and fakeItemSelected should be the same", formItem, event.getData("itemSelected"));
                return null;
            }
        }).once();
        bus.addHandler(UndoableEvent.TYPE, handler);
        view.populate(EasyMock.same(formItem));
View Full Code Here

        dataSnapshot.put("oldScript", getItem().getEventActions().get(eventName));
        dataSnapshot.put("newScript", script);
        dataSnapshot.put("eventName", eventName);
        dataSnapshot.put("eventActions", getItem().getEventActions());
        dataSnapshot.put("item", getItem());
        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");
View Full Code Here

        dataSnapshot.put("oldScript", getItem().getEventActions().get(eventName));
        dataSnapshot.put("newScript", script);
        dataSnapshot.put("eventActions", getItemActions());
        dataSnapshot.put("eventName", eventName);
        dataSnapshot.put("item", getItem());
        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");
View Full Code Here

    @Override
    protected void createStyles() {
        final Map<String, Object> dataSnapshot = new HashMap<String, Object>();
        dataSnapshot.put("selectedX", getParent().getAbsoluteLeft());
        dataSnapshot.put("item", getItem());
        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            @SuppressWarnings("unchecked")
            public void undoAction(UndoableEvent event) {
                TableLayoutFormItem item = (TableLayoutFormItem) event.getData("item");
                Integer selectedX = (Integer) event.getData("selectedX");
View Full Code Here

    public void onSaveChanges(Map<String, Object> oldProps, Map<String, Object> newProps, FBFormItem itemSelected) {
        Map<String, Object> dataSnapshot = new HashMap<String, Object>();
        dataSnapshot.put("oldItems", oldProps);
        dataSnapshot.put("newItems", newProps);
        dataSnapshot.put("itemSelected", itemSelected);
        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            public void onEvent(UndoableEvent event) {  }
            @Override
            @SuppressWarnings("unchecked")
            public void undoAction(UndoableEvent event) {
View Full Code Here

    @Override
    public void onResetChanges(FBFormItem fakeItem, Map<String, Object> newItems) {
        Map<String, Object> dataSnapshot = new HashMap<String, Object>();
        dataSnapshot.put("newItems", newItems);
        dataSnapshot.put("fakeItemSelected", fakeItem);
        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            public void onEvent(UndoableEvent event) {  }
            @Override
            @SuppressWarnings("unchecked")
            public void undoAction(UndoableEvent event) {
View Full Code Here

    protected void createStyles() {
        getItem().fireSelectionEvent(new FormItemSelectionEvent(getItem(), false));
        Map<String, Object> dataSnapshot = new HashMap<String, Object>();
        dataSnapshot.put("itemParent", getItem().getParent());
        dataSnapshot.put("item", getItem());
        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            public void onEvent(UndoableEvent event) {  }
            @Override
            public void undoAction(UndoableEvent event) {
                Panel panel = (Panel) event.getData("itemParent");
View Full Code Here

TOP

Related Classes of org.jbpm.formbuilder.client.bus.UndoableEvent

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.