adjusted legal info, refactoring
diff --git a/org.eclipse.osbp.xtext.cubedsl.feature/feature.xml b/org.eclipse.osbp.xtext.cubedsl.feature/feature.xml
index 47d3f50..6180d40 100644
--- a/org.eclipse.osbp.xtext.cubedsl.feature/feature.xml
+++ b/org.eclipse.osbp.xtext.cubedsl.feature/feature.xml
@@ -15,7 +15,7 @@
label="%featureName"
version="0.9.0.qualifier"
provider-name="%providerName"
- plugin="org.eclipse.osbp.xtext.cubedsl">
+ plugin="org.eclipse.osbp.license">
<description>
%description
diff --git a/org.eclipse.osbp.xtext.cubedsl/emf-gen/org/eclipse/osbp/xtext/cubedsl/CubeDSLPackage.java b/org.eclipse.osbp.xtext.cubedsl/emf-gen/org/eclipse/osbp/xtext/cubedsl/CubeDSLPackage.java
index 110e629..13aad5a 100644
--- a/org.eclipse.osbp.xtext.cubedsl/emf-gen/org/eclipse/osbp/xtext/cubedsl/CubeDSLPackage.java
+++ b/org.eclipse.osbp.xtext.cubedsl/emf-gen/org/eclipse/osbp/xtext/cubedsl/CubeDSLPackage.java
@@ -230,7 +230,7 @@
* @generated
* @ordered
*/
- int CUBE_PACKAGE___ERESOLVE_PROXY__OBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
+ int CUBE_PACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
/**
* The number of operations of the '<em>Cube Package</em>' class.
diff --git a/org.eclipse.osbp.xtext.cubedsl/src-gen/org/eclipse/osbp/xtext/cubedsl/parser/antlr/internal/InternalCubeDSLLexer.java b/org.eclipse.osbp.xtext.cubedsl/src-gen/org/eclipse/osbp/xtext/cubedsl/parser/antlr/internal/InternalCubeDSLLexer.java
index 0b19895..cfc8c64 100644
--- a/org.eclipse.osbp.xtext.cubedsl/src-gen/org/eclipse/osbp/xtext/cubedsl/parser/antlr/internal/InternalCubeDSLLexer.java
+++ b/org.eclipse.osbp.xtext.cubedsl/src-gen/org/eclipse/osbp/xtext/cubedsl/parser/antlr/internal/InternalCubeDSLLexer.java
@@ -1,3 +1,17 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * 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
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+
package org.eclipse.osbp.xtext.cubedsl.parser.antlr.internal;
// Hack: Use our own Lexer superclass by means of import.
@@ -5260,4 +5274,4 @@
}
-}
\ No newline at end of file
+}
diff --git a/org.eclipse.osbp.xtext.cubedsl/src/org/eclipse/osbp/xtext/cubedsl/scoping/CubeDSLScopeProvider.xtend b/org.eclipse.osbp.xtext.cubedsl/src/org/eclipse/osbp/xtext/cubedsl/scoping/CubeDSLScopeProvider.xtend
index 454982d..070aa6f 100644
--- a/org.eclipse.osbp.xtext.cubedsl/src/org/eclipse/osbp/xtext/cubedsl/scoping/CubeDSLScopeProvider.xtend
+++ b/org.eclipse.osbp.xtext.cubedsl/src/org/eclipse/osbp/xtext/cubedsl/scoping/CubeDSLScopeProvider.xtend
@@ -42,6 +42,8 @@
import org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImpl
import org.eclipse.xtext.scoping.IScope
import org.eclipse.xtext.scoping.Scopes
+import javax.inject.Inject
+import org.eclipse.osbp.dsl.common.xtext.extensions.ModelExtensions
/**
* This class contains custom scoping description.
@@ -52,7 +54,8 @@
*/
//class CubeDSLScopeProvider extends AbstractDeclarativeScopeProvider {
class CubeDSLScopeProvider extends AbstractCubeDSLScopeProvider /*XbaseWithAnnotationsScopeProvider*/ {
-
+ @Inject extension ModelExtensions
+
@Override
override IScope getScope(EObject context, EReference reference) {
if (reference == CubeDSLPackage.Literals.CUBE_DIMENSION_ENTITY_ENTITY__OVER_VALUE) {
@@ -163,7 +166,7 @@
} else {
for (LEntityAttribute entityAttr : cubeEnt.allAttributes) {
if (entityAttr.type !== null && entityAttr.entity.isNormalAttribute(entityAttr) &&
- (entityAttr.type instanceof LDataType) && (entityAttr.type as LDataType).isNumeric) {
+ entityAttr.type instanceof LDataType && isNumericOrWrapperType(entityAttr.type as LDataType)) {
result.add(entityAttr)
}
}
@@ -172,31 +175,6 @@
return Scopes.scopeFor(result)
}
- def boolean isNumeric(LDataType type) {
- val JvmParameterizedTypeReferenceImpl typeRef = type.jvmTypeReference as JvmParameterizedTypeReferenceImpl
- if (typeRef !== null) {
- var typeIdentifier = ""
- if (typeRef.basicGetType().eIsProxy && (typeRef.basicGetType() instanceof InternalEObject)) {
- typeIdentifier = (typeRef.basicGetType() as InternalEObject).eProxyURI.fragment
- } else {
- typeIdentifier = typeRef.identifier
- }
- switch (typeIdentifier) {
- case Short.typeName,
- case Integer.typeName,
- case Long.typeName,
- case Double.typeName,
- case Float.typeName: {
- return true
- }
- default: {
- return false
- }
- }
- }
- return false
- }
-
def IScope getScope_CubeEntityColRef(EObject context) {
var result = <EObject>newArrayList
var eObj = context
diff --git a/org.eclipse.osbp.xtext.cubedsl/xtend-gen/org/eclipse/osbp/xtext/cubedsl/scoping/CubeDSLScopeProvider.java b/org.eclipse.osbp.xtext.cubedsl/xtend-gen/org/eclipse/osbp/xtext/cubedsl/scoping/CubeDSLScopeProvider.java
index a4ebc1c..769dc9f 100644
--- a/org.eclipse.osbp.xtext.cubedsl/xtend-gen/org/eclipse/osbp/xtext/cubedsl/scoping/CubeDSLScopeProvider.java
+++ b/org.eclipse.osbp.xtext.cubedsl/xtend-gen/org/eclipse/osbp/xtext/cubedsl/scoping/CubeDSLScopeProvider.java
@@ -19,10 +19,11 @@
import com.google.common.base.Objects;
import java.util.ArrayList;
import java.util.List;
+import javax.inject.Inject;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.osbp.dsl.common.xtext.extensions.ModelExtensions;
import org.eclipse.osbp.dsl.semantic.common.types.LDataType;
import org.eclipse.osbp.dsl.semantic.entity.LEntity;
import org.eclipse.osbp.dsl.semantic.entity.LEntityAttribute;
@@ -40,12 +41,10 @@
import org.eclipse.osbp.xtext.cubedsl.CubePackage;
import org.eclipse.osbp.xtext.cubedsl.CubeTypeEntity;
import org.eclipse.osbp.xtext.cubedsl.scoping.AbstractCubeDSLScopeProvider;
-import org.eclipse.xtext.common.types.JvmType;
-import org.eclipse.xtext.common.types.JvmTypeReference;
-import org.eclipse.xtext.common.types.impl.JvmParameterizedTypeReferenceImpl;
import org.eclipse.xtext.scoping.IScope;
import org.eclipse.xtext.scoping.Scopes;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.Extension;
/**
* This class contains custom scoping description.
@@ -55,6 +54,10 @@
*/
@SuppressWarnings("all")
public class CubeDSLScopeProvider extends AbstractCubeDSLScopeProvider {
+ @Inject
+ @Extension
+ private ModelExtensions _modelExtensions;
+
@Override
public IScope getScope(final EObject context, final EReference reference) {
boolean _equals = Objects.equal(reference, CubeDSLPackage.Literals.CUBE_DIMENSION_ENTITY_ENTITY__OVER_VALUE);
@@ -186,7 +189,8 @@
} else {
List<LEntityAttribute> _allAttributes = cubeEnt.getAllAttributes();
for (final LEntityAttribute entityAttr : _allAttributes) {
- if (((((entityAttr.getType() != null) && entityAttr.getEntity().isNormalAttribute(entityAttr)) && (entityAttr.getType() instanceof LDataType)) && this.isNumeric(((LDataType) entityAttr.getType())))) {
+ if (((((entityAttr.getType() != null) && entityAttr.getEntity().isNormalAttribute(entityAttr)) &&
+ (entityAttr.getType() instanceof LDataType)) && this._modelExtensions.isNumericOrWrapperType(((LDataType) entityAttr.getType())))) {
result.add(entityAttr);
}
}
@@ -195,54 +199,6 @@
return Scopes.scopeFor(result);
}
- public boolean isNumeric(final LDataType type) {
- JvmTypeReference _jvmTypeReference = type.getJvmTypeReference();
- final JvmParameterizedTypeReferenceImpl typeRef = ((JvmParameterizedTypeReferenceImpl) _jvmTypeReference);
- if ((typeRef != null)) {
- String typeIdentifier = "";
- if ((typeRef.basicGetType().eIsProxy() && (typeRef.basicGetType() instanceof InternalEObject))) {
- JvmType _basicGetType = typeRef.basicGetType();
- typeIdentifier = ((InternalEObject) _basicGetType).eProxyURI().fragment();
- } else {
- typeIdentifier = typeRef.getIdentifier();
- }
- boolean _matched = false;
- String _typeName = Short.class.getTypeName();
- if (Objects.equal(typeIdentifier, _typeName)) {
- _matched=true;
- }
- if (!_matched) {
- String _typeName_1 = Integer.class.getTypeName();
- if (Objects.equal(typeIdentifier, _typeName_1)) {
- _matched=true;
- }
- }
- if (!_matched) {
- String _typeName_2 = Long.class.getTypeName();
- if (Objects.equal(typeIdentifier, _typeName_2)) {
- _matched=true;
- }
- }
- if (!_matched) {
- String _typeName_3 = Double.class.getTypeName();
- if (Objects.equal(typeIdentifier, _typeName_3)) {
- _matched=true;
- }
- }
- if (!_matched) {
- String _typeName_4 = Float.class.getTypeName();
- if (Objects.equal(typeIdentifier, _typeName_4)) {
- _matched=true;
- }
- }
- if (_matched) {
- return true;
- }
- return false;
- }
- return false;
- }
-
public IScope getScope_CubeEntityColRef(final EObject context) {
ArrayList<EObject> result = CollectionLiterals.<EObject>newArrayList();
EObject eObj = context;