Skip to content

Package: IDEViewModelRegistry

IDEViewModelRegistry

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.ide.view.service;
15:
16: import java.io.IOException;
17:
18: import org.eclipse.emf.ecp.view.spi.model.VView;
19:
20: /**
21: * The View Model registry handling the update of open view model editors.
22: *
23: * @author Eugen Neufeld
24: *
25: */
26: public interface IDEViewModelRegistry {
27:
28:         /**
29:          * Register an ECore with a VView.
30:          *
31:          * @param ecorePath the path to the ECore connected to the VView
32:          * @param viewModel the VView
33:          */
34:         void register(String ecorePath, VView viewModel);
35:
36:         /**
37:          * Unregister a VView from an ECore. eg when the root class changes.
38:          *
39:          * @param registeredEcorePath the path to the ECore connected to the VView
40:          * @param viewModel the VView
41:          */
42:         void unregister(String registeredEcorePath, VView viewModel);
43:
44:         /**
45:          * Register a view model editor with a view.
46:          *
47:          * @param viewModel the VView
48:          * @param viewModelEditor the view model editor
49:          * @throws IOException if a resource cannot be loaded
50:          */
51:         void registerViewModelEditor(VView viewModel, ViewModelEditorCallback viewModelEditor) throws IOException;
52:
53:         /**
54:          * Unregister a view model editor, called when the view model editor closes.
55:          *
56:          * @param viewModel the VView
57:          * @param viewModelEditor the view model editor
58:          */
59:         void unregisterViewModelEditor(VView viewModel, ViewModelEditorCallback viewModelEditor);
60:
61:         /**
62:          * Register a view with its absolute path.
63:          *
64:          * @param view the VView
65:          * @param viewPath the path to the view file
66:          */
67:         void registerViewModel(VView view, String viewPath);
68: }