public static class ViewModelHelper.ViewLoader extends Object
Constructor and Description |
---|
ViewLoader() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
ecoreExistsInWorkspace(String ecorePath)
Indicates whether the Ecore denoted by the path exists in the workspace.
|
protected String |
getPath(org.eclipse.core.resources.IFile file)
Returns the path string of the given file.
|
protected ReportService |
getReportService()
Returns the service used for error reporting.
|
protected Optional<String> |
getViewName(VView view)
Determines a name for the given view.
|
protected String |
getViewNameAndLocation(VView view,
String viewLocation)
Returns a string representation of the view and its location.
|
VView |
loadView(org.eclipse.core.resources.IFile file,
Collection<String> registeredEcores)
Loads the view denoted by the given file.
|
protected VView |
loadView(String path)
Loads the view denoted by the given path.
|
protected void |
registerEcore(String ecorePath)
Try to register the Ecore denoted by the path.
|
protected void |
registerReferencedEcores(VView view,
String viewLocation,
Collection<String> registeredEcores)
Registers the referenced Ecores of the given view.
|
public VView loadView(org.eclipse.core.resources.IFile file, Collection<String> registeredEcores) throws IOException
file
- the view to loadregisteredEcores
- a collection to which all Ecores which are successfully registered are added.VView
denoted by the given file.IOException
- if something goes wrong during loading or registeringprotected String getPath(org.eclipse.core.resources.IFile file)
file
- the IFile
for which the path string shall be determined.protected void registerReferencedEcores(VView view, String viewLocation, Collection<String> registeredEcores) throws IOException
view
- the VView
which possibly references Ecores.viewLocation
- the location of the given view. Used for error reporting.registeredEcores
- a collection to which all Ecores which are successfully registered are added.IOException
- if something goes wrong during loading or registeringprotected String getViewNameAndLocation(VView view, String viewLocation)
view
- the VView
.viewLocation
- the location.protected Optional<String> getViewName(VView view)
view
- the [@link VView}.protected boolean ecoreExistsInWorkspace(String ecorePath)
ecorePath
- the potential path to an Ecoretrue
if an Ecore exists at the path in the workspace, false
otherwise.protected ReportService getReportService()
ReportService
protected void registerEcore(String ecorePath) throws IOException
ecorePath
- the path to the Ecore in the workspace which shall be registered.IOException
- if something goes wrong during registering.Copyright © 2019. All rights reserved.