From be4f78978faba3d3ceb88df02a7f93a2e09ff1e0 Mon Sep 17 00:00:00 2001 From: Kenji Hosokawa Date: Tue, 3 Aug 2021 18:42:39 +0900 Subject: Initial commit Bug-AGL: SPEC-4033 Signed-off-by: Kenji Hosokawa --- .../provider/ComplexExpressionItemProvider.java | 304 +++++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 rba.model.core.edit/src/rba/core/provider/ComplexExpressionItemProvider.java (limited to 'rba.model.core.edit/src/rba/core/provider/ComplexExpressionItemProvider.java') diff --git a/rba.model.core.edit/src/rba/core/provider/ComplexExpressionItemProvider.java b/rba.model.core.edit/src/rba/core/provider/ComplexExpressionItemProvider.java new file mode 100644 index 0000000..2f7765c --- /dev/null +++ b/rba.model.core.edit/src/rba/core/provider/ComplexExpressionItemProvider.java @@ -0,0 +1,304 @@ +/** + */ +package rba.core.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.ecore.EStructuralFeature; + +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +import rba.core.ComplexExpression; +import rba.core.ExpressionType; +import rba.core.RBACoreFactory; +import rba.core.RBACorePackage; + +/** + * This is the item provider adapter for a {@link rba.core.ComplexExpression} object. + * @generated + */ +public class ComplexExpressionItemProvider extends ExpressionItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * @generated + */ + public ComplexExpressionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * 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}. + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION); + } + return childrenFeatures; + } + + /** + * + * @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 ComplexExpression.gif. + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ComplexExpression")); + } + + /** + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * @generated + */ + @Override + public String getText(Object object) { + ExpressionType labelValue = ((ComplexExpression) object).getType(); + String label = labelValue == null ? null : labelValue.toString(); + return label == null || label.length() == 0 ? getString("_UI_ComplexExpression_type") + : getString("_UI_ComplexExpression_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}. + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(ComplexExpression.class)) { + case RBACorePackage.COMPLEX_EXPRESSION__OTHER_EXPRESSION: + 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. + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createComplexExpression())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsTypeOf())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createObjectReference())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createPreviousModifier())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createGreaterThanOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createMuchGreaterThanOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createLowerThanOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createEqualToOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createComparisonAnd())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createAndOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createOrOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createNotOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsEqualToOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsGreaterThanOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsLowerThanOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsGreaterThanEqualOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsLowerThanEqualOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createPlusOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createImpliesOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsActive())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createGetAllocatables())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createHasBeenDisplayed())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createActiveState())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createObjectCompare())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createThatOfOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createMaxValue())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createMinValue())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createNoneValue())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createStandardValue())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIntegerValue())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createLoserTypeExpression())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createArbitrationPolicyExpression())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createSizeOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createExistsOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createForAllOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createMaxOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createMinOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createSelectOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createSetOfOperator())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createLambdaExpression())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIfStatement())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsOn())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createAllocatedContent())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createContentValue())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createGetContentsList())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createActiveContents())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createGetProperty())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createStateValue())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createHasComeLaterThan())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createHasComeEarlierThan())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createObjectCompareNot())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsAllocatedTo())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsChanged())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createIsTranslatedTo())); + + newChildDescriptors.add(createChildParameter(RBACorePackage.Literals.COMPLEX_EXPRESSION__OTHER_EXPRESSION, + RBACoreFactory.eINSTANCE.createNullExpression())); + } + +} -- cgit 1.2.3-korg