Package org.apache.cayenne.modeler.undo

Examples of org.apache.cayenne.modeler.undo.RemoveAttributeUndoableEdit


                EmbeddableAttribute[] eAttrs = getProjectController()
                        .getCurrentEmbAttrs();

                application.getUndoManager().addEdit(
                        new RemoveAttributeUndoableEdit(embeddable, eAttrs));

                removeEmbeddableAttributes(embeddable, eAttrs);

            }
        }
        else if (attrs != null && attrs.length > 0) {
            if ((attrs.length == 1 && dialog.shouldDelete("ObjAttribute", attrs[0]
                    .getName()))
                    || (attrs.length > 1 && dialog.shouldDelete("selected ObjAttributes"))) {

                ObjEntity entity = mediator.getCurrentObjEntity();
                ObjAttribute[] attribs = mediator.getCurrentObjAttributes();

                application.getUndoManager().addEdit(
                        new RemoveAttributeUndoableEdit(
                                mediator.getCurrentDataDomain(),
                                mediator.getCurrentDataMap(),
                                entity,
                                attribs));

                removeObjAttributes(entity, attribs);
            }
        }
        else {
            DbAttribute[] dbAttrs = getProjectController().getCurrentDbAttributes();
            if (dbAttrs != null && dbAttrs.length > 0) {
                if ((dbAttrs.length == 1 && dialog.shouldDelete("DbAttribute", dbAttrs[0]
                        .getName()))
                        || (dbAttrs.length > 1 && dialog
                                .shouldDelete("selected DbAttributes"))) {

                    DbEntity entity = mediator.getCurrentDbEntity();
                    DbAttribute[] attribs = mediator.getCurrentDbAttributes();

                    ProjectPath[] paths = getProjectController().getCurrentPaths();

                    application.getUndoManager().addEdit(
                            new RemoveAttributeUndoableEdit(
                                    mediator.getCurrentDataDomain(),
                                    mediator.getCurrentDataMap(),
                                    entity,
                                    attribs));
View Full Code Here


                EmbeddableAttribute[] eAttrs = getProjectController()
                        .getCurrentEmbAttrs();

                application.getUndoManager().addEdit(
                        new RemoveAttributeUndoableEdit(embeddable, eAttrs));

                removeEmbeddableAttributes(embeddable, eAttrs);

            }
        }
        else if (attrs != null && attrs.length > 0) {
            if ((attrs.length == 1 && dialog.shouldDelete("ObjAttribute", attrs[0]
                    .getName()))
                    || (attrs.length > 1 && dialog.shouldDelete("selected ObjAttributes"))) {

                ObjEntity entity = mediator.getCurrentObjEntity();
                ObjAttribute[] attribs = mediator.getCurrentObjAttributes();

                application.getUndoManager().addEdit(
                        new RemoveAttributeUndoableEdit(
                                (DataChannelDescriptor)mediator.getProject().getRootNode(),
                                mediator.getCurrentDataMap(),
                                entity,
                                attribs));

                removeObjAttributes(entity, attribs);
            }
        }
        else {
            DbAttribute[] dbAttrs = getProjectController().getCurrentDbAttributes();
            if (dbAttrs != null && dbAttrs.length > 0) {
                if ((dbAttrs.length == 1 && dialog.shouldDelete("DbAttribute", dbAttrs[0]
                        .getName()))
                        || (dbAttrs.length > 1 && dialog
                                .shouldDelete("selected DbAttributes"))) {

                    DbEntity entity = mediator.getCurrentDbEntity();
                    DbAttribute[] attribs = mediator.getCurrentDbAttributes();

                    application.getUndoManager().addEdit(
                            new RemoveAttributeUndoableEdit(
                                    (DataChannelDescriptor)mediator.getProject().getRootNode(),
                                    mediator.getCurrentDataMap(),
                                    entity,
                                    attribs));
View Full Code Here

TOP

Related Classes of org.apache.cayenne.modeler.undo.RemoveAttributeUndoableEdit

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.