...
 
Commits (2)
......@@ -23,19 +23,21 @@ import org.eclipse.emf.ecore.resource.Resource;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclResourceFactoryImpl;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseModelLoader;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseModelLoader;
import fr.centralesupelec.edf.riseclipse.util.TextRiseClipseConsole;
public class SclModelLoader extends RiseClipseModelLoader {
public class SclModelLoader extends AbstractRiseClipseModelLoader {
public SclModelLoader( IRiseClipseConsole console ) {
super( console );
reset();
}
@Override
public void reset() {
super.reset();
super.reset( new SclResourceSetImpl( true, console ));
// Register the appropriate resource factory to handle all file
// extensions.
......
......@@ -21,16 +21,15 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl.util;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseResourceSet;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseResourceSetFactory;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseResourceSetFactory;
public class SclResourceSetFactory extends RiseClipseResourceSetFactory {
public class SclResourceSetFactory implements IRiseClipseResourceSetFactory {
/* (non-Javadoc)
* @see fr.centralesupelec.edf.riseclipse.util.RiseClipseResourceSetFactory#createResourceSet()
* @see fr.centralesupelec.edf.riseclipse.util.IRiseClipseResourceSetFactory#createResourceSet()
*/
@Override
public IRiseClipseResourceSet createResourceSet( boolean strictContent, IRiseClipseConsole console ) {
// TODO Auto-generated method stub
return new SclResourceSetImpl( strictContent, console );
}
......
......@@ -28,18 +28,18 @@ import org.eclipse.emf.ecore.resource.Resource;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SCL;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseResourceSet;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseResourceSet;
@SuppressWarnings( "unused" )
public class SclResourceSetImpl extends RiseClipseResourceSet {
public class SclResourceSetImpl extends AbstractRiseClipseResourceSet {
public SclResourceSetImpl( boolean strictContent, IRiseClipseConsole console ) {
super( strictContent, console );
}
/* (non-Javadoc)
* @see fr.centralesupelec.edf.riseclipse.util.RiseClipseResourceSet#finalizeLoad(fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole)
* @see fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseResourceSet#finalizeLoad(fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole)
*/
@Override
public void finalizeLoad( IRiseClipseConsole console ) {
......@@ -48,6 +48,7 @@ public class SclResourceSetImpl extends RiseClipseResourceSet {
private void buildExplicitLinks( IRiseClipseConsole console ) {
for( Resource resource : getResources() ) {
if( resource.getContents().size() == 0 ) continue;
if( resource instanceof SclResourceImpl ) {
SCL scl = ( SCL ) resource.getContents().get( 0 );
scl.buildExplicitLinks( console, false );
......