Interface IFormExtensionService
-
public interface IFormExtensionService
Form extension suppliment service
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
filterExtensionBelongingObject(Form clone, Form extensionForm, IBmTransaction transaction)
Removes all non-extension form objects.Collection<org.eclipse.emf.ecore.EStructuralFeature>
getChangedFormItemFeatures(FormItem formItem)
Returns collection of all unchanged features of the form item.Optional<String>
getFixedCommandForExtension(FormItem preparedFormItem, org.eclipse.emf.ecore.EStructuralFeature formItemFeature, Form baseForm, Form extForm, Version version)
Calculate and return numeric value (if needed) for not referenced commands.boolean
isExtensionAdopted(Object object)
Returnstrue
if object belongs to the form extension and this form is adopted.boolean
isExtensionBelongingObject(Object object)
Returnstrue
if object has been created from the extension or adopted to the extension by user.boolean
isExtensionBelongingUnderlyingObject(DataItem dataItem)
Returnstrue
if underlying object (Command or FormAttribute) of form data item has been created from the extension or adopted to the extension by user.boolean
isFormItemPositionChanged(FormItem formItem)
Returnstrue
if the form item position has been changed in comparison with the form snapshot.boolean
isPureExtensionObject(Object object, Form extForm)
Returnstrue
if the given object has been created in the extension.boolean
isUnchangedExtensionObject(Object object)
Checks that current object has been changed in comparison with base form snapshot.boolean
isUnchangedExtensionObjectFull(Object object)
Checks that current object has been changed in comparison with base form snapshot.<T extends org.eclipse.emf.ecore.EObject>
TprepareToExport(T objectToExport, Form form)
Prepares object to export operation.boolean
shouldSkipForExport(Form extForm, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature formItemFeature)
Returnstrue
if current feature should be skipped.
-
-
-
Method Detail
-
isPureExtensionObject
boolean isPureExtensionObject(Object object, Form extForm)
Returnstrue
if the given object has been created in the extension. Returnsfalse
for all not-extension form and it's containments.- Parameters:
object
- some related to the form object, can't benull
extForm
- the extension form, can't benull
- Returns:
true
if the given object has been created in the extension.
-
isUnchangedExtensionObjectFull
boolean isUnchangedExtensionObjectFull(Object object)
Checks that current object has been changed in comparison with base form snapshot. Uses workaround to fix the issue described in G5V8DT-18132. WARNING! This method is *expensive* and is not intended to be used within performance sensitive parts like label provider etc.- Parameters:
object
- some form object, can't benull
- Returns:
true
if current object remains unchanged
-
isUnchangedExtensionObject
boolean isUnchangedExtensionObject(Object object)
Checks that current object has been changed in comparison with base form snapshot. Light version of getting the "unchanged" status of the adopted object. May result in incorrect data because of issue described in G5V8DT-18132. Can be temporary used for lightweight code like label providers.- Parameters:
object
- some form object, can't benull
- Returns:
true
if current object remains unchanged
-
isExtensionAdopted
boolean isExtensionAdopted(Object object)
Returnstrue
if object belongs to the form extension and this form is adopted. Non-adopted forms should be ignored by this service.Related form must have real
.baseForm
(form snapshot) instance. Proxy objects are not allowed.- Parameters:
object
- some related to the form object, can't benull
- Returns:
true
if object belongs to the extension- Throws:
IllegalArgumentException
- in case when determining object's project is impossible
-
isExtensionBelongingObject
boolean isExtensionBelongingObject(Object object)
Returnstrue
if object has been created from the extension or adopted to the extension by user.- Parameters:
object
- some object related to the form object, can't benull
- Returns:
true
if object has been created from the extension or adopted to the extension by user
-
isExtensionBelongingUnderlyingObject
boolean isExtensionBelongingUnderlyingObject(DataItem dataItem)
Returnstrue
if underlying object (Command or FormAttribute) of form data item has been created from the extension or adopted to the extension by user.- Parameters:
dataItem
- some form data item (either Button or FormField), can't benull
- Returns:
true
if underlying object has been created from the extension or adopted to the extension by user
-
filterExtensionBelongingObject
void filterExtensionBelongingObject(Form clone, Form extensionForm, IBmTransaction transaction)
Removes all non-extension form objects.This method will do nothing if the given argument does not relate to
IExtensionProject
-
prepareToExport
<T extends org.eclipse.emf.ecore.EObject> T prepareToExport(T objectToExport, Form form)
Prepares object to export operation.- Type Parameters:
T
- export object type- Parameters:
objectToExport
- object to export, cannot benull
form
- the form, cannot benull
- Returns:
- prepared to export object, never
null
-
getChangedFormItemFeatures
Collection<org.eclipse.emf.ecore.EStructuralFeature> getChangedFormItemFeatures(FormItem formItem)
Returns collection of all unchanged features of the form item. The given form item should be from adopted form.- Parameters:
formItem
- the form item, cannot benull
- Returns:
- collection of all unchanged features of the form item or empty collection for not adopted or
non-extension form, never
null
-
isFormItemPositionChanged
boolean isFormItemPositionChanged(FormItem formItem)
Returnstrue
if the form item position has been changed in comparison with the form snapshot.- Parameters:
formItem
- the form item , cannot benull
- Returns:
true
if the form item position has been changed
-
shouldSkipForExport
boolean shouldSkipForExport(Form extForm, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature formItemFeature)
Returnstrue
if current feature should be skipped.- Parameters:
extForm
- the extension form model, can't benull
eObject
- some form containment, can't benull
formItemFeature
- the form item feature, may benull
- Returns:
true
if the given feature should be skipped for export operation
-
getFixedCommandForExtension
Optional<String> getFixedCommandForExtension(FormItem preparedFormItem, org.eclipse.emf.ecore.EStructuralFeature formItemFeature, Form baseForm, Form extForm, Version version)
Calculate and return numeric value (if needed) for not referenced commands. If command name is not supposed to be changed then Optional.empty() is returned.- Parameters:
preparedFormItem
- the form item for export, can't benull
formItemFeature
- the form item feature, can't benull
baseForm
- the base form (snapshot), can't benull
extForm
- the extension form, can't benull
version
- the exporting project Version, can't benull
- Returns:
- optional string with new command name
-
-