blob: ce6b3a0df96537560fde3d2855ca1212e5c62f06 [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2015-2021 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.model.provider;
import java.util.Collection;
import java.util.List;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.LocalModeLabel;
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 org.eclipse.app4mc.amalthea.model.LocalModeLabel} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class LocalModeLabelItemProvider extends ReferableBaseObjectItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LocalModeLabelItemProvider(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);
addContainingExecutablePropertyDescriptor(object);
addModePropertyDescriptor(object);
addDefaultValuePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Containing Executable feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addContainingExecutablePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LocalModeLabel_containingExecutable_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LocalModeLabel_containingExecutable_feature", "_UI_LocalModeLabel_type"),
AmaltheaPackage.eINSTANCE.getLocalModeLabel_ContainingExecutable(),
false,
false,
false,
null,
getString("_UI_ReadonlyPropertyCategory"),
null));
}
/**
* This adds a property descriptor for the Mode feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addModePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LocalModeLabel_mode_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LocalModeLabel_mode_feature", "_UI_LocalModeLabel_type"),
AmaltheaPackage.eINSTANCE.getLocalModeLabel_Mode(),
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Default Value feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addDefaultValuePropertyDescriptorGen(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LocalModeLabel_defaultValue_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LocalModeLabel_defaultValue_feature", "_UI_LocalModeLabel_type"),
AmaltheaPackage.eINSTANCE.getLocalModeLabel_DefaultValue(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* @generated NOT
*/
protected void addDefaultValuePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(new ItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LocalModeLabel_defaultValue_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LocalModeLabel_defaultValue_feature", "_UI_LocalModeLabel_type"),
AmaltheaPackage.eINSTANCE.getLocalModeLabel_DefaultValue(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null) {
@Override
public Collection<?> getChoiceOfValues(Object object) {
return CustomPropertyDescriptorService.getDefaultValuesForLocalModeLabel(object);
}
}
);
}
/**
* This returns LocalModeLabel.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/LocalModeLabel"));
}
/**
* <!-- 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
*/
public String getTextGen(Object object) {
String label = ((LocalModeLabel)object).getQualifiedName();
return label == null || label.length() == 0 ?
getString("_UI_LocalModeLabel_type") :
getString("_UI_LocalModeLabel_type") + " " + label;
}
/**
* @generated NOT
*/
@Override
public String getText(final Object object) {
// delegate to custom item provider
return CustomItemProviderService.getLocalModeLabelItemProviderText(object, getTextGen(object));
}
/**
* 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
*/
public void notifyChangedGen(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(LocalModeLabel.class)) {
case AmaltheaPackage.LOCAL_MODE_LABEL__DEFAULT_VALUE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
/**
* @generated NOT
*/
@Override
public void notifyChanged(final Notification notification) {
updateChildren(notification);
// delegate to custom item provider and execute locally
final ViewerNotification vn = CustomItemProviderService.getLocalModeLabelItemProviderNotification(notification);
if (vn != null) {
fireNotifyChanged(vn);
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);
}
}