Package: GlobalAdapterFactoryEditingDomainProvider

GlobalAdapterFactoryEditingDomainProvider

nameinstructionbranchcomplexitylinemethod
GlobalAdapterFactoryEditingDomainProvider()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
get()
M: 0 C: 7
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2013 RCP Vision (http://www.rcp-vision.com) and others.
3: * All rights reserved. This program and the accompanying materials
4: * are made available under the terms of the Eclipse Public License v1.0
5: * which accompanies this distribution, and is available at
6: * http://www.eclipse.org/legal/epl-v10.html
7: *
8: * Contributors:
9: * Lorenzo Bettini - initial API and implementation
10: *******************************************************************************/
11: package org.eclipse.emf.parsley.edit.domain;
12:
13: import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
14:
15: /**
16: * This ensures that only one instance of {@link AdapterFactoryEditingDomain}
17: * will be used in the same JVM.
18: *
19: * @author Lorenzo Bettini - Initial contribution and API
20: *
21: */
22: public class GlobalAdapterFactoryEditingDomainProvider extends DefaultAdapterFactoryEditingDomainProvider {
23:
24:         private static AdapterFactoryEditingDomain singleton;
25:
26:         @Override
27:         public AdapterFactoryEditingDomain get() {
28:•                if (singleton == null) {
29:                         singleton = super.get();
30:                 }
31:                 return singleton;
32:         }
33:
34: }