|
|
@@ -10,19 +10,12 @@
|
|
|
*/
|
|
|
package org.yakindu.sct.model.sgraph.resource.provider;
|
|
|
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
import org.eclipse.emf.ecore.EObject;
|
|
|
import org.eclipse.emf.ecore.util.EcoreUtil;
|
|
|
-import org.eclipse.xtext.naming.QualifiedName;
|
|
|
-import org.eclipse.xtext.resource.EObjectDescription;
|
|
|
import org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy;
|
|
|
import org.eclipse.xtext.resource.IEObjectDescription;
|
|
|
import org.eclipse.xtext.resource.impl.DefaultResourceDescriptionStrategy;
|
|
|
import org.eclipse.xtext.util.IAcceptor;
|
|
|
-import org.yakindu.base.types.ComplexType;
|
|
|
-import org.yakindu.base.types.TypedElement;
|
|
|
import org.yakindu.sct.model.sgraph.Statechart;
|
|
|
|
|
|
/**
|
|
|
@@ -32,39 +25,15 @@ import org.yakindu.sct.model.sgraph.Statechart;
|
|
|
* @author andreas muelder - Initial contribution and API
|
|
|
*
|
|
|
*/
|
|
|
-public class SCTResourceDescriptionStrategy extends
|
|
|
- DefaultResourceDescriptionStrategy {
|
|
|
+public class SCTResourceDescriptionStrategy extends DefaultResourceDescriptionStrategy {
|
|
|
|
|
|
public static final String IS_COMPLEX_TYPE = "IS_COMPLEX_TYPE";
|
|
|
|
|
|
@Override
|
|
|
- public boolean createEObjectDescriptions(EObject eObject,
|
|
|
- IAcceptor<IEObjectDescription> acceptor) {
|
|
|
+ public boolean createEObjectDescriptions(EObject eObject, IAcceptor<IEObjectDescription> acceptor) {
|
|
|
if (EcoreUtil.getRootContainer(eObject) instanceof Statechart)
|
|
|
- return createDescriptions(eObject, acceptor);
|
|
|
+ return super.createEObjectDescriptions(eObject, acceptor);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- protected boolean createDescriptions(EObject eObject,
|
|
|
- IAcceptor<IEObjectDescription> acceptor) {
|
|
|
- if (getQualifiedNameProvider() == null)
|
|
|
- return false;
|
|
|
- try {
|
|
|
- QualifiedName qualifiedName = getQualifiedNameProvider()
|
|
|
- .getFullyQualifiedName(eObject);
|
|
|
- if (qualifiedName != null) {
|
|
|
- Map<String, String> userData = new HashMap<String, String>();
|
|
|
-// if (eObject instanceof TypedElement
|
|
|
-// && ((TypedElement) eObject).getType() instanceof ComplexType) {
|
|
|
- userData.put(IS_COMPLEX_TYPE, "true");
|
|
|
-// }
|
|
|
- acceptor.accept(EObjectDescription.create(qualifiedName,
|
|
|
- eObject, userData));
|
|
|
- }
|
|
|
- } catch (Exception exc) {
|
|
|
- exc.printStackTrace();
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
}
|