Commit f80d5e31 authored by Kai-Holger Brassel's avatar Kai-Holger Brassel
Browse files

Enable creation of categories in master detail tree

parent 19907a34
......@@ -10,16 +10,17 @@ _UI_CreateChild_tooltip = Create New {0} Under {1} Feature
_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
_UI_PropertyDescriptor_description = The {0} of the {1}
_UI_PropertyDescriptor_description = {0} of {1}
_UI_BuildingPhysicsCatalog_type = Catalog
_UI_WindowType_type = Window Type
_UI_Catalog_type = Catalog
_UI_WindowCatalog_type = Windows
_UI_MaterialCatalog_type = Materials and Constructions
_UI_MaterialCategory_type =
_UI_MaterialCategory_type = Material Category
_UI_Material_type = Material
_UI_Unknown_type = Object
_UI_ConstructionCategory_type = Construction Category
_UI_Unknown_datatype= Value
......@@ -69,7 +70,6 @@ _UI_Material_constructionDescription_feature = Construction Description
_UI_Material_disposalEnergy_feature = Disposal Energy
_UI_Material_disposalCarbon_feature = Disposal Carbon
_UI_Material_disposalDescription_feature = Disposal Description
_UI_ConstructionCategory_type = Constructions
_UI_Mounting_type = Mounting
_UI_Layer_type = Layer
_UI_MaterialCatalog_constructionCategories_feature = Constructions
......
......@@ -2,6 +2,7 @@
*/
package de.hftstuttgart.buildingphysics.provider;
import de.hftstuttgart.buildingphysics.BuildingPhysicsFactory;
import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage;
import de.hftstuttgart.buildingphysics.MaterialCatalog;
......@@ -139,6 +140,14 @@ public class MaterialCatalogItemProvider extends CatalogItemProvider {
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
newChildDescriptors
.add(createChildParameter(BuildingPhysicsPackage.Literals.MATERIAL_CATALOG__MATERIAL_CATEGORIES,
BuildingPhysicsFactory.eINSTANCE.createMaterialCategory()));
newChildDescriptors
.add(createChildParameter(BuildingPhysicsPackage.Literals.MATERIAL_CATALOG__CONSTRUCTION_CATEGORIES,
BuildingPhysicsFactory.eINSTANCE.createConstructionCategory()));
}
}
......@@ -10,7 +10,6 @@ import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
......@@ -46,36 +45,6 @@ public class WindowCatalogItemProvider extends CatalogItemProvider {
return itemPropertyDescriptors;
}
/**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(BuildingPhysicsPackage.Literals.WINDOW_CATALOG__WINDOW_TYPES);
}
return childrenFeatures;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EStructuralFeature getChildFeature(Object object, Object child) {
// Check the type of the specified child object and return the proper feature to use for
// adding (see {@link AddCommand}) it as a child.
return super.getChildFeature(object, child);
}
/**
* This returns WindowCatalog.gif.
* <!-- begin-user-doc -->
......@@ -121,7 +90,7 @@ public class WindowCatalogItemProvider extends CatalogItemProvider {
switch (notification.getFeatureID(WindowCatalog.class)) {
case BuildingPhysicsPackage.WINDOW_CATALOG__WINDOW_TYPES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
......
......@@ -61,7 +61,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="materialCategories" upperBound="-1"
eType="#//MaterialCategory" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="constructionCategories"
lowerBound="1" upperBound="-1" eType="#//ConstructionCategory" containment="true"/>
upperBound="-1" eType="#//ConstructionCategory" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MaterialCategory">
<eStructuralFeatures xsi:type="ecore:EReference" name="materials" upperBound="-1"
......
......@@ -36,11 +36,11 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute buildingphysics.ecore#//Catalog/source"/>
</genClasses>
<genClasses ecoreClass="buildingphysics.ecore#//WindowCatalog">
<genFeatures property="None" children="true" createChild="false" ecoreFeature="ecore:EReference buildingphysics.ecore#//WindowCatalog/windowTypes"/>
<genFeatures property="None" createChild="false" ecoreFeature="ecore:EReference buildingphysics.ecore#//WindowCatalog/windowTypes"/>
</genClasses>
<genClasses ecoreClass="buildingphysics.ecore#//MaterialCatalog">
<genFeatures property="None" children="true" createChild="false" ecoreFeature="ecore:EReference buildingphysics.ecore#//MaterialCatalog/materialCategories"/>
<genFeatures property="None" children="true" createChild="false" ecoreFeature="ecore:EReference buildingphysics.ecore#//MaterialCatalog/constructionCategories"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference buildingphysics.ecore#//MaterialCatalog/materialCategories"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference buildingphysics.ecore#//MaterialCatalog/constructionCategories"/>
</genClasses>
<genClasses ecoreClass="buildingphysics.ecore#//MaterialCategory">
<genFeatures property="None" createChild="false" ecoreFeature="ecore:EReference buildingphysics.ecore#//MaterialCategory/materials"/>
......
......@@ -41,7 +41,7 @@ public interface MaterialCatalog extends Catalog {
* <!-- end-user-doc -->
* @return the value of the '<em>Construction Categories</em>' containment reference list.
* @see de.hftstuttgart.buildingphysics.BuildingPhysicsPackage#getMaterialCatalog_ConstructionCategories()
* @model containment="true" required="true"
* @model containment="true"
* @generated
*/
EList<ConstructionCategory> getConstructionCategories();
......
......@@ -887,7 +887,7 @@ public class BuildingPhysicsPackageImpl extends EPackageImpl implements Building
null, 0, -1, MaterialCatalog.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getMaterialCatalog_ConstructionCategories(), this.getConstructionCategory(), null,
"constructionCategories", null, 1, -1, MaterialCatalog.class, !IS_TRANSIENT, !IS_VOLATILE,
"constructionCategories", null, 0, -1, MaterialCatalog.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(materialCategoryEClass, MaterialCategory.class, "MaterialCategory", !IS_ABSTRACT, !IS_INTERFACE,
......
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