blob: e87ab0368315cd3fb96d857c4ca096d0738ddc8d [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.ecview.semantic.uimodel.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.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.osbp.ecview.semantic.uimodel.UiExposedAction;
import org.eclipse.osbp.ecview.semantic.uimodel.UiModelPackage;
/**
* This is the item provider adapter for a {@link org.eclipse.osbp.ecview.semantic.uimodel.UiExposedAction} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class UiExposedActionItemProvider extends UiActionItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UiExposedActionItemProvider(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);
addActionReferencePropertyDescriptor(object);
addActionIDPropertyDescriptor(object);
addIconNamePropertyDescriptor(object);
addCheckDirtyPropertyDescriptor(object);
addExternalCommandIdPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Action Reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addActionReferencePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_UiExposedAction_actionReference_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_UiExposedAction_actionReference_feature", "_UI_UiExposedAction_type"),
UiModelPackage.Literals.UI_EXPOSED_ACTION__ACTION_REFERENCE,
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Action ID feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addActionIDPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_UiExposedAction_actionID_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_UiExposedAction_actionID_feature", "_UI_UiExposedAction_type"),
UiModelPackage.Literals.UI_EXPOSED_ACTION__ACTION_ID,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Icon Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addIconNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_UiExposedAction_iconName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_UiExposedAction_iconName_feature", "_UI_UiExposedAction_type"),
UiModelPackage.Literals.UI_EXPOSED_ACTION__ICON_NAME,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Check Dirty feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addCheckDirtyPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_UiExposedAction_checkDirty_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_UiExposedAction_checkDirty_feature", "_UI_UiExposedAction_type"),
UiModelPackage.Literals.UI_EXPOSED_ACTION__CHECK_DIRTY,
true,
false,
false,
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the External Command Id feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addExternalCommandIdPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_UiExposedAction_externalCommandId_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_UiExposedAction_externalCommandId_feature", "_UI_UiExposedAction_type"),
UiModelPackage.Literals.UI_EXPOSED_ACTION__EXTERNAL_COMMAND_ID,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This returns UiExposedAction.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/UiExposedAction"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((UiExposedAction)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_UiExposedAction_type") :
getString("_UI_UiExposedAction_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(UiExposedAction.class)) {
case UiModelPackage.UI_EXPOSED_ACTION__ACTION_ID:
case UiModelPackage.UI_EXPOSED_ACTION__ICON_NAME:
case UiModelPackage.UI_EXPOSED_ACTION__CHECK_DIRTY:
case UiModelPackage.UI_EXPOSED_ACTION__EXTERNAL_COMMAND_ID:
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);
}
}