Jelajahi Sumber

Merge pull request #403 from Yakindu/issue_393

Added 'visible' flag for Type.
Resolves #393
Thomas Kutz 9 tahun lalu
induk
melakukan
c6e1c8fe0a

File diff ditekan karena terlalu besar
+ 207 - 195
plugins/org.yakindu.base.types/model/types.aird


+ 2 - 0
plugins/org.yakindu.base.types/model/types.ecore

@@ -14,6 +14,8 @@
     <eStructuralFeatures xsi:type="ecore:EReference" name="constraint" upperBound="-1"
         eType="#//TypeConstraint" containment="true"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="abstract" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="visible" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        defaultValueLiteral="true"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="Declaration" abstract="true" eSuperTypes="#//TypedElement base.ecore#//NamedElement #//PackageMember"/>
   <eClassifiers xsi:type="ecore:EClass" name="Operation" eSuperTypes="#//Declaration">

TEMPAT SAMPAH
plugins/org.yakindu.base.types/model/types.jpg


+ 28 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/Type.java

@@ -19,6 +19,7 @@ import org.eclipse.emf.common.util.EList;
  * <ul>
  *   <li>{@link org.yakindu.base.types.Type#getConstraint <em>Constraint</em>}</li>
  *   <li>{@link org.yakindu.base.types.Type#isAbstract <em>Abstract</em>}</li>
+ *   <li>{@link org.yakindu.base.types.Type#isVisible <em>Visible</em>}</li>
  * </ul>
  *
  * @see org.yakindu.base.types.TypesPackage#getType()
@@ -69,6 +70,33 @@ public interface Type extends PackageMember {
 	 */
 	void setAbstract(boolean value);
 
+	/**
+	 * Returns the value of the '<em><b>Visible</b></em>' attribute.
+	 * The default value is <code>"true"</code>.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Visible</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Visible</em>' attribute.
+	 * @see #setVisible(boolean)
+	 * @see org.yakindu.base.types.TypesPackage#getType_Visible()
+	 * @model default="true"
+	 * @generated
+	 */
+	boolean isVisible();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.base.types.Type#isVisible <em>Visible</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Visible</em>' attribute.
+	 * @see #isVisible()
+	 * @generated
+	 */
+	void setVisible(boolean value);
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 84 - 2
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/TypesPackage.java

@@ -221,6 +221,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int TYPE__ABSTRACT = PACKAGE_MEMBER_FEATURE_COUNT + 1;
 
+	/**
+	 * The feature id for the '<em><b>Visible</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int TYPE__VISIBLE = PACKAGE_MEMBER_FEATURE_COUNT + 2;
+
 	/**
 	 * The number of structural features of the '<em>Type</em>' class.
 	 * <!-- begin-user-doc -->
@@ -228,7 +237,7 @@ public interface TypesPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int TYPE_FEATURE_COUNT = PACKAGE_MEMBER_FEATURE_COUNT + 2;
+	int TYPE_FEATURE_COUNT = PACKAGE_MEMBER_FEATURE_COUNT + 3;
 
 	/**
 	 * The feature id for the '<em><b>Type</b></em>' reference.
@@ -560,6 +569,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int PRIMITIVE_TYPE__ABSTRACT = TYPE__ABSTRACT;
 
+	/**
+	 * The feature id for the '<em><b>Visible</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int PRIMITIVE_TYPE__VISIBLE = TYPE__VISIBLE;
+
 	/**
 	 * The feature id for the '<em><b>Base Type</b></em>' reference.
 	 * <!-- begin-user-doc -->
@@ -605,6 +623,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int ENUMERATION_TYPE__ABSTRACT = PRIMITIVE_TYPE__ABSTRACT;
 
+	/**
+	 * The feature id for the '<em><b>Visible</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int ENUMERATION_TYPE__VISIBLE = PRIMITIVE_TYPE__VISIBLE;
+
 	/**
 	 * The feature id for the '<em><b>Base Type</b></em>' reference.
 	 * <!-- begin-user-doc -->
@@ -669,6 +696,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int PARAMETERIZED_TYPE__ABSTRACT = TYPE__ABSTRACT;
 
+	/**
+	 * The feature id for the '<em><b>Visible</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int PARAMETERIZED_TYPE__VISIBLE = TYPE__VISIBLE;
+
 	/**
 	 * The feature id for the '<em><b>Parameter</b></em>' containment reference list.
 	 * <!-- begin-user-doc -->
@@ -724,6 +760,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int COMPLEX_TYPE__ABSTRACT = PARAMETERIZED_TYPE__ABSTRACT;
 
+	/**
+	 * The feature id for the '<em><b>Visible</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int COMPLEX_TYPE__VISIBLE = PARAMETERIZED_TYPE__VISIBLE;
+
 	/**
 	 * The feature id for the '<em><b>Parameter</b></em>' containment reference list.
 	 * <!-- begin-user-doc -->
@@ -872,6 +917,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int TYPE_PARAMETER__ABSTRACT = TYPE__ABSTRACT;
 
+	/**
+	 * The feature id for the '<em><b>Visible</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int TYPE_PARAMETER__VISIBLE = TYPE__VISIBLE;
+
 	/**
 	 * The feature id for the '<em><b>Bound</b></em>' reference.
 	 * <!-- begin-user-doc -->
@@ -1019,6 +1073,15 @@ public interface TypesPackage extends EPackage {
 	 */
 	int TYPE_ALIAS__ABSTRACT = TYPED_ELEMENT_FEATURE_COUNT + 2;
 
+	/**
+	 * The feature id for the '<em><b>Visible</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int TYPE_ALIAS__VISIBLE = TYPED_ELEMENT_FEATURE_COUNT + 3;
+
 	/**
 	 * The number of structural features of the '<em>Type Alias</em>' class.
 	 * <!-- begin-user-doc -->
@@ -1026,7 +1089,7 @@ public interface TypesPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int TYPE_ALIAS_FEATURE_COUNT = TYPED_ELEMENT_FEATURE_COUNT + 3;
+	int TYPE_ALIAS_FEATURE_COUNT = TYPED_ELEMENT_FEATURE_COUNT + 4;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.base.types.Direction <em>Direction</em>}' enum.
@@ -1113,6 +1176,17 @@ public interface TypesPackage extends EPackage {
 	 */
 	EAttribute getType_Abstract();
 
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.base.types.Type#isVisible <em>Visible</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Visible</em>'.
+	 * @see org.yakindu.base.types.Type#isVisible()
+	 * @see #getType()
+	 * @generated
+	 */
+	EAttribute getType_Visible();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.base.types.Declaration <em>Declaration</em>}'.
 	 * <!-- begin-user-doc -->
@@ -1595,6 +1669,14 @@ public interface TypesPackage extends EPackage {
 		 */
 		EAttribute TYPE__ABSTRACT = eINSTANCE.getType_Abstract();
 
+		/**
+		 * The meta object literal for the '<em><b>Visible</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute TYPE__VISIBLE = eINSTANCE.getType_Visible();
+
 		/**
 		 * The meta object literal for the '{@link org.yakindu.base.types.impl.DeclarationImpl <em>Declaration</em>}' class.
 		 * <!-- begin-user-doc -->

+ 54 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/impl/TypeAliasImpl.java

@@ -34,6 +34,7 @@ import org.yakindu.base.types.TypesPackage;
  *   <li>{@link org.yakindu.base.types.impl.TypeAliasImpl#getName <em>Name</em>}</li>
  *   <li>{@link org.yakindu.base.types.impl.TypeAliasImpl#getConstraint <em>Constraint</em>}</li>
  *   <li>{@link org.yakindu.base.types.impl.TypeAliasImpl#isAbstract <em>Abstract</em>}</li>
+ *   <li>{@link org.yakindu.base.types.impl.TypeAliasImpl#isVisible <em>Visible</em>}</li>
  * </ul>
  *
  * @generated
@@ -103,6 +104,26 @@ public class TypeAliasImpl extends EObjectImpl implements TypeAlias {
 	 */
 	protected boolean abstract_ = ABSTRACT_EDEFAULT;
 
+	/**
+	 * The default value of the '{@link #isVisible() <em>Visible</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isVisible()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean VISIBLE_EDEFAULT = true;
+
+	/**
+	 * The cached value of the '{@link #isVisible() <em>Visible</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isVisible()
+	 * @generated
+	 * @ordered
+	 */
+	protected boolean visible = VISIBLE_EDEFAULT;
+
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * @generated
@@ -215,6 +236,27 @@ public class TypeAliasImpl extends EObjectImpl implements TypeAlias {
 			eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.TYPE_ALIAS__ABSTRACT, oldAbstract, abstract_));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public boolean isVisible() {
+		return visible;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setVisible(boolean newVisible) {
+		boolean oldVisible = visible;
+		visible = newVisible;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.TYPE_ALIAS__VISIBLE, oldVisible, visible));
+	}
+
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * 
@@ -258,6 +300,8 @@ public class TypeAliasImpl extends EObjectImpl implements TypeAlias {
 				return getConstraint();
 			case TypesPackage.TYPE_ALIAS__ABSTRACT:
 				return isAbstract();
+			case TypesPackage.TYPE_ALIAS__VISIBLE:
+				return isVisible();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -287,6 +331,9 @@ public class TypeAliasImpl extends EObjectImpl implements TypeAlias {
 			case TypesPackage.TYPE_ALIAS__ABSTRACT:
 				setAbstract((Boolean)newValue);
 				return;
+			case TypesPackage.TYPE_ALIAS__VISIBLE:
+				setVisible((Boolean)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -313,6 +360,9 @@ public class TypeAliasImpl extends EObjectImpl implements TypeAlias {
 			case TypesPackage.TYPE_ALIAS__ABSTRACT:
 				setAbstract(ABSTRACT_EDEFAULT);
 				return;
+			case TypesPackage.TYPE_ALIAS__VISIBLE:
+				setVisible(VISIBLE_EDEFAULT);
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -334,6 +384,8 @@ public class TypeAliasImpl extends EObjectImpl implements TypeAlias {
 				return constraint != null && !constraint.isEmpty();
 			case TypesPackage.TYPE_ALIAS__ABSTRACT:
 				return abstract_ != ABSTRACT_EDEFAULT;
+			case TypesPackage.TYPE_ALIAS__VISIBLE:
+				return visible != VISIBLE_EDEFAULT;
 		}
 		return super.eIsSet(featureID);
 	}
@@ -359,6 +411,7 @@ public class TypeAliasImpl extends EObjectImpl implements TypeAlias {
 			switch (derivedFeatureID) {
 				case TypesPackage.TYPE_ALIAS__CONSTRAINT: return TypesPackage.TYPE__CONSTRAINT;
 				case TypesPackage.TYPE_ALIAS__ABSTRACT: return TypesPackage.TYPE__ABSTRACT;
+				case TypesPackage.TYPE_ALIAS__VISIBLE: return TypesPackage.TYPE__VISIBLE;
 				default: return -1;
 			}
 		}
@@ -386,6 +439,7 @@ public class TypeAliasImpl extends EObjectImpl implements TypeAlias {
 			switch (baseFeatureID) {
 				case TypesPackage.TYPE__CONSTRAINT: return TypesPackage.TYPE_ALIAS__CONSTRAINT;
 				case TypesPackage.TYPE__ABSTRACT: return TypesPackage.TYPE_ALIAS__ABSTRACT;
+				case TypesPackage.TYPE__VISIBLE: return TypesPackage.TYPE_ALIAS__VISIBLE;
 				default: return -1;
 			}
 		}

+ 52 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/impl/TypeImpl.java

@@ -30,6 +30,7 @@ import org.yakindu.base.types.TypesPackage;
  * <ul>
  *   <li>{@link org.yakindu.base.types.impl.TypeImpl#getConstraint <em>Constraint</em>}</li>
  *   <li>{@link org.yakindu.base.types.impl.TypeImpl#isAbstract <em>Abstract</em>}</li>
+ *   <li>{@link org.yakindu.base.types.impl.TypeImpl#isVisible <em>Visible</em>}</li>
  * </ul>
  *
  * @generated
@@ -65,6 +66,26 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 	 */
 	protected boolean abstract_ = ABSTRACT_EDEFAULT;
 
+	/**
+	 * The default value of the '{@link #isVisible() <em>Visible</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isVisible()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean VISIBLE_EDEFAULT = true;
+
+	/**
+	 * The cached value of the '{@link #isVisible() <em>Visible</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isVisible()
+	 * @generated
+	 * @ordered
+	 */
+	protected boolean visible = VISIBLE_EDEFAULT;
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -117,6 +138,27 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 			eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.TYPE__ABSTRACT, oldAbstract, abstract_));
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public boolean isVisible() {
+		return visible;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setVisible(boolean newVisible) {
+		boolean oldVisible = visible;
+		visible = newVisible;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.TYPE__VISIBLE, oldVisible, visible));
+	}
+
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * 
@@ -153,6 +195,8 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 				return getConstraint();
 			case TypesPackage.TYPE__ABSTRACT:
 				return isAbstract();
+			case TypesPackage.TYPE__VISIBLE:
+				return isVisible();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -173,6 +217,9 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 			case TypesPackage.TYPE__ABSTRACT:
 				setAbstract((Boolean)newValue);
 				return;
+			case TypesPackage.TYPE__VISIBLE:
+				setVisible((Boolean)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -191,6 +238,9 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 			case TypesPackage.TYPE__ABSTRACT:
 				setAbstract(ABSTRACT_EDEFAULT);
 				return;
+			case TypesPackage.TYPE__VISIBLE:
+				setVisible(VISIBLE_EDEFAULT);
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -207,6 +257,8 @@ public abstract class TypeImpl extends PackageMemberImpl implements Type {
 				return constraint != null && !constraint.isEmpty();
 			case TypesPackage.TYPE__ABSTRACT:
 				return abstract_ != ABSTRACT_EDEFAULT;
+			case TypesPackage.TYPE__VISIBLE:
+				return visible != VISIBLE_EDEFAULT;
 		}
 		return super.eIsSet(featureID);
 	}

+ 11 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/impl/TypesPackageImpl.java

@@ -296,6 +296,15 @@ public class TypesPackageImpl extends EPackageImpl implements TypesPackage {
 		return (EAttribute)typeEClass.getEStructuralFeatures().get(1);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getType_Visible() {
+		return (EAttribute)typeEClass.getEStructuralFeatures().get(2);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -655,6 +664,7 @@ public class TypesPackageImpl extends EPackageImpl implements TypesPackage {
 		typeEClass = createEClass(TYPE);
 		createEReference(typeEClass, TYPE__CONSTRAINT);
 		createEAttribute(typeEClass, TYPE__ABSTRACT);
+		createEAttribute(typeEClass, TYPE__VISIBLE);
 
 		declarationEClass = createEClass(DECLARATION);
 
@@ -774,6 +784,7 @@ public class TypesPackageImpl extends EPackageImpl implements TypesPackage {
 		initEClass(typeEClass, Type.class, "Type", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getType_Constraint(), this.getTypeConstraint(), null, "constraint", null, 0, -1, Type.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEAttribute(getType_Abstract(), ecorePackage.getEBoolean(), "abstract", null, 0, 1, Type.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEAttribute(getType_Visible(), ecorePackage.getEBoolean(), "visible", "true", 0, 1, Type.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
 		addEOperation(typeEClass, this.getType(), "getOriginType", 0, 1, IS_UNIQUE, IS_ORDERED);