org.eclipse.emf.ecp.ide.view.service
Interface IDEViewModelRegistry

All Known Implementing Classes:
IDEViewModelRegistryImpl

public interface IDEViewModelRegistry

The View Model registry handling the update of open view model editors.

Author:
Eugen Neufeld

Method Summary
 VView createViewModel(org.eclipse.core.resources.IFile modelFile, org.eclipse.emf.ecore.EClass selectedEClass, org.eclipse.core.resources.IFile selectedEcore)
          Creates a new view model file.
 void register(String ecorePath, VView viewModel)
          Register an ECore with a VView.
 void registerViewModel(VView view, String viewPath)
          Register a view with its absolute path.
 void registerViewModelEditor(VView viewModel, ViewModelEditorCallback viewModelEditor)
          Register a view model editor with a view.
 void unregister(String registeredEcorePath, VView viewModel)
          Unregister a VView from an ECore.
 void unregisterViewModelEditor(VView viewModel, ViewModelEditorCallback viewModelEditor)
          Unregister a view model editor, called when the view model editor closes.
 

Method Detail

register

void register(String ecorePath,
              VView viewModel)
Register an ECore with a VView.

Parameters:
ecorePath - the path to the ECore connected to the VView
viewModel - the VView

unregister

void unregister(String registeredEcorePath,
                VView viewModel)
Unregister a VView from an ECore. eg when the root class changes.

Parameters:
registeredEcorePath - the path to the ECore connected to the VView
viewModel - the VView

registerViewModelEditor

void registerViewModelEditor(VView viewModel,
                             ViewModelEditorCallback viewModelEditor)
                             throws IOException
Register a view model editor with a view.

Parameters:
viewModel - the VView
viewModelEditor - the view model editor
Throws:
IOException - if a resource cannot be loaded

unregisterViewModelEditor

void unregisterViewModelEditor(VView viewModel,
                               ViewModelEditorCallback viewModelEditor)
Unregister a view model editor, called when the view model editor closes.

Parameters:
viewModel - the VView
viewModelEditor - the view model editor

registerViewModel

void registerViewModel(VView view,
                       String viewPath)
Register a view with its absolute path.

Parameters:
view - the VView
viewPath - the path to the view file

createViewModel

VView createViewModel(org.eclipse.core.resources.IFile modelFile,
                      org.eclipse.emf.ecore.EClass selectedEClass,
                      org.eclipse.core.resources.IFile selectedEcore)
                      throws IOException
Creates a new view model file.

Parameters:
modelFile - the file in which the view should be saved
selectedEClass - the Root EClass for the new VView
selectedEcore - the ecore containing the selectedEClass
Returns:
the newly created VView
Throws:
IOException - when something goes wrong while loading or saving the resource


Copyright © 2014. All Rights Reserved.