Package org.jbpm.formbuilder.client.bus

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


        I18NFormItem item = (I18NFormItem) getItem();
        Map<String, Object> dataSnapshot = new HashMap<String, Object>();
        dataSnapshot.put("item", item);
        dataSnapshot.put("oldI18nMap", item.getI18nMap());
        dataSnapshot.put("newI18nMap", savedMap);
        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override @SuppressWarnings("unchecked")
            public void undoAction(UndoableEvent event) {
                I18NFormItem item = (I18NFormItem) event.getData("item");
                Map<String, String> i18nMap = (Map<String, String>) event.getData("oldI18nMap");
                item.saveI18nMap(i18nMap);
View Full Code Here


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

            public void onChange(ChangeEvent event) {
                Map<String, Object> dataSnapshot = new HashMap<String, Object>();
                dataSnapshot.put("item", item);
                dataSnapshot.put("oldValue", item.getHeader().getText());
                dataSnapshot.put("newValue", textBox.getValue());
                bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
                    @Override
                    public void undoAction(UndoableEvent event) {
                        HeaderFormItem myItem = (HeaderFormItem) event.getData("item");
                        String value = (String) event.getData("oldValue");
                        myItem.setContent("<h1>" + value + "</h1>");
View Full Code Here

            public void onChange(ChangeEvent event) {
                Map<String, Object> dataSnapshot = new HashMap<String, Object>();
                dataSnapshot.put("item", item);
                dataSnapshot.put("oldValue", item.getLabel().getText());
                dataSnapshot.put("newValue", textBox.getValue());
                bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
                    @Override
                    public void undoAction(UndoableEvent event) {
                        LabelFormItem myItem = (LabelFormItem) event.getData("item");
                        String value = (String) event.getData("oldValue");
                        myItem.getLabel().setText(value);
View Full Code Here

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

        Map<String, Object> dataSnapshot = new HashMap<String, Object>();
        dataSnapshot.put("formItem", formItem);
        dataSnapshot.put("menuItem", menuItem);
        dataSnapshot.put("x", x);
        dataSnapshot.put("y", y);
        this.bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            public void onEvent(UndoableEvent event) {  }
            @Override
            public void undoAction(UndoableEvent event) {
                FBFormItem formItem = (FBFormItem) event.getData("formItem");
View Full Code Here

        I18NFormItem item = (I18NFormItem) getItem();
        Map<String, Object> dataSnapshot = new HashMap<String, Object>();
        dataSnapshot.put("item", item);
        dataSnapshot.put("oldFormat", item.getFormat());
        dataSnapshot.put("newFormat", I18NFormItem.Format.valueOf(savedFormat));
        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            public void undoAction(UndoableEvent event) {
                I18NFormItem item = (I18NFormItem) event.getData("item");
                I18NFormItem.Format format = (I18NFormItem.Format) event.getData("oldFormat");
                item.setFormat(format);
View Full Code Here

        dataSnapshot.put("movable", movable);
        dataSnapshot.put("oldMovableX", movable.getAbsoluteLeft());
        dataSnapshot.put("oldMovableY", movable.getAbsoluteTop());
        dataSnapshot.put("x", x);
        dataSnapshot.put("y", y);
        this.bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            public void onEvent(UndoableEvent event) {  }
            @Override
            public void undoAction(UndoableEvent event) {
                FBFormItem formItem = (FBFormItem) event.getData("formItem");
View Full Code Here

        Map<String, Object> dataSnapshot = new HashMap<String, Object>();
        HasSourceReference item = (HasSourceReference) getItem();
        dataSnapshot.put("item", item);
        dataSnapshot.put("oldSrcUrl", item.getSourceReference());
        dataSnapshot.put("newSrcUrl", getSrcUrl());
        bus.fireEvent(new UndoableEvent(dataSnapshot, new UndoableHandler() {
            @Override
            public void onEvent(UndoableEvent event) { }
            @Override
            public void undoAction(UndoableEvent event) {
                HasSourceReference item = (HasSourceReference) event.getData("item");
View Full Code Here

    /**
     * gets the previous action in the history and reverts it
     */
    public synchronized void undo() {
        if (canUndo()) {
            UndoableEvent event = undoRedoWindow.get(index);
            index--;
            event.getRollbackHandler().undoAction(event);
            bus.fireEvent(new UndoRedoEvent());
        }
    }
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.