...
 
Commits (2)
...@@ -24,20 +24,17 @@ import org.eclipse.emf.ecore.resource.Resource; ...@@ -24,20 +24,17 @@ import org.eclipse.emf.ecore.resource.Resource;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage; 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.SclResourceFactoryImpl;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclResourceSetImpl; import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclResourceSetImpl;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseConsole; import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseModelLoader; import fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseModelLoader;
import fr.centralesupelec.edf.riseclipse.util.TextRiseClipseConsole;
public class SclModelLoader extends AbstractRiseClipseModelLoader { public class SclModelLoader extends AbstractRiseClipseModelLoader {
public SclModelLoader( IRiseClipseConsole console ) { public SclModelLoader() {
super( console );
reset(); reset();
} }
public void reset() { public void reset() {
super.reset( new SclResourceSetImpl( false, console )); super.reset( new SclResourceSetImpl( false ));
// Register the appropriate resource factory to handle all file // Register the appropriate resource factory to handle all file
// extensions. // extensions.
...@@ -51,7 +48,7 @@ public class SclModelLoader extends AbstractRiseClipseModelLoader { ...@@ -51,7 +48,7 @@ public class SclModelLoader extends AbstractRiseClipseModelLoader {
public Resource loadWithoutValidation( String name ) { public Resource loadWithoutValidation( String name ) {
Object eValidator = EValidator.Registry.INSTANCE.remove( SclPackage.eINSTANCE ); Object eValidator = EValidator.Registry.INSTANCE.remove( SclPackage.eINSTANCE );
Resource resource = load( name ); Resource resource = load( name, AbstractRiseClipseConsole.getConsole() );
if( eValidator != null ) { if( eValidator != null ) {
EValidator.Registry.INSTANCE.put( SclPackage.eINSTANCE, eValidator ); EValidator.Registry.INSTANCE.put( SclPackage.eINSTANCE, eValidator );
...@@ -60,12 +57,11 @@ public class SclModelLoader extends AbstractRiseClipseModelLoader { ...@@ -60,12 +57,11 @@ public class SclModelLoader extends AbstractRiseClipseModelLoader {
} }
public static void main( String[] args ) { public static void main( String[] args ) {
IRiseClipseConsole console = new TextRiseClipseConsole(); SclModelLoader loader = new SclModelLoader();
SclModelLoader loader = new SclModelLoader( console );
for( int i = 0; i < args.length; ++i ) { for( int i = 0; i < args.length; ++i ) {
@SuppressWarnings( "unused" ) @SuppressWarnings( "unused" )
Resource resource = loader.load( args[i] ); Resource resource = loader.load( args[i], AbstractRiseClipseConsole.getConsole() );
} }
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
*/ */
package fr.centralesupelec.edf.riseclipse.iec61850.scl.util; 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.IRiseClipseResourceSet;
import fr.centralesupelec.edf.riseclipse.util.IRiseClipseResourceSetFactory; import fr.centralesupelec.edf.riseclipse.util.IRiseClipseResourceSetFactory;
...@@ -29,8 +28,8 @@ public class SclResourceSetFactory implements IRiseClipseResourceSetFactory { ...@@ -29,8 +28,8 @@ public class SclResourceSetFactory implements IRiseClipseResourceSetFactory {
* @see fr.centralesupelec.edf.riseclipse.util.IRiseClipseResourceSetFactory#createResourceSet() * @see fr.centralesupelec.edf.riseclipse.util.IRiseClipseResourceSetFactory#createResourceSet()
*/ */
@Override @Override
public IRiseClipseResourceSet createResourceSet( boolean strictContent, IRiseClipseConsole console ) { public IRiseClipseResourceSet createResourceSet( boolean strictContent ) {
return new SclResourceSetImpl( strictContent, console ); return new SclResourceSetImpl( strictContent );
} }
} }
...@@ -42,8 +42,8 @@ public class SclResourceSetImpl extends AbstractRiseClipseResourceSet { ...@@ -42,8 +42,8 @@ public class SclResourceSetImpl extends AbstractRiseClipseResourceSet {
private SclResourceFactoryImpl resourceFactory; private SclResourceFactoryImpl resourceFactory;
public SclResourceSetImpl( boolean strictContent, IRiseClipseConsole console ) { public SclResourceSetImpl( boolean strictContent ) {
super( strictContent, console ); super( strictContent );
resourceFactory = new SclResourceFactoryImpl(); resourceFactory = new SclResourceFactoryImpl();
} }
......