Package: ECPLegacyControlSWTRendererTester
ECPLegacyControlSWTRendererTester
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ECPLegacyControlSWTRendererTester() |
|
|
|
|
|
||||||||||||||||||||
isApplicable(VElement, ViewModelContext) |
|
|
|
|
|
Coverage
1: /*******************************************************************************
2: * Copyright (c) 2011-2016 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.core.swt.renderer;
15:
16: import org.eclipse.emf.ecp.view.model.common.ECPRendererTester;
17: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
18: import org.eclipse.emf.ecp.view.spi.model.VControl;
19: import org.eclipse.emf.ecp.view.spi.model.VElement;
20:
21: /**
22: * Mimics the behaviour for a static tester checking for {@link VControl} + an additional check for an existing DMR.
23: *
24: * @author Johannes Faltermeier
25: *
26: */
27: @Deprecated
28: public class ECPLegacyControlSWTRendererTester implements ECPRendererTester {
29:
30:         @Override
31:         public int isApplicable(VElement vElement, ViewModelContext viewModelContext) {
32:•                if (!VControl.class.isInstance(vElement)) {
33:                         return NOT_APPLICABLE;
34:                 }
35:•                if (VControl.class.cast(vElement).getDomainModelReference() == null) {
36:                         return NOT_APPLICABLE;
37:                 }
38:                 return 1;
39:         }
40:
41: }