From d0dabe59c99e5c40403be2f7bb5a4550c31652d5 Mon Sep 17 00:00:00 2001 From: Kai Brassel <mail@khbrassel.de> Date: Fri, 28 May 2021 11:10:15 +0200 Subject: [PATCH] Make table columns read only --- .../plugin.properties | 2 ++ .../MaterialCategoryItemProvider.java | 12 +++++------- .../plugin.xml | 17 ++++++----------- .../viewmodels/ConstructionCategory.view | 7 +++++++ .../viewmodels/MaterialCategory.view | 1 + .../viewmodels/Mounting.view | 2 +- .../viewmodels/WindowCatalog.view | 19 +++++++++++++++++++ .../model/buildingphysics.genmodel | 5 +++-- 8 files changed, 44 insertions(+), 21 deletions(-) diff --git a/de.hftstuttgart.buildingphysics.edit/plugin.properties b/de.hftstuttgart.buildingphysics.edit/plugin.properties index 9a86aa4..b12bd6c 100644 --- a/de.hftstuttgart.buildingphysics.edit/plugin.properties +++ b/de.hftstuttgart.buildingphysics.edit/plugin.properties @@ -86,3 +86,5 @@ _UI_Material_materialId_feature = Material Id _UI_Mounting_mountingId_feature = Mounting Id _UI_Layer__feature = Layer _UI_Material_category_feature = Category +_UI_MaterialCategory_name_description = Name of material category +_UI_Material_name_description = Name of material diff --git a/de.hftstuttgart.buildingphysics.edit/src/de/hftstuttgart/buildingphysics/provider/MaterialCategoryItemProvider.java b/de.hftstuttgart.buildingphysics.edit/src/de/hftstuttgart/buildingphysics/provider/MaterialCategoryItemProvider.java index 248f7eb..8fe3a94 100644 --- a/de.hftstuttgart.buildingphysics.edit/src/de/hftstuttgart/buildingphysics/provider/MaterialCategoryItemProvider.java +++ b/de.hftstuttgart.buildingphysics.edit/src/de/hftstuttgart/buildingphysics/provider/MaterialCategoryItemProvider.java @@ -64,13 +64,11 @@ public class MaterialCategoryItemProvider extends ItemProviderAdapter implements * @generated */ protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_MaterialCategory_name_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_MaterialCategory_name_feature", - "_UI_MaterialCategory_type"), - BuildingPhysicsPackage.Literals.MATERIAL_CATEGORY__NAME, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_MaterialCategory_name_feature"), getString("_UI_MaterialCategory_name_description"), + BuildingPhysicsPackage.Literals.MATERIAL_CATEGORY__NAME, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** diff --git a/de.hftstuttgart.buildingphysics.viewmodel/plugin.xml b/de.hftstuttgart.buildingphysics.viewmodel/plugin.xml index 1038a5c..01a06bd 100644 --- a/de.hftstuttgart.buildingphysics.viewmodel/plugin.xml +++ b/de.hftstuttgart.buildingphysics.viewmodel/plugin.xml @@ -2,20 +2,15 @@ <?eclipse version="3.4"?> <plugin> <extension point="org.eclipse.emf.ecp.view.model.provider.xmi.file"> -<file filePath="viewmodels/Mounting.view"/> - -<file filePath="viewmodels/ConstructionCategory.view"/> - -<file filePath="viewmodels/MaterialCatalog.view"/> - -<file filePath="viewmodels/Material.view"/> - -<file filePath="viewmodels/WindowType.view"/> - + <file filePath="viewmodels/Mounting.view"/> + <file filePath="viewmodels/ConstructionCategory.view"/> + <file filePath="viewmodels/MaterialCatalog.view"/> + <file filePath="viewmodels/Material.view"/> + <file filePath="viewmodels/WindowType.view"/> <file filePath="viewmodels/BuildingPhysicsCatalog.view"/> <file filePath="viewmodels/BuildingPhysicsCatalog_Detail.view"> <filter key="detail" value="true"/> </file> <file filePath="viewmodels/MaterialCategory.view"/> </extension> -</plugin> +</plugin> \ No newline at end of file diff --git a/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/ConstructionCategory.view b/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/ConstructionCategory.view index d94eb26..5b873d8 100644 --- a/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/ConstructionCategory.view +++ b/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/ConstructionCategory.view @@ -8,10 +8,17 @@ </children> <children xsi:type="org.eclipse.emf.ecp.view.table.model:TableControl" xmi:id="_vgicgLeuEeu0KumwacCHxQ" detailEditing="WithPanel"> <domainModelReference xsi:type="org.eclipse.emf.ecp.view.table.model:TableDomainModelReference" xmi:id="_yN_hQLeuEeu0KumwacCHxQ"> + <columnDomainModelReferences xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_IHsn8L-QEeuIHZm4y-I19A"> + <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.hftstuttgart.de/buildingphysics#//Mounting/mountingId"/> + </columnDomainModelReferences> + <columnDomainModelReferences xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_IHsn8b-QEeuIHZm4y-I19A"> + <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.hftstuttgart.de/buildingphysics#//Mounting/name"/> + </columnDomainModelReferences> <domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_yN_hQbeuEeu0KumwacCHxQ"> <domainModelEFeature xsi:type="ecore:EReference" href="http://www.hftstuttgart.de/buildingphysics#//ConstructionCategory/mountings"/> </domainModelReference> </domainModelReference> + <columnConfigurations xsi:type="org.eclipse.emf.ecp.view.table.model:ReadOnlyColumnConfiguration" xmi:id="_2MtCAL-PEeuIHZm4y-I19A" columnDomainReferences="_IHsn8b-QEeuIHZm4y-I19A _IHsn8L-QEeuIHZm4y-I19A"/> </children> <ecorePaths>/de.hftstuttgart.buildingphysics/model/buildingphysics.ecore</ecorePaths> </org.eclipse.emf.ecp.view.model:View> diff --git a/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/MaterialCategory.view b/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/MaterialCategory.view index eda1eae..c687da9 100644 --- a/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/MaterialCategory.view +++ b/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/MaterialCategory.view @@ -27,6 +27,7 @@ <domainModelEFeature xsi:type="ecore:EReference" href="http://www.hftstuttgart.de/buildingphysics#//MaterialCategory/materials"/> </domainModelReference> </domainModelReference> + <columnConfigurations xsi:type="org.eclipse.emf.ecp.view.table.model:ReadOnlyColumnConfiguration" xmi:id="_q0L1IL-QEeuIHZm4y-I19A" columnDomainReferences="_g8iSwbPYEeup29SeaUMpQQ _g8iSwrPYEeup29SeaUMpQQ _g8iSw7PYEeup29SeaUMpQQ _g8iSxLPYEeup29SeaUMpQQ _g8iSwLPYEeup29SeaUMpQQ"/> </children> <ecorePaths>/de.hftstuttgart.buildingphysics/model/buildingphysics.ecore</ecorePaths> </org.eclipse.emf.ecp.view.model:View> diff --git a/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/Mounting.view b/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/Mounting.view index c58181f..8c3e4ee 100644 --- a/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/Mounting.view +++ b/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/Mounting.view @@ -29,8 +29,8 @@ <domainModelEFeature xsi:type="ecore:EReference" href="http://www.hftstuttgart.de/buildingphysics#//Mounting/layers"/> </domainModelReference> </domainModelReference> - <columnConfigurations xsi:type="org.eclipse.emf.ecp.view.table.model:ReadOnlyColumnConfiguration" xmi:id="_rCf9QL44EeuIHZm4y-I19A" columnDomainReferences="_123AEL4qEeuIHZm4y-I19A _6c1I0L4uEeuIHZm4y-I19A"/> <columnConfigurations xsi:type="org.eclipse.emf.ecp.view.table.model:WidthConfiguration" xmi:id="_d7H2QL8HEeuIHZm4y-I19A" columnDomainReference="_QnRfELPZEeup29SeaUMpQQ" weight="30" minWidth="65"/> + <columnConfigurations xsi:type="org.eclipse.emf.ecp.view.table.model:ReadOnlyColumnConfiguration" xmi:id="__DSvkL-MEeuIHZm4y-I19A" columnDomainReferences="_123AEL4qEeuIHZm4y-I19A _6c1I0L4uEeuIHZm4y-I19A"/> </children> <ecorePaths>/de.hftstuttgart.buildingphysics/model/buildingphysics.ecore</ecorePaths> </org.eclipse.emf.ecp.view.model:View> diff --git a/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/WindowCatalog.view b/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/WindowCatalog.view index 817c56b..7defd70 100644 --- a/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/WindowCatalog.view +++ b/de.hftstuttgart.buildingphysics.viewmodel/viewmodels/WindowCatalog.view @@ -18,10 +18,29 @@ </children> <children xsi:type="org.eclipse.emf.ecp.view.table.model:TableControl" xmi:id="_jQX8wK15Eeuda6ijj1ILcQ" detailEditing="WithPanel"> <domainModelReference xsi:type="org.eclipse.emf.ecp.view.table.model:TableDomainModelReference" xmi:id="_v8IfcLfGEeu0KumwacCHxQ"> + <columnDomainModelReferences xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_yjrQYL-QEeuIHZm4y-I19A"> + <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.hftstuttgart.de/buildingphysics#//WindowType/windowTypeId"/> + </columnDomainModelReferences> + <columnDomainModelReferences xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_yjrQYb-QEeuIHZm4y-I19A"> + <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.hftstuttgart.de/buildingphysics#//WindowType/name"/> + </columnDomainModelReferences> + <columnDomainModelReferences xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_yjrQYr-QEeuIHZm4y-I19A"> + <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.hftstuttgart.de/buildingphysics#//WindowType/uValue"/> + </columnDomainModelReferences> + <columnDomainModelReferences xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_yjrQY7-QEeuIHZm4y-I19A"> + <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.hftstuttgart.de/buildingphysics#//WindowType/gValue"/> + </columnDomainModelReferences> + <columnDomainModelReferences xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_yjrQZL-QEeuIHZm4y-I19A"> + <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.hftstuttgart.de/buildingphysics#//WindowType/glazingNumber"/> + </columnDomainModelReferences> + <columnDomainModelReferences xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_yjrQZb-QEeuIHZm4y-I19A"> + <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.hftstuttgart.de/buildingphysics#//WindowType/frameRatio"/> + </columnDomainModelReferences> <domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_v8IfcbfGEeu0KumwacCHxQ"> <domainModelEFeature xsi:type="ecore:EReference" href="http://www.hftstuttgart.de/buildingphysics#//WindowCatalog/windowTypes"/> </domainModelReference> </domainModelReference> + <columnConfigurations xsi:type="org.eclipse.emf.ecp.view.table.model:ReadOnlyColumnConfiguration" xmi:id="_28IeYL-QEeuIHZm4y-I19A" columnDomainReferences="_yjrQZL-QEeuIHZm4y-I19A _yjrQY7-QEeuIHZm4y-I19A _yjrQYL-QEeuIHZm4y-I19A _yjrQYb-QEeuIHZm4y-I19A _yjrQYr-QEeuIHZm4y-I19A _yjrQZb-QEeuIHZm4y-I19A"/> </children> <ecorePaths>/de.hftstuttgart.buildingphysics/model/buildingphysics.ecore</ecorePaths> </org.eclipse.emf.ecp.view.model:View> diff --git a/de.hftstuttgart.buildingphysics/model/buildingphysics.genmodel b/de.hftstuttgart.buildingphysics/model/buildingphysics.genmodel index f0e7b89..78f1b87 100644 --- a/de.hftstuttgart.buildingphysics/model/buildingphysics.genmodel +++ b/de.hftstuttgart.buildingphysics/model/buildingphysics.genmodel @@ -44,11 +44,12 @@ </genClasses> <genClasses ecoreClass="buildingphysics.ecore#//MaterialCategory"> <genFeatures property="None" createChild="false" ecoreFeature="ecore:EReference buildingphysics.ecore#//MaterialCategory/materials"/> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute buildingphysics.ecore#//MaterialCategory/name"/> + <genFeatures createChild="false" propertyDescription="Name of material category" + ecoreFeature="ecore:EAttribute buildingphysics.ecore#//MaterialCategory/name"/> </genClasses> <genClasses image="false" ecoreClass="buildingphysics.ecore#//Material"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute buildingphysics.ecore#//Material/materialId"/> - <genFeatures createChild="false" propertyDescription="Bla Blub" ecoreFeature="ecore:EAttribute buildingphysics.ecore#//Material/name"/> + <genFeatures createChild="false" propertyDescription="Name of material" ecoreFeature="ecore:EAttribute buildingphysics.ecore#//Material/name"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute buildingphysics.ecore#//Material/density"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute buildingphysics.ecore#//Material/heatCapacity"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute buildingphysics.ecore#//Material/conductivity"/> -- GitLab