blob: 93c587982e772f27a54779ac9d407cdae1476960 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*/
package org.eclipse.osbp.ecview.core.extension.model.extension.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.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IChildCreationExtender;
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;
import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage;
import org.eclipse.osbp.ecview.core.extension.model.extension.YAbsoluteLayoutCellStyle;
/**
* This is the item provider adapter for a {@link org.eclipse.osbp.ecview.core.extension.model.extension.YAbsoluteLayoutCellStyle} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class YAbsoluteLayoutCellStyleItemProvider
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 YAbsoluteLayoutCellStyleItemProvider(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);
addTargetPropertyDescriptor(object);
addTopPropertyDescriptor(object);
addBottomPropertyDescriptor(object);
addLeftPropertyDescriptor(object);
addRightPropertyDescriptor(object);
addZIndexPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Target feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addTargetPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YAbsoluteLayoutCellStyle_target_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YAbsoluteLayoutCellStyle_target_feature", "_UI_YAbsoluteLayoutCellStyle_type"),
ExtensionModelPackage.Literals.YABSOLUTE_LAYOUT_CELL_STYLE__TARGET,
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Top feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addTopPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YAbsoluteLayoutCellStyle_top_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YAbsoluteLayoutCellStyle_top_feature", "_UI_YAbsoluteLayoutCellStyle_type"),
ExtensionModelPackage.Literals.YABSOLUTE_LAYOUT_CELL_STYLE__TOP,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Bottom feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addBottomPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YAbsoluteLayoutCellStyle_bottom_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YAbsoluteLayoutCellStyle_bottom_feature", "_UI_YAbsoluteLayoutCellStyle_type"),
ExtensionModelPackage.Literals.YABSOLUTE_LAYOUT_CELL_STYLE__BOTTOM,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Left feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addLeftPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YAbsoluteLayoutCellStyle_left_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YAbsoluteLayoutCellStyle_left_feature", "_UI_YAbsoluteLayoutCellStyle_type"),
ExtensionModelPackage.Literals.YABSOLUTE_LAYOUT_CELL_STYLE__LEFT,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Right feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addRightPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YAbsoluteLayoutCellStyle_right_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YAbsoluteLayoutCellStyle_right_feature", "_UI_YAbsoluteLayoutCellStyle_type"),
ExtensionModelPackage.Literals.YABSOLUTE_LAYOUT_CELL_STYLE__RIGHT,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the ZIndex feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addZIndexPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_YAbsoluteLayoutCellStyle_zIndex_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_YAbsoluteLayoutCellStyle_zIndex_feature", "_UI_YAbsoluteLayoutCellStyle_type"),
ExtensionModelPackage.Literals.YABSOLUTE_LAYOUT_CELL_STYLE__ZINDEX,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
/**
* This returns YAbsoluteLayoutCellStyle.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/YAbsoluteLayoutCellStyle"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
YAbsoluteLayoutCellStyle yAbsoluteLayoutCellStyle = (YAbsoluteLayoutCellStyle)object;
return getString("_UI_YAbsoluteLayoutCellStyle_type") + " " + yAbsoluteLayoutCellStyle.getTop();
}
/**
* 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(YAbsoluteLayoutCellStyle.class)) {
case ExtensionModelPackage.YABSOLUTE_LAYOUT_CELL_STYLE__TOP:
case ExtensionModelPackage.YABSOLUTE_LAYOUT_CELL_STYLE__BOTTOM:
case ExtensionModelPackage.YABSOLUTE_LAYOUT_CELL_STYLE__LEFT:
case ExtensionModelPackage.YABSOLUTE_LAYOUT_CELL_STYLE__RIGHT:
case ExtensionModelPackage.YABSOLUTE_LAYOUT_CELL_STYLE__ZINDEX:
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 ((IChildCreationExtender)adapterFactory).getResourceLocator();
}
}