Skip to content

Package: ECPApplicableTester

ECPApplicableTester

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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: * Eugen Neufeld - initial API and implementation
13: *
14: *******************************************************************************/
15: package org.eclipse.emf.ecp.edit.spi.util;
16:
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.emf.ecore.EStructuralFeature;
19: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
20: import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
21:
22: /**
23: * This interface defines a {@link #isApplicable(IItemPropertyDescriptor, EObject)} method which is used to determine
24: * the priority of a control. The control with the highest priority for a combination of an {@link EObject} and a
25: * feature will be used.
26: *
27: * @author Eugen Neufeld
28: *
29: */
30: @Deprecated
31: public interface ECPApplicableTester {
32:         /**
33:          * Return this whenever the control should not be drawn for the tested feature.
34:          */
35:         int NOT_APPLICABLE = -1;
36:
37:         /**
38:          * Returns the priority of the corresponding control for the combination of the {@link EObject} and the
39:          * {@link IItemPropertyDescriptor}.
40:          *
41:          * @param itemPropertyDescriptor the {@link IItemPropertyDescriptor} to test
42:          * @param eObject the {@link EObject} to test
43:          * @return {@link #NOT_APPLICABLE} if the corresponding control should not be used, a positivie integer value
44:          * otherwise. The control with the highest priority will be taken.
45:          */
46:         @Deprecated
47:         int isApplicable(IItemPropertyDescriptor itemPropertyDescriptor, EObject eObject);
48:
49:         /**
50:          * Returns the priority of the corresponding control for the provided {@link VDomainModelReference}.
51:          *
52:          * @param domainModelReference the {@link VDomainModelReference} to test
53:          * @return {@link #NOT_APPLICABLE} if the corresponding control should not be used, a positivie integer value
54:          * otherwise. The control with the highest priority will be taken.
55:          * @since 1.2
56:          * @deprecated Do not use. Use {@link #isApplicable(EObject, EStructuralFeature)} instead.
57:          */
58:         @Deprecated
59:         int isApplicable(VDomainModelReference domainModelReference);
60:
61:         /**
62:          * Returns the priority of the corresponding control for the combination of the {@link EObject} and the
63:          * {@link EStructuralFeature}.
64:          *
65:          * @param eStructuralFeature the {@link EStructuralFeature} to test
66:          * @param eObject the {@link EObject} to test
67:          * @return {@link #NOT_APPLICABLE} if the corresponding control should not be used, a positivie integer value
68:          * otherwise. The control with the highest priority will be taken.
69:          * @since 1.2
70:          */
71:         int isApplicable(EObject eObject, EStructuralFeature eStructuralFeature);
72: }