roneditor.model
Class RONModelManager

java.lang.Object
  extended by roneditor.model.RONModelManager

public class RONModelManager
extends java.lang.Object

Manager for persistency operations on the model.

Author:
Tony Modica

Field Summary
private  org.eclipse.emf.ecore.resource.Resource resource
          For the purpose of the simple editor, a file can only contain one RON.
private  org.eclipse.emf.ecore.resource.ResourceSet resourceSet
          The ResourceSet
private  ronmodel.RON ron
          The top level RON in the resource.
private static ronmodel.RonmodelFactory ronmodelFactory
          Contains the factory associated with the model.
 
Constructor Summary
RONModelManager()
          This constructor initializes the EMF model package and registers
 
Method Summary
 ronmodel.RON createDefaultRon(org.eclipse.core.runtime.IPath path)
          Creates a new default RON in a Resource.
private  org.eclipse.emf.ecore.resource.Resource createResource(org.eclipse.core.runtime.IPath path)
           
static ronmodel.RonmodelFactory getFactory()
           
 org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.core.runtime.IPath path)
           
private  org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
           
 ronmodel.RON getRON()
           
 void load(org.eclipse.core.runtime.IPath path)
          Loads the model from the file.
 void reload(org.eclipse.core.runtime.IPath path)
          Reloads the model from the file.
 void save(org.eclipse.core.runtime.IPath path)
          Saves the content of the model to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resource

private org.eclipse.emf.ecore.resource.Resource resource
For the purpose of the simple editor, a file can only contain one RON. In EMF, a Resource provides the way to have access to the model content.


ronmodelFactory

private static ronmodel.RonmodelFactory ronmodelFactory
Contains the factory associated with the model.


ron

private ronmodel.RON ron
The top level RON in the resource.


resourceSet

private org.eclipse.emf.ecore.resource.ResourceSet resourceSet
The ResourceSet

Constructor Detail

RONModelManager

public RONModelManager()
This constructor initializes the EMF model package and registers

Method Detail

getResource

public org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.core.runtime.IPath path)
Parameters:
path - A IPath to a file containing a Resource.
Returns:
The resource containing the RON. This is initialized lazily with the paramter path.

createResource

private org.eclipse.emf.ecore.resource.Resource createResource(org.eclipse.core.runtime.IPath path)
Parameters:
path - A IPath to a file to be created for hosting the Resource.
Returns:
The resource containing the RON. This is initialized lazily with the parameter path.

getResourceSet

private org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
Returns:
The lazily created resourceSet.

getFactory

public static ronmodel.RonmodelFactory getFactory()
Returns:
The factory associated with the model. Object are created using that factory.

createDefaultRon

public ronmodel.RON createDefaultRon(org.eclipse.core.runtime.IPath path)
Creates a new default RON in a Resource.

Parameters:
path - A IPath to a file to be created for hosting the Resource.
Returns:
The newly created RON.

load

public void load(org.eclipse.core.runtime.IPath path)
          throws java.lang.Exception
Loads the model from the file.

Parameters:
path - A IPath to a file containing a Resource.
Throws:
java.io.IOException
java.lang.Exception

reload

public void reload(org.eclipse.core.runtime.IPath path)
            throws java.lang.Exception
Reloads the model from the file.

Parameters:
path - A IPath to a file containing a Resource.
Throws:
java.io.IOException
java.lang.Exception

save

public void save(org.eclipse.core.runtime.IPath path)
          throws java.io.IOException
Saves the content of the model to the file.

Throws:
java.io.IOException

getRON

public ronmodel.RON getRON()
Returns:
The top level RON model from the resource.