Skip to content

Package: ECPModelElementOpenTester

ECPModelElementOpenTester

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: package org.eclipse.emf.ecp.ui.util;
15:
16: /**
17: * This interface can be extended in order to provide dynamic testers for the model element opener. So if you want to
18: * check specific information of an EObject aside the EClass you should implement this.
19: *
20: * @author Eugen Neufeld
21: *
22: */
23: public interface ECPModelElementOpenTester {
24:         /**
25:          * Return this whenever the opener can't open a specific element.
26:          */
27:         int NOT_APPLICABLE = -1;
28:
29:         /**
30:          * This is called by the ECPHandlerHelper to check how well the corresponding {@link ECPModelElementOpener} can
31:          * handle
32:          * the current Obejct.
33:          * The Tester with the highest result will be chosen. If the corresponding {@link ECPModelElementOpener} can't
34:          * handle the EObject, the result should be {@link #NOT_APPLICABLE}.
35:          *
36:          * @param eObject the {@link Object} to open
37:          * @return an integer defining how fitting the corresponding opener is.
38:          */
39:         int isApplicable(Object eObject);
40: }