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

Replaced custom unit projects by external cityunits and indriya plugins

parent 01673354
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Energy Components Catalog App
Bundle-SymbolicName: de.hftstuttgart.energycomponents.app;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 1.0.0
Bundle-Vendor: HfT Stuttgart
Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.core.runtime;bundle-version="[3.9.100,4.0.0)",
......@@ -21,9 +21,10 @@ Require-Bundle: javax.inject;bundle-version="1.0.0",
de.hftstuttgart.energycomponents.model;bundle-version="0.0.0",
de.hftstuttgart.energycomponents.edit;bundle-version="0.0.0",
de.hftstuttgart.energycomponents.viewmodel;bundle-version="0.0.0",
de.hftstuttgart.indriya.osgiplugin;bundle-version="0.0.0",
de.hftstuttgart.units;bundle-version="0.0.0",
de.hftstuttgart.units.ui.renderer;bundle-version="0.0.0"
de.hftstuttgart.cityunits.model;bundle-version="1.0.1",
de.hftstuttgart.cityunits.model.edit;bundle-version="1.0.1",
de.hftstuttgart.cityunits.ui.renderer;bundle-version="1.0.1",
tech.units.indriya;bundle-version="2.1.1"
Import-Package: javax.annotation;version="1.3.5"
Automatic-Module-Name: de.hftstuttgart.energycomponents.app
Export-Package: de.hftstuttgart.energycomponents.app.handlers,
......
......@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: de.hftstuttgart.energycomponents.edit;singleton:=true
Automatic-Module-Name: de.hftstuttgart.energycomponents.edit
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 1.0.0
Bundle-ClassPath: .
Bundle-Activator: de.hftstuttgart.energycomponents.provider.EnergyComponentsEditPlugin$Implementation
Bundle-Vendor: %providerName
......@@ -11,7 +11,9 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: de.hftstuttgart.energycomponents.provider
Require-Bundle: org.eclipse.core.runtime,
de.hftstuttgart.energycomponents.model;visibility:=reexport,
de.hftstuttgart.energycomponents.model;visibility:=reexport,
org.eclipse.emf.edit;visibility:=reexport,
de.hftstuttgart.units;bundle-version="1.0.0"
de.hftstuttgart.cityunits.model;bundle-version="1.0.1";visibility:=reexport,
de.hftstuttgart.cityunits.model.edit;visibility:=reexport
Bundle-ActivationPolicy: lazy
......@@ -13,6 +13,7 @@ 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.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
......
......@@ -11,8 +11,11 @@ import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
......@@ -68,97 +71,50 @@ public class CostItemProvider extends ItemProviderAdapter implements IEditingDom
}
/**
* This adds a property descriptor for the Personnel Hours feature.
* This adds a property descriptor for the Component Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addPersonnelHoursPropertyDescriptor(Object object) {
protected void addComponentNamePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Cost_personnelHours_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_personnelHours_feature",
getResourceLocator(), getString("_UI_Cost_componentName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_componentName_feature",
"_UI_Cost_type"),
EnCompPackage.Literals.COST__PERSONNEL_HOURS, true, false, false,
EnCompPackage.Literals.COST__COMPONENT_NAME, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
* This adds a property descriptor for the Personnel Cost Share feature.
* This adds a property descriptor for the Description feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addPersonnelCostSharePropertyDescriptor(Object object) {
protected void addDescriptionPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Cost_personnelCostShare_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_personnelCostShare_feature",
getResourceLocator(), getString("_UI_Cost_description_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_description_feature",
"_UI_Cost_type"),
EnCompPackage.Literals.COST__PERSONNEL_COST_SHARE, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
}
/**
* This adds a property descriptor for the Administration And Other Cost Share feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAdministrationAndOtherCostSharePropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
getString("_UI_Cost_administrationAndOtherCostShare_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_administrationAndOtherCostShare_feature",
"_UI_Cost_type"),
EnCompPackage.Literals.COST__ADMINISTRATION_AND_OTHER_COST_SHARE, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
EnCompPackage.Literals.COST__DESCRIPTION, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
* This adds a property descriptor for the Maintenance Cost Share feature.
* This adds a property descriptor for the Heat Source feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addMaintenanceCostSharePropertyDescriptor(Object object) {
protected void addHeatSourcePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Cost_maintenanceCostShare_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_maintenanceCostShare_feature",
"_UI_Cost_type"),
EnCompPackage.Literals.COST__MAINTENANCE_COST_SHARE, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
}
/**
* 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(EnCompPackage.Literals.COST__INVESTMENT_COST);
}
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);
getResourceLocator(), getString("_UI_Cost_heatSource_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_heatSource_feature", "_UI_Cost_type"),
EnCompPackage.Literals.COST__HEAT_SOURCE, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
......@@ -208,50 +164,97 @@ public class CostItemProvider extends ItemProviderAdapter implements IEditingDom
}
/**
* This adds a property descriptor for the Component Name feature.
* This adds a property descriptor for the Personnel Hours feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addComponentNamePropertyDescriptor(Object object) {
protected void addPersonnelHoursPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Cost_componentName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_componentName_feature",
getResourceLocator(), getString("_UI_Cost_personnelHours_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_personnelHours_feature",
"_UI_Cost_type"),
EnCompPackage.Literals.COST__COMPONENT_NAME, true, false, false,
EnCompPackage.Literals.COST__PERSONNEL_HOURS, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
* This adds a property descriptor for the Description feature.
* This adds a property descriptor for the Personnel Cost Share feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addDescriptionPropertyDescriptor(Object object) {
protected void addPersonnelCostSharePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Cost_description_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_description_feature",
getResourceLocator(), getString("_UI_Cost_personnelCostShare_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_personnelCostShare_feature",
"_UI_Cost_type"),
EnCompPackage.Literals.COST__DESCRIPTION, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
EnCompPackage.Literals.COST__PERSONNEL_COST_SHARE, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
}
/**
* This adds a property descriptor for the Heat Source feature.
* This adds a property descriptor for the Administration And Other Cost Share feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addHeatSourcePropertyDescriptor(Object object) {
protected void addAdministrationAndOtherCostSharePropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
getString("_UI_Cost_administrationAndOtherCostShare_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_administrationAndOtherCostShare_feature",
"_UI_Cost_type"),
EnCompPackage.Literals.COST__ADMINISTRATION_AND_OTHER_COST_SHARE, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
}
/**
* This adds a property descriptor for the Maintenance Cost Share feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addMaintenanceCostSharePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Cost_heatSource_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_heatSource_feature", "_UI_Cost_type"),
EnCompPackage.Literals.COST__HEAT_SOURCE, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
getResourceLocator(), getString("_UI_Cost_maintenanceCostShare_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Cost_maintenanceCostShare_feature",
"_UI_Cost_type"),
EnCompPackage.Literals.COST__MAINTENANCE_COST_SHARE, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
}
/**
* 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(EnCompPackage.Literals.COST__INVESTMENT_COST);
}
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);
}
/**
......
......@@ -3,8 +3,8 @@
package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.Electricity;
import de.hftstuttgart.energycomponents.EnCompPackage;
import java.util.Collection;
import java.util.List;
......
......@@ -2,6 +2,8 @@
*/
package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.cityunits.model.quantities.provider.QuantitiesEditPlugin;
import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.util.ResourceLocator;
......@@ -36,7 +38,7 @@ public final class EnergyComponentsEditPlugin extends EMFPlugin {
* @generated
*/
public EnergyComponentsEditPlugin() {
super(new ResourceLocator[] {});
super(new ResourceLocator[] { QuantitiesEditPlugin.INSTANCE, });
}
/**
......
......@@ -4,6 +4,7 @@ package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.EnCompPackage;
import de.hftstuttgart.energycomponents.ExponentialFunction;
import java.util.Collection;
import java.util.List;
......@@ -11,6 +12,7 @@ import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
......@@ -131,20 +133,13 @@ public class ExponentialFunctionItemProvider extends ItemProviderAdapter impleme
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
* @generated
*/
@Override
public String getText(Object object) {
final ExponentialFunction exponentialFunction = (ExponentialFunction) object;
final StringBuilder txt = new StringBuilder("Parameter ");
txt.append(String.valueOf(exponentialFunction.getKey()));
txt.append(": ");
txt.append(" y = ");
txt.append(String.valueOf(exponentialFunction.getParameterB()));
txt.append(" * ");
txt.append(String.valueOf(exponentialFunction.getParameterA()));
txt.append("^x");
return txt.toString();
String label = ((ExponentialFunction) object).getKey();
return label == null || label.length() == 0 ? getString("_UI_ExponentialFunction_type")
: getString("_UI_ExponentialFunction_type") + " " + label;
}
/**
......
/**
*/
package de.hftstuttgart.energycomponents.provider;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
/**
* This is the item provider adapter for a {@link de.hftstuttgart.energycomponents.Function} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class FunctionItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FunctionItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* This returns Function.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Function"));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
return getString("_UI_Function_type");
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return EnergyComponentsEditPlugin.INSTANCE;
}
}
/**
*/
package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.Hydrocarbon;
import de.hftstuttgart.units.NullableQuantity;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
/**
* This is the item provider adapter for a {@link de.hftstuttgart.energycomponents.Hydrocarbon} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class HydrocarbonItemProvider extends MediumItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public HydrocarbonItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* This returns Hydrocarbon.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Hydrocarbon"));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
NullableQuantity labelValue = ((Hydrocarbon) object).getDensity();
String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ? getString("_UI_Hydrocarbon_type")
: getString("_UI_Hydrocarbon_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
......@@ -4,12 +4,15 @@ package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.EnCompPackage;
import de.hftstuttgart.energycomponents.LinearFunction;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
......@@ -130,19 +133,13 @@ public class LinearFunctionItemProvider extends ItemProviderAdapter implements I
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
* @generated
*/
@Override
public String getText(Object object) {
final LinearFunction linearFunction = (LinearFunction) object;
final StringBuilder txt = new StringBuilder("Parameter ");
txt.append(String.valueOf(linearFunction.getKey()));
txt.append(": ");
txt.append(" y = ");
txt.append(String.valueOf(linearFunction.getParameterM()));
txt.append("*x + ");
txt.append(String.valueOf(linearFunction.getParameterC()));
return txt.toString();
String label = ((LinearFunction) object).getKey();
return label == null || label.length() == 0 ? getString("_UI_LinearFunction_type")
: getString("_UI_LinearFunction_type") + " " + label;
}
/**
......
......@@ -4,6 +4,7 @@ package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.EnCompPackage;
import de.hftstuttgart.energycomponents.Material;
import java.util.Collection;
import java.util.List;
......
......@@ -4,6 +4,7 @@ package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.EnCompPackage;
import de.hftstuttgart.energycomponents.Medium;
import java.util.Collection;
import java.util.List;
......
......@@ -150,24 +150,13 @@ public class PolynomialFunctionItemProvider extends ItemProviderAdapter implemen
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
* @generated
*/
@Override
public String getText(Object object) {
final PolynomialFunction polynomialFunction = (PolynomialFunction) object;
final StringBuilder txt = new StringBuilder("Parameter ");
txt.append(String.valueOf(polynomialFunction.getKey()));
txt.append(": ");
txt.append(" y = ");
txt.append(String.valueOf(polynomialFunction.getParameterA()));
txt.append(" * ");
txt.append("x^2");
txt.append(" + ");
txt.append(String.valueOf(polynomialFunction.getParameterB()));
txt.append("x");
txt.append(" + ");
txt.append(String.valueOf(polynomialFunction.getParameterC()));
return txt.toString();
String label = ((PolynomialFunction) object).getKey();
return label == null || label.length() == 0 ? getString("_UI_PolynomialFunction_type")
: getString("_UI_PolynomialFunction_type") + " " + label;
}
/**
......
......@@ -133,22 +133,13 @@ public class PowerFunctionItemProvider extends ItemProviderAdapter implements IE
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
* @generated
*/
@Override
public String getText(Object object) {
final PowerFunction powerFunction = (PowerFunction) object;
final StringBuilder txt = new StringBuilder("Parameter ");
txt.append(String.valueOf(powerFunction.getKey()));
txt.append(": ");
txt.append(" y = ");
txt.append(String.valueOf(powerFunction.getParameterA()));
txt.append(" * ");
txt.append("x^");
txt.append(String.valueOf(powerFunction.getParameterB()));
return txt.toString();
String label = ((PowerFunction) object).getKey();
return label == null || label.length() == 0 ? getString("_UI_PowerFunction_type")
: getString("_UI_PowerFunction_type") + " " + label;
}
/**
......
/**
*/
package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.RegularFuel;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
/**
* This is the item provider adapter for a {@link de.hftstuttgart.energycomponents.RegularFuel} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class RegularFuelItemProvider extends FuelItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RegularFuelItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* This returns RegularFuel.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/RegularFuel"));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((RegularFuel) object).getName();
return label == null || label.length() == 0 ? getString("_UI_RegularFuel_type")
: getString("_UI_RegularFuel_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
/**
*/
package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.SaltHydrate;
import de.hftstuttgart.units.NullableQuantity;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
/**
* This is the item provider adapter for a {@link de.hftstuttgart.energycomponents.SaltHydrate} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class SaltHydrateItemProvider extends MediumItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SaltHydrateItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* This returns SaltHydrate.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/SaltHydrate"));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
NullableQuantity labelValue = ((SaltHydrate) object).getDensity();
String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ? getString("_UI_SaltHydrate_type")
: getString("_UI_SaltHydrate_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
......@@ -2,7 +2,6 @@
*/
package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.DataPoint;
import de.hftstuttgart.energycomponents.EnCompFactory;
import de.hftstuttgart.energycomponents.EnCompPackage;
import de.hftstuttgart.energycomponents.TableFunction;
......@@ -12,8 +11,9 @@ import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
......@@ -132,27 +132,13 @@ public class TableFunctionItemProvider extends ItemProviderAdapter implements IE
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
* @generated
*/
@Override
public String getText(Object object) {
final TableFunction tableFunction = ((TableFunction) object);
final EList<DataPoint> dataPoints = tableFunction.getDatapoints();
final int maxDisplayed = 5;
final StringBuilder txt = new StringBuilder("Parameter ");
txt.append(String.valueOf(tableFunction.getKey()));
txt.append(": ");
dataPoints.stream().limit(maxDisplayed).forEach(dp -> {
txt.append("(");
txt.append(String.valueOf(dp.getX()));
txt.append("|");
txt.append(String.valueOf(dp.getY()));
txt.append(") ");
});
if (dataPoints.size() > maxDisplayed) {
txt.append("...");
}
return txt.toString();
String label = ((TableFunction) object).getKey();
return label == null || label.length() == 0 ? getString("_UI_TableFunction_type")
: getString("_UI_TableFunction_type") + " " + label;
}
/**
......
/**
*/
package de.hftstuttgart.energycomponents.provider;
import de.hftstuttgart.energycomponents.Water;
import de.hftstuttgart.units.NullableQuantity;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
/**
* This is the item provider adapter for a {@link de.hftstuttgart.energycomponents.Water} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class WaterItemProvider extends MediumItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WaterItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
}
/**
* This returns Water.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Water"));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
NullableQuantity labelValue = ((Water) object).getDensity();
String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ? getString("_UI_Water_type")
: getString("_UI_Water_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
......@@ -2,8 +2,8 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: de.hftstuttgart.energycomponents.model;singleton:=true
Automatic-Module-Name: de.hftstuttgart.energycomponents
Bundle-Version: 1.0.0.qualifier
Automatic-Module-Name: de.hftstuttgart.energycomponents.model
Bundle-Version: 1.0.0
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
......@@ -13,5 +13,5 @@ Export-Package: de.hftstuttgart.energycomponents,
de.hftstuttgart.energycomponents.util
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
de.hftstuttgart.units;bundle-version="1.0.0"
de.hftstuttgart.cityunits.model;bundle-version="1.0.1";visibility:=reexport
Bundle-ActivationPolicy: lazy
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