Commit 819e247c authored by Dominique Marcadet's avatar Dominique Marcadet

Merge branch '31-models-loaders-should-be-with-their-metamodels' into 'master'

Resolve "Models loaders should be with their metamodels"

Closes #31

See merge request RiseClipseGroup/RiseClipseMetamodel_SCL2003!26
parents 5a0f067d c5fea4df
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fr.centralesupelec.edf.riseclipse.iec61850.scl.utilities</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: fr.centralesupelec.edf.riseclipse.iec61850.scl.utilities
Bundle-Version: 1.0.2.qualifier
Automatic-Module-Name: fr.centralesupelec.edf.riseclipse.iec61850.scl.utilities
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.emf.ecore,
fr.centralesupelec.edf.riseclipse.iec61850.scl,
fr.centralesupelec.edf.riseclipse.main
Export-Package: fr.centralesupelec.edf.riseclipse.iec61850.scl.utilities
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
# Copyright (c) 2019 CentraleSuplec & EDF.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# This file is part of the RiseClipse tool
#
# Contributors:
# Computer Science Department, CentraleSuplec
# EDF R&D
# Contacts:
# dominique.marcadet@centralesupelec.fr
# aurelie.dehouck-neveu@edf.fr
# Web site:
# http://wdi.supelec.fr/software/RiseClipse/
pluginName = RiseClipse IEC 61850 SCL Utilities
providerName = CentraleSuplec & EDF
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.centralesupelec.edf.riseclipse</groupId>
<artifactId>fr.centralesupelec.edf.riseclipse.iec61850.scl.utilities</artifactId>
<version>1.0.2-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<parent>
<groupId>fr.centralesupelec.edf.riseclipse</groupId>
<artifactId>RiseClipseMetamodel_SCL2003</artifactId>
<version>1.0.2-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<!-- This needed parameter seems to be ignored if put in the pom root file -->
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
</plugins>
</build>
</project>
/**
* Copyright (c) 2018 CentraleSupélec & EDF.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* This file is part of the RiseClipse tool
*
* Contributors:
* Computer Science Department, CentraleSupélec
* EDF R&D
* Contacts:
* dominique.marcadet@centralesupelec.fr
* aurelie.dehouck-neveu@edf.fr
* Web site:
* http://wdi.supelec.fr/software/RiseClipse/
*/
package fr.centralesupelec.edf.riseclipse.iec61850.scl.utilities;
import org.eclipse.emf.ecore.EValidator;
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.util.IRiseClipseConsole;
import fr.centralesupelec.edf.riseclipse.util.RiseClipseModelLoader;
import fr.centralesupelec.edf.riseclipse.util.TextRiseClipseConsole;
public class SclModelLoader extends RiseClipseModelLoader {
public SclModelLoader( IRiseClipseConsole console ) {
super( console );
}
@Override
public void reset() {
super.reset();
// Register the appropriate resource factory to handle all file
// extensions.
getResourceSet().getResourceFactoryRegistry().getExtensionToFactoryMap()
.put( Resource.Factory.Registry.DEFAULT_EXTENSION, new SclResourceFactoryImpl() );
// Register the package to ensure it is available during loading.
getResourceSet().getPackageRegistry().put( SclPackage.eNS_URI, SclPackage.eINSTANCE );
}
public Resource loadWithoutValidation( String name ) {
Object eValidator = EValidator.Registry.INSTANCE.remove( SclPackage.eINSTANCE );
Resource resource = load( name );
if( eValidator != null ) {
EValidator.Registry.INSTANCE.put( SclPackage.eINSTANCE, eValidator );
}
return resource;
}
public static void main( String[] args ) {
IRiseClipseConsole console = new TextRiseClipseConsole();
SclModelLoader loader = new SclModelLoader( console );
for( int i = 0; i < args.length; ++i ) {
@SuppressWarnings( "unused" )
Resource resource = loader.load( args[i] );
}
}
}
......@@ -23,6 +23,7 @@
<modules>
<module>fr.centralesupelec.edf.riseclipse.iec61850.scl</module>
<module>fr.centralesupelec.edf.riseclipse.iec61850.scl.edit</module>
<module>fr.centralesupelec.edf.riseclipse.iec61850.scl.utilities</module>
</modules>
</project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment