Package org.locationtech.udig.project.internal

Examples of org.locationtech.udig.project.internal.EditManager


     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetEditManagerInternal(EditManager newEditManagerInternal,
            NotificationChain msgs) {
        EditManager oldEditManagerInternal = editManagerInternal;
        editManagerInternal = newEditManagerInternal;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
                    ProjectPackage.MAP__EDIT_MANAGER_INTERNAL, oldEditManagerInternal,
                    newEditManagerInternal);
View Full Code Here


            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case ProjectPackage.EDIT_MANAGER: {
            EditManager editManager = (EditManager) theEObject;
            T result = caseEditManager(editManager);
            if (result == null)
                result = caseIEditManager(editManager);
            if (result == null)
                result = defaultCase(theEObject);
View Full Code Here

    public void testTransactionUse() throws Exception {
        IGeoResource resource1 = MapTests.createGeoResource(UDIGTestUtil.createDefaultTestFeatures(
                "type1", 4), false); //$NON-NLS-1$
        Map map = MapTests.createNonDynamicMapAndRenderer(resource1, new Dimension(512,512));
        ILayer layer = map.getLayersInternal().get(0);
        EditManager manager = (EditManager) layer.getMap().getEditManager();
        //wrapper/decorator
        FeatureStore<SimpleFeatureType, SimpleFeature> store = layer.getResource(FeatureStore.class, new NullProgressMonitor());
        //we are in read mode, so the wrapper doesn't delegate to the transaction
        assertTrue(store.getTransaction() == Transaction.AUTO_COMMIT);
        //read, bounds doesn't start a transaction
        store.getBounds();
        assertTrue(store.getTransaction() == Transaction.AUTO_COMMIT);
        //start editing
        store.removeFeatures(Filter.EXCLUDE);
        assertTrue(store.getTransaction() != Transaction.AUTO_COMMIT);
        //read keeps transaction open
        store.getFeatures();
        assertTrue(store.getTransaction() != Transaction.AUTO_COMMIT);
        //rollback stops
        manager.rollbackTransaction();
        assertTrue(store.getTransaction() == Transaction.AUTO_COMMIT);
        //remove starts again
        store.removeFeatures(Filter.INCLUDE);
        assertTrue(store.getTransaction() != Transaction.AUTO_COMMIT);
        //done
        manager.commitTransaction();
        assertTrue(store.getTransaction() == Transaction.AUTO_COMMIT);
    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.EditManager

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.