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

Demo catalog with data model and generated classes

parent d9b6ae6f
# Created by https://www.toptal.com/developers/gitignore/api/linux,windows,macos,eclipse,java
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,windows,macos,eclipse,java
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
.apt_generated_test/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.toptal.com/developers/gitignore/api/linux,windows,macos,eclipse,java
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>demo.catalog.edit</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: demo.catalog.edit;singleton:=true
Automatic-Module-Name: demo.catalog.edit
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: demo.catalog.democatalog.provider.democatalogEditPlugin$Implementation
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: demo.catalog.democatalog.provider
Require-Bundle: org.eclipse.core.runtime,
demo.catalog;visibility:=reexport,
org.eclipse.emf.edit;visibility:=reexport
Bundle-ActivationPolicy: lazy
#
bin.includes = .,\
icons/,\
META-INF/,\
plugin.xml,\
plugin.properties
jars.compile.order = .
source.. = src-gen/
output.. = bin/
#
pluginName = demo.catalog Edit Support
providerName = www.example.org
_UI_CreateChild_text = {0}
_UI_CreateChild_text2 = {1} {0}
_UI_CreateChild_text3 = {1}
_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_EnergyComponentsCatalog_type = Energy Components Catalog
_UI_Boiler_type = Boiler
_UI_CombinedHeatPower_type = Combined Heat Power
_UI_SolarPanel_type = Solar Panel
_UI_Inverter_type = Inverter
_UI_Manufacturer_type = Manufacturer
_UI_ChemicalEnergyDevice_type = Chemical Energy Device
_UI_EnergyComponent_type = Energy Component
_UI_Unknown_type = Object
_UI_Unknown_datatype= Value
_UI_EnergyComponentsCatalog_author_feature = Author
_UI_EnergyComponentsCatalog_boilers_feature = Boilers
_UI_EnergyComponentsCatalog_chps_feature = Chps
_UI_EnergyComponentsCatalog_solarpanels_feature = Solarpanels
_UI_EnergyComponentsCatalog_inverters_feature = Inverters
_UI_EnergyComponentsCatalog_manufacturers_feature = Manufacturers
_UI_Boiler_boilerType_feature = Boiler Type
_UI_CombinedHeatPower_thermalEfficiency_feature = Thermal Efficiency
_UI_SolarPanel_nominalPower_feature = Nominal Power
_UI_Inverter_nominalPower_feature = Nominal Power
_UI_Manufacturer_name_feature = Name
_UI_ChemicalEnergyDevice_installedThermalPower_feature = Installed Thermal Power
_UI_EnergyComponent_modelName_feature = Model Name
_UI_EnergyComponent_revisionYear_feature = Revision Year
_UI_EnergyComponent_producedBy_feature = Produced By
_UI_Unknown_feature = Unspecified
_UI_BoilerType_LowTemperature_literal = LowTemperature
_UI_BoilerType_Condensing_literal = Condensing
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
-->
<plugin>
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<!-- @generated democatalog -->
<factory
uri="http://www.example.org/democatalog"
class="demo.catalog.democatalog.provider.democatalogItemProviderAdapterFactory"
supportedTypes=
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
org.eclipse.emf.edit.provider.ITreeItemContentProvider
org.eclipse.emf.edit.provider.IItemLabelProvider
org.eclipse.emf.edit.provider.IItemPropertySource"/>
</extension>
</plugin>
/**
*/
package demo.catalog.democatalog.provider;
import demo.catalog.democatalog.Boiler;
import demo.catalog.democatalog.democatalogPackage;
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.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link demo.catalog.democatalog.Boiler} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class BoilerItemProvider extends ChemicalEnergyDeviceItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BoilerItemProvider(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);
addBoilerTypePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Boiler Type feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addBoilerTypePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Boiler_boilerType_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Boiler_boilerType_feature",
"_UI_Boiler_type"),
democatalogPackage.Literals.BOILER__BOILER_TYPE, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
* This returns Boiler.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Boiler"));
}
/**
* <!-- 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 = ((Boiler) object).getModelName();
return label == null || label.length() == 0 ? getString("_UI_Boiler_type")
: getString("_UI_Boiler_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);
switch (notification.getFeatureID(Boiler.class)) {
case democatalogPackage.BOILER__BOILER_TYPE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
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 demo.catalog.democatalog.provider;
import demo.catalog.democatalog.ChemicalEnergyDevice;
import demo.catalog.democatalog.democatalogPackage;
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.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link demo.catalog.democatalog.ChemicalEnergyDevice} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ChemicalEnergyDeviceItemProvider extends EnergyComponentItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ChemicalEnergyDeviceItemProvider(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);
addInstalledThermalPowerPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Installed Thermal Power feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addInstalledThermalPowerPropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
getString("_UI_ChemicalEnergyDevice_installedThermalPower_feature"),
getString("_UI_PropertyDescriptor_description",
"_UI_ChemicalEnergyDevice_installedThermalPower_feature", "_UI_ChemicalEnergyDevice_type"),
democatalogPackage.Literals.CHEMICAL_ENERGY_DEVICE__INSTALLED_THERMAL_POWER, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
}
/**
* <!-- 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 = ((ChemicalEnergyDevice) object).getModelName();
return label == null || label.length() == 0 ? getString("_UI_ChemicalEnergyDevice_type")
: getString("_UI_ChemicalEnergyDevice_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);
switch (notification.getFeatureID(ChemicalEnergyDevice.class)) {
case democatalogPackage.CHEMICAL_ENERGY_DEVICE__INSTALLED_THERMAL_POWER:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
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 demo.catalog.democatalog.provider;
import demo.catalog.democatalog.CombinedHeatPower;
import demo.catalog.democatalog.democatalogPackage;
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.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link demo.catalog.democatalog.CombinedHeatPower} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class CombinedHeatPowerItemProvider extends ChemicalEnergyDeviceItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CombinedHeatPowerItemProvider(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);
addThermalEfficiencyPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Thermal Efficiency feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addThermalEfficiencyPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_CombinedHeatPower_thermalEfficiency_feature"),
getString("_UI_PropertyDescriptor_description",
"_UI_CombinedHeatPower_thermalEfficiency_feature", "_UI_CombinedHeatPower_type"),
democatalogPackage.Literals.COMBINED_HEAT_POWER__THERMAL_EFFICIENCY, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
}
/**
* This returns CombinedHeatPower.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/CombinedHeatPower"));
}
/**
* <!-- 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 = ((CombinedHeatPower) object).getModelName();
return label == null || label.length() == 0 ? getString("_UI_CombinedHeatPower_type")
: getString("_UI_CombinedHeatPower_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);
switch (notification.getFeatureID(CombinedHeatPower.class)) {
case democatalogPackage.COMBINED_HEAT_POWER__THERMAL_EFFICIENCY:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
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 demo.catalog.democatalog.provider;
import demo.catalog.democatalog.EnergyComponent;
import demo.catalog.democatalog.democatalogPackage;
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;
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.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link demo.catalog.democatalog.EnergyComponent} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class EnergyComponentItemProvider 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 EnergyComponentItemProvider(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);
addModelNamePropertyDescriptor(object);
addRevisionYearPropertyDescriptor(object);
addProducedByPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Model Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addModelNamePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_EnergyComponent_modelName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_EnergyComponent_modelName_feature",
"_UI_EnergyComponent_type"),
democatalogPackage.Literals.ENERGY_COMPONENT__MODEL_NAME, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
* This adds a property descriptor for the Revision Year feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addRevisionYearPropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
getString("_UI_EnergyComponent_revisionYear_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_EnergyComponent_revisionYear_feature",
"_UI_EnergyComponent_type"),
democatalogPackage.Literals.ENERGY_COMPONENT__REVISION_YEAR, true, false, false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null));
}
/**
* This adds a property descriptor for the Produced By feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addProducedByPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_EnergyComponent_producedBy_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_EnergyComponent_producedBy_feature",
"_UI_EnergyComponent_type"),
democatalogPackage.Literals.ENERGY_COMPONENT__PRODUCED_BY, true, false, true, null, null,
null));
}
/**
* <!-- 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 = ((EnergyComponent) object).getModelName();
return label == null || label.length() == 0 ? getString("_UI_EnergyComponent_type")
: getString("_UI_EnergyComponent_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);
switch (notification.getFeatureID(EnergyComponent.class)) {
case democatalogPackage.ENERGY_COMPONENT__MODEL_NAME:
case democatalogPackage.ENERGY_COMPONENT__REVISION_YEAR:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
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 democatalogEditPlugin.INSTANCE;
}
}
/**
*/
package demo.catalog.democatalog.provider;
import demo.catalog.democatalog.EnergyComponentsCatalog;
import demo.catalog.democatalog.democatalogFactory;
import demo.catalog.democatalog.democatalogPackage;
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.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
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.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link demo.catalog.democatalog.EnergyComponentsCatalog} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class EnergyComponentsCatalogItemProvider 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 EnergyComponentsCatalogItemProvider(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);
addAuthorPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Author feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addAuthorPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_EnergyComponentsCatalog_author_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_EnergyComponentsCatalog_author_feature",
"_UI_EnergyComponentsCatalog_type"),
democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__AUTHOR, true, false, false,
ItemPropertyDescriptor.GENERIC_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(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__BOILERS);
childrenFeatures.add(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__CHPS);
childrenFeatures.add(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__SOLARPANELS);
childrenFeatures.add(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__INVERTERS);
childrenFeatures.add(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__MANUFACTURERS);
}
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 EnergyComponentsCatalog.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/EnergyComponentsCatalog"));
}
/**
* <!-- 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 = ((EnergyComponentsCatalog) object).getAuthor();
return label == null || label.length() == 0 ? getString("_UI_EnergyComponentsCatalog_type")
: getString("_UI_EnergyComponentsCatalog_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);
switch (notification.getFeatureID(EnergyComponentsCatalog.class)) {
case democatalogPackage.ENERGY_COMPONENTS_CATALOG__AUTHOR:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case democatalogPackage.ENERGY_COMPONENTS_CATALOG__BOILERS:
case democatalogPackage.ENERGY_COMPONENTS_CATALOG__CHPS:
case democatalogPackage.ENERGY_COMPONENTS_CATALOG__SOLARPANELS:
case democatalogPackage.ENERGY_COMPONENTS_CATALOG__INVERTERS:
case democatalogPackage.ENERGY_COMPONENTS_CATALOG__MANUFACTURERS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
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);
newChildDescriptors.add(createChildParameter(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__BOILERS,
democatalogFactory.eINSTANCE.createBoiler()));
newChildDescriptors.add(createChildParameter(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__CHPS,
democatalogFactory.eINSTANCE.createCombinedHeatPower()));
newChildDescriptors.add(createChildParameter(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__SOLARPANELS,
democatalogFactory.eINSTANCE.createSolarPanel()));
newChildDescriptors.add(createChildParameter(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__INVERTERS,
democatalogFactory.eINSTANCE.createInverter()));
newChildDescriptors
.add(createChildParameter(democatalogPackage.Literals.ENERGY_COMPONENTS_CATALOG__MANUFACTURERS,
democatalogFactory.eINSTANCE.createManufacturer()));
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return democatalogEditPlugin.INSTANCE;
}
}
/**
*/
package demo.catalog.democatalog.provider;
import demo.catalog.democatalog.Inverter;
import demo.catalog.democatalog.democatalogPackage;
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.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link demo.catalog.democatalog.Inverter} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class InverterItemProvider extends EnergyComponentItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InverterItemProvider(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);
addNominalPowerPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Nominal Power feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addNominalPowerPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Inverter_nominalPower_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Inverter_nominalPower_feature",
"_UI_Inverter_type"),
democatalogPackage.Literals.INVERTER__NOMINAL_POWER, true, false, false,
ItemPropertyDescriptor.REAL_VALUE_IMAGE, null, null));
}
/**
* This returns Inverter.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Inverter"));
}
/**
* <!-- 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 = ((Inverter) object).getModelName();
return label == null || label.length() == 0 ? getString("_UI_Inverter_type")
: getString("_UI_Inverter_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);
switch (notification.getFeatureID(Inverter.class)) {
case democatalogPackage.INVERTER__NOMINAL_POWER:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
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 demo.catalog.democatalog.provider;
import demo.catalog.democatalog.Manufacturer;
import demo.catalog.democatalog.democatalogPackage;
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;
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.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link demo.catalog.democatalog.Manufacturer} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ManufacturerItemProvider 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 ManufacturerItemProvider(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);
addNamePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addNamePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_Manufacturer_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Manufacturer_name_feature",
"_UI_Manufacturer_type"),
democatalogPackage.Literals.MANUFACTURER__NAME, true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}
/**
* This returns Manufacturer.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Manufacturer"));
}
/**
* <!-- 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 = ((Manufacturer) object).getName();
return label == null || label.length() == 0 ? getString("_UI_Manufacturer_type")
: getString("_UI_Manufacturer_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);
switch (notification.getFeatureID(Manufacturer.class)) {
case democatalogPackage.MANUFACTURER__NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
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 democatalogEditPlugin.INSTANCE;
}
}
Supports Markdown
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