org.eclipse.emf.ecp.edit.spi.util
Class ECPStaticApplicableTester

java.lang.Object
  extended by org.eclipse.emf.ecp.edit.spi.util.ECPStaticApplicableTester
All Implemented Interfaces:
ECPApplicableTester

public final class ECPStaticApplicableTester
extends Object
implements ECPApplicableTester

The implementation of the ECPApplicableTester for a static test, like defined in the staticTest element.

Author:
Eugen Neufeld

Field Summary
 
Fields inherited from interface org.eclipse.emf.ecp.edit.spi.util.ECPApplicableTester
NOT_APPLICABLE
 
Constructor Summary
ECPStaticApplicableTester(boolean singleValue, int priority, Class<?> supportedClassType, Class<? extends org.eclipse.emf.ecore.EObject> supportedEObject, String supportedFeature)
          The constructor of the static tester.
 
Method Summary
 int getPriority()
          The static priority of the corresponding control.
 Class<?> getSupportedClassType()
          The class of the type the corresponding control supports.
 Class<? extends org.eclipse.emf.ecore.EObject> getSupportedEObject()
          The eobejct which is supported by the corresponding control.
 String getSupportedFeature()
          The name of the feature the corresponding control supports.
 int isApplicable(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature feature)
          Returns the priority of the corresponding control for the combination of the EObject and the EStructuralFeature.
 int isApplicable(org.eclipse.emf.edit.provider.IItemPropertyDescriptor itemPropertyDescriptor, org.eclipse.emf.ecore.EObject eObject)
          Deprecated. 
 int isApplicable(VDomainModelReference domainModelReference)
          Returns the priority of the corresponding control for the provided VDomainModelReference.
 boolean isSingleValue()
          Whether the corresponding control is allowed only for single values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECPStaticApplicableTester

public ECPStaticApplicableTester(boolean singleValue,
                                 int priority,
                                 Class<?> supportedClassType,
                                 Class<? extends org.eclipse.emf.ecore.EObject> supportedEObject,
                                 String supportedFeature)
The constructor of the static tester.

Parameters:
singleValue - whether the corresponding control supports only single valued features
priority - the static priority
supportedClassType - the class of the supported type
supportedEObject - the eobject this tester allows
supportedFeature - the feature this tester allows
Method Detail

isApplicable

@Deprecated
public int isApplicable(org.eclipse.emf.edit.provider.IItemPropertyDescriptor itemPropertyDescriptor,
                                   org.eclipse.emf.ecore.EObject eObject)
Deprecated. 

Returns the priority of the corresponding control for the combination of the EObject and the IItemPropertyDescriptor.

Specified by:
isApplicable in interface ECPApplicableTester
Parameters:
itemPropertyDescriptor - the IItemPropertyDescriptor to test
eObject - the EObject to test
Returns:
ECPApplicableTester.NOT_APPLICABLE if the corresponding control should not be used, a positivie integer value otherwise. The control with the highest priority will be taken.

isApplicable

public int isApplicable(VDomainModelReference domainModelReference)
Returns the priority of the corresponding control for the provided VDomainModelReference.

Specified by:
isApplicable in interface ECPApplicableTester
Parameters:
domainModelReference - the VDomainModelReference to test
Returns:
ECPApplicableTester.NOT_APPLICABLE if the corresponding control should not be used, a positivie integer value otherwise. The control with the highest priority will be taken.
Since:
1.2
See Also:
ECPApplicableTester.isApplicable(org.eclipse.emf.ecp.view.spi.model.VDomainModelReference)

isApplicable

public int isApplicable(org.eclipse.emf.ecore.EObject eObject,
                        org.eclipse.emf.ecore.EStructuralFeature feature)
Returns the priority of the corresponding control for the combination of the EObject and the EStructuralFeature.

Specified by:
isApplicable in interface ECPApplicableTester
Parameters:
eObject - the EObject to test
feature - the EStructuralFeature to test
Returns:
ECPApplicableTester.NOT_APPLICABLE if the corresponding control should not be used, a positivie integer value otherwise. The control with the highest priority will be taken.
Since:
1.2
See Also:
ECPApplicableTester.isApplicable(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature)

isSingleValue

public boolean isSingleValue()
Whether the corresponding control is allowed only for single values.

Returns:
true if only a single value is allows

getPriority

public int getPriority()
The static priority of the corresponding control.

Returns:
the priority

getSupportedEObject

public Class<? extends org.eclipse.emf.ecore.EObject> getSupportedEObject()
The eobejct which is supported by the corresponding control.

Returns:
the class of the supported eobejct

getSupportedFeature

public String getSupportedFeature()
The name of the feature the corresponding control supports.

Returns:
the name of the supported feature

getSupportedClassType

public Class<?> getSupportedClassType()
The class of the type the corresponding control supports.

Returns:
the class of the supported type


Copyright © 2014. All Rights Reserved.