Skip to content

Package: EclipseContextViewService

EclipseContextViewService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 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: * jfaltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.model.common.di.service;
15:
16: import org.eclipse.e4.core.contexts.IEclipseContext;
17: import org.eclipse.emf.ecp.view.spi.context.ViewModelService;
18: import org.eclipse.emf.ecp.view.spi.model.VElement;
19:
20: /**
21: * {@link ViewModelService} for registering and retrieving the {@link IEclipseContext} associated with a view.
22: *
23: * @author jfaltermeier
24: *
25: */
26: public interface EclipseContextViewService extends ViewModelService {
27:
28:         /**
29:          * Sets the context for the {@link VElement}.
30:          *
31:          * @param element the element associated with the context
32:          * @param context the {@link IEclipseContext}.
33:          */
34:         void putContext(VElement element, IEclipseContext context);
35:
36:         /**
37:          * Returns the context associated with the given {@link VElement}.
38:          *
39:          * @param element the element for which the {@link IEclipseContext} is to be returned.
40:          *
41:          * @return the {@link IEclipseContext}
42:          */
43:         IEclipseContext getContext(VElement element);
44:
45: }